Skip to content

[search] Flatten async tests and samples into parent directories#45815

Open
hizixin wants to merge 1 commit intomainfrom
search/flatten-async-tests
Open

[search] Flatten async tests and samples into parent directories#45815
hizixin wants to merge 1 commit intomainfrom
search/flatten-async-tests

Conversation

@hizixin
Copy link
Member

@hizixin hizixin commented Mar 20, 2026

Move async test files from tests/async_tests/ to tests/ and async sample files from samples/async_samples/ to samples/, aligning with the repo-wide convention.

Update all internal references:

  • conftest.py: remove Python 3.5 async_tests ignore
  • aio/_operations/_patch.py: fix literalinclude paths
  • samples/README.md: fix async sample links

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@hizixin hizixin requested review from a team as code owners March 20, 2026 01:00
Copilot AI review requested due to automatic review settings March 20, 2026 01:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR flattens the Azure Search Documents package’s async tests and async samples into their parent tests/ and samples/ directories, aligning the package layout with the repo convention and updating internal references that depended on the old subfolders.

Changes:

  • Move async test modules into sdk/search/azure-search-documents/tests/ and remove legacy async_tests collection ignores.
  • Move async samples into sdk/search/azure-search-documents/samples/ and adjust sample utilities/data path logic accordingly.
  • Update documentation references (Sphinx literalinclude paths and samples/README.md links) to the new sample locations.

Reviewed changes

Copilot reviewed 7 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/search/azure-search-documents/tests/test_search_indexer_client_live_async.py Adds/moves async live indexer client tests into tests/.
sdk/search/azure-search-documents/tests/test_search_index_client_synonym_map_live_async.py Adds/moves async live synonym map tests into tests/.
sdk/search/azure-search-documents/tests/test_search_index_client_skillset_live_async.py Adds/moves async live skillset tests into tests/.
sdk/search/azure-search-documents/tests/test_search_index_client_live_async.py Adds/moves async live index client tests into tests/.
sdk/search/azure-search-documents/tests/test_search_index_client_data_source_live_async.py Adds/moves async live data source tests into tests/.
sdk/search/azure-search-documents/tests/test_search_index_client_async.py Adds async unit-test helper (await_prepared_test) for async tests.
sdk/search/azure-search-documents/tests/test_search_index_client_alias_live_async.py Adds/moves async live alias tests into tests/.
sdk/search/azure-search-documents/tests/test_search_client_search_live_async.py Adds/moves async live search query tests into tests/.
sdk/search/azure-search-documents/tests/test_search_client_index_document_live_async.py Adds/moves async live document indexing tests into tests/.
sdk/search/azure-search-documents/tests/test_search_client_buffered_sender_live_async.py Adds/moves async live buffered sender tests into tests/.
sdk/search/azure-search-documents/tests/test_search_client_basic_live_async.py Adds/moves basic async live tests into tests/.
sdk/search/azure-search-documents/tests/test_search_client_async.py Adds/moves async unit tests into tests/ and updates helper import usage.
sdk/search/azure-search-documents/tests/test_knowledge_source_web_live_async.py Adds/moves async live web knowledge source tests into tests/.
sdk/search/azure-search-documents/tests/test_knowledge_source_remote_sharepoint_live_async.py Adds/moves async live remote SharePoint knowledge source tests into tests/.
sdk/search/azure-search-documents/tests/test_knowledge_base_live_async.py Adds/moves async live knowledge base tests into tests/.
sdk/search/azure-search-documents/tests/test_knowledge_base_configuration_live_async.py Adds/moves async live knowledge base configuration tests into tests/.
sdk/search/azure-search-documents/tests/test_buffered_sender_async.py Adds/moves async buffered sender unit tests into tests/.
sdk/search/azure-search-documents/tests/conftest.py Removes legacy Python<3.5 async test ignore logic.
sdk/search/azure-search-documents/samples/sample_search_client_custom_request_async.py Updates sample utils import path logic after flattening samples.
sdk/search/azure-search-documents/samples/sample_query_vector_async.py Updates data path logic after flattening samples.
sdk/search/azure-search-documents/samples/sample_query_suggestions_async.py Adds/moves async suggestions sample into samples/.
sdk/search/azure-search-documents/samples/sample_query_simple_async.py Adds/moves async simple query sample into samples/.
sdk/search/azure-search-documents/samples/sample_query_session_async.py Adds/moves async session consistency sample into samples/.
sdk/search/azure-search-documents/samples/sample_query_semantic_async.py Adds/moves async semantic query sample into samples/.
sdk/search/azure-search-documents/samples/sample_query_filter_async.py Adds/moves async filter query sample into samples/.
sdk/search/azure-search-documents/samples/sample_query_facets_async.py Adds/moves async facets query sample into samples/.
sdk/search/azure-search-documents/samples/sample_query_autocomplete_async.py Adds/moves async autocomplete sample into samples/.
sdk/search/azure-search-documents/samples/sample_indexer_datasource_crud_async.py Adds/moves async indexer datasource CRUD sample into samples/.
sdk/search/azure-search-documents/samples/sample_indexer_crud_async.py Adds/moves async indexer CRUD sample into samples/.
sdk/search/azure-search-documents/samples/sample_index_synonym_map_crud_async.py Updates data path logic after flattening samples.
sdk/search/azure-search-documents/samples/sample_index_crud_async.py Adds/moves async index CRUD sample into samples/.
sdk/search/azure-search-documents/samples/sample_index_client_custom_request_async.py Updates sample utils import path logic after flattening samples.
sdk/search/azure-search-documents/samples/sample_index_analyze_text_async.py Adds/moves async analyze-text sample into samples/.
sdk/search/azure-search-documents/samples/sample_index_alias_crud_async.py Adds/moves async alias CRUD sample into samples/.
sdk/search/azure-search-documents/samples/sample_documents_crud_async.py Adds/moves async documents CRUD sample into samples/.
sdk/search/azure-search-documents/samples/sample_documents_buffered_sender_async.py Adds/moves async buffered sender sample into samples/.
sdk/search/azure-search-documents/samples/sample_authentication_async.py Adds/moves async auth sample into samples/.
sdk/search/azure-search-documents/samples/sample_agentic_retrieval_async.py Adds/moves async agentic retrieval sample into samples/.
sdk/search/azure-search-documents/samples/README.md Updates async sample links to new flattened locations.
sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py Updates Sphinx literalinclude sample paths for async API docs.
Comments suppressed due to low confidence (3)

sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py:243

  • In upload_documents docstring, the literalinclude pulls the [START get_document_async] snippet from sample_documents_crud_async.py, but the caption says it's an upload example. This causes the generated docs to show the wrong code sample; update the start/end tags to reference the upload snippet (e.g., [START upload_document_async]).
        .. admonition:: Example:

            .. literalinclude:: ../samples/sample_documents_crud_async.py
                :start-after: [START get_document_async]
                :end-before: [END get_document_async]
                :language: python
                :dedent: 4
                :caption: Upload new documents to an index

sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py:654

  • The autocomplete method's docstring literalinclude points to sample_query_suggestions_async.py and uses the suggest_query_async markers. This makes the autocomplete docs embed the suggest sample. Update the include path/markers to use the autocomplete sample (sample_query_autocomplete_async.py, autocomplete_query_async).
        .. admonition:: Example:

            .. literalinclude:: ../samples/sample_query_suggestions_async.py
                :start-after: [START suggest_query_async]
                :end-before: [END suggest_query_async]
                :language: python
                :dedent: 4
                :caption: Get autocomplete suggestions.

sdk/search/azure-search-documents/azure/search/documents/aio/_operations/_patch.py:734

  • The suggest method's docstring literalinclude points to sample_query_autocomplete_async.py and uses the autocomplete_query_async markers, so the suggest docs embed the autocomplete sample. Swap this to the suggest sample (sample_query_suggestions_async.py, suggest_query_async) to keep the docs accurate.
        .. admonition:: Example:

            .. literalinclude:: ../samples/sample_query_autocomplete_async.py
                :start-after: [START autocomplete_query_async]
                :end-before: [END autocomplete_query_async]
                :language: python
                :dedent: 4
                :caption: Get search suggestions.
        """

@hizixin hizixin changed the title [Search] Flatten async tests and samples into parent directories [search] Flatten async tests and samples into parent directories Mar 20, 2026
@github-actions
Copy link

github-actions bot commented Mar 20, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-search-documents

Move async test files from tests/async_tests/ to tests/ and async
sample files from samples/async_samples/ to samples/, aligning
with the repo-wide convention (225/309 packages use flat layout).

Update all internal references:
- conftest.py: remove Python 3.5 async_tests ignore
- aio/_operations/_patch.py: fix literalinclude paths
- samples/README.md: fix async sample links
- Fix .parents[1] to .parent in 4 async samples (now same dir as data/)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@hizixin hizixin force-pushed the search/flatten-async-tests branch from 4f5d531 to dc9c3c3 Compare March 20, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants