From 7e4b6f0dfdb4ef5b6aff6c9c4c07e4d733c1c54f Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 31 Jul 2026 17:24:24 -0700 Subject: [PATCH 1/9] Switch to adb-free for CI --- .github/workflows/test.yaml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 6fda3b5..a26e78f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,6 +9,20 @@ permissions: jobs: test: runs-on: ${{ matrix.os }} + services: + adb: + image: ghcr.io/oracle/adb-free:latest-26ai + env: + WORKLOAD_TYPE: ATP + START_ORDS: "False" + ENABLE_ARCHIVE_LOG: "False" + ADMIN_PASSWORD: ${{ secrets.PYSAI_TEST_ADMIN_PASSWORD }} + WALLET_PASSWORD: ${{ secrets.PYSAI_TEST_WALLET_PASSWORD }} + ports: + - 1521:1521 + options: >- + --cap-add SYS_ADMIN + --device /dev/fuse strategy: fail-fast: true matrix: @@ -36,6 +50,17 @@ jobs: pip install pytest anyio pip install -e . + - name: Wait for ADB Free Container + run: | + for attempt in {1..60}; do + if nc -z localhost 1521; then + exit 0 + fi + sleep 10 + done + docker logs ${{ job.services.adb.id }} + exit 1 + - name: Run select_ai tests run: | python_version=${{matrix.python-version}} @@ -44,9 +69,9 @@ jobs: env: PYSAI_TEST_USER: ${{ secrets.PYSAI_TEST_USER }}_${{env.PYTHON_VERSION_WITHOUT_DOT}} PYSAI_TEST_USER_PASSWORD: ${{ secrets.PYSAI_TEST_USER_PASSWORD }} - PYSAI_TEST_ADMIN_USER: ${{ secrets.PYSAI_TEST_ADMIN_USER }} + PYSAI_TEST_ADMIN_USER: ADMIN PYSAI_TEST_ADMIN_PASSWORD: ${{ secrets.PYSAI_TEST_ADMIN_PASSWORD }} - PYSAI_TEST_CONNECT_STRING: ${{ secrets.PYSAI_TEST_CONNECT_STRING }} + PYSAI_TEST_CONNECT_STRING: localhost:1521/myatp PYSAI_TEST_OCI_USER_OCID: ${{ secrets.PYSAI_TEST_OCI_USER_OCID }} PYSAI_TEST_OCI_TENANCY_OCID: ${{ secrets.PYSAI_TEST_OCI_TENANCY_OCID }} PYSAI_TEST_OCI_PRIVATE_KEY: ${{ secrets.PYSAI_TEST_OCI_PRIVATE_KEY }} From 0292a3b00f9395011f59785d09b7ec92f9b13437 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 31 Jul 2026 17:48:16 -0700 Subject: [PATCH 2/9] Fix for compartmentid --- tests/agents/conftest.py | 3 ++- tests/profiles/conftest.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/agents/conftest.py b/tests/agents/conftest.py index 386ab8f..19dc331 100644 --- a/tests/agents/conftest.py +++ b/tests/agents/conftest.py @@ -10,10 +10,11 @@ @pytest.fixture(scope="module") -def provider(): +def provider(oci_compartment_id): return select_ai.OCIGenAIProvider( region="us-chicago-1", oci_apiformat="GENERIC", + oci_compartment_id=oci_compartment_id, model="meta.llama-4-maverick-17b-128e-instruct-fp8", ) diff --git a/tests/profiles/conftest.py b/tests/profiles/conftest.py index 601cc2f..310bd38 100644 --- a/tests/profiles/conftest.py +++ b/tests/profiles/conftest.py @@ -57,9 +57,11 @@ def log_test_case(request, configure_module_logging): @pytest.fixture(scope="module") -def provider(): +def provider(oci_compartment_id): return select_ai.OCIGenAIProvider( - region="us-phoenix-1", oci_apiformat="GENERIC" + region="us-phoenix-1", + oci_apiformat="GENERIC", + oci_compartment_id=oci_compartment_id, ) From 43cec2a10945a53d64b62b2e9f8cf54fc3233ac1 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 31 Jul 2026 18:13:50 -0700 Subject: [PATCH 3/9] Provider compartment id --- tests/profiles/test_1300_profile_async.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/profiles/test_1300_profile_async.py b/tests/profiles/test_1300_profile_async.py index 3f0d8c6..2a34d14 100644 --- a/tests/profiles/test_1300_profile_async.py +++ b/tests/profiles/test_1300_profile_async.py @@ -277,7 +277,7 @@ async def test_1307(): assert profile.attributes.provider.model == "meta.llama-3.1-70b-instruct" -async def test_1308(oci_credential): +async def test_1308(oci_credential, oci_compartment_id): """Set multiple attributes for a Profile""" logger.info( "Setting multiple attributes for async profile %s", @@ -290,6 +290,7 @@ async def test_1308(oci_credential): model="meta.llama-4-maverick-17b-128e-instruct-fp8", region="us-chicago-1", oci_apiformat="GENERIC", + oci_compartment_id=oci_compartment_id, ), object_list=[{"owner": "ADMIN", "name": "gymnasts"}], comments=True, From 45d2ddfa7772f204b75f181c51575456f44d64a3 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Fri, 31 Jul 2026 18:34:57 -0700 Subject: [PATCH 4/9] Enable back tests --- tests/agents/test_3800_agente2e.py | 4 ---- tests/agents/test_3800_async_agente2e.py | 7 +------ tests/profiles/test_1800_chat_session.py | 4 ---- tests/profiles/test_1900_chat_session_async.py | 4 ---- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/tests/agents/test_3800_agente2e.py b/tests/agents/test_3800_agente2e.py index 99fe6bc..b729ef7 100644 --- a/tests/agents/test_3800_agente2e.py +++ b/tests/agents/test_3800_agente2e.py @@ -25,10 +25,6 @@ ToolParams, ) -pytestmark = pytest.mark.skip( - reason="Temporarily skipped due to intermittent failures. This needs to be root caused before enabling" -) - # ---------------------------------------------------------------------- # LOGGING # ---------------------------------------------------------------------- diff --git a/tests/agents/test_3800_async_agente2e.py b/tests/agents/test_3800_async_agente2e.py index c8e70f0..ce12f49 100644 --- a/tests/agents/test_3800_async_agente2e.py +++ b/tests/agents/test_3800_async_agente2e.py @@ -30,12 +30,7 @@ ToolParams, ) -pytestmark = [ - pytest.mark.anyio, - pytest.mark.skip( - reason="Temporarily skipped due to intermittent failures. This needs to be root caused before enabling" - ), -] +pytestmark = pytest.mark.anyio # ---------------------------------------------------------------------- # LOGGING diff --git a/tests/profiles/test_1800_chat_session.py b/tests/profiles/test_1800_chat_session.py index a05901f..4390f23 100644 --- a/tests/profiles/test_1800_chat_session.py +++ b/tests/profiles/test_1800_chat_session.py @@ -23,10 +23,6 @@ logger = logging.getLogger(__name__) -pytestmark = pytest.mark.skip( - reason="Temporarily skipped due to long execution times and intermittent failures. This needs to be root caused before enabling" -) - PROFILE_PREFIX = f"PYSAI_1800_{uuid.uuid4().hex.upper()}" CATEGORY_PROMPTS = { diff --git a/tests/profiles/test_1900_chat_session_async.py b/tests/profiles/test_1900_chat_session_async.py index cea0d17..a5ab0af 100644 --- a/tests/profiles/test_1900_chat_session_async.py +++ b/tests/profiles/test_1900_chat_session_async.py @@ -23,10 +23,6 @@ logger = logging.getLogger(__name__) -pytestmark = pytest.mark.skip( - reason="Temporarily skipped due to long execution times and intermittent failures. This needs to be root caused before enabling" -) - PROFILE_PREFIX = f"PYSAI_1900_{uuid.uuid4().hex.upper()}" CATEGORY_PROMPTS = { From f56a9775fcbc7c7d240b53ac0b7663b5063b7f25 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Sat, 1 Aug 2026 13:01:34 -0700 Subject: [PATCH 5/9] disable long running tests --- tests/agents/test_3800_agente2e.py | 4 ++++ tests/agents/test_3800_async_agente2e.py | 7 ++++++- tests/profiles/test_1800_chat_session.py | 4 ++++ tests/profiles/test_1900_chat_session_async.py | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/tests/agents/test_3800_agente2e.py b/tests/agents/test_3800_agente2e.py index b729ef7..99fe6bc 100644 --- a/tests/agents/test_3800_agente2e.py +++ b/tests/agents/test_3800_agente2e.py @@ -25,6 +25,10 @@ ToolParams, ) +pytestmark = pytest.mark.skip( + reason="Temporarily skipped due to intermittent failures. This needs to be root caused before enabling" +) + # ---------------------------------------------------------------------- # LOGGING # ---------------------------------------------------------------------- diff --git a/tests/agents/test_3800_async_agente2e.py b/tests/agents/test_3800_async_agente2e.py index ce12f49..c8e70f0 100644 --- a/tests/agents/test_3800_async_agente2e.py +++ b/tests/agents/test_3800_async_agente2e.py @@ -30,7 +30,12 @@ ToolParams, ) -pytestmark = pytest.mark.anyio +pytestmark = [ + pytest.mark.anyio, + pytest.mark.skip( + reason="Temporarily skipped due to intermittent failures. This needs to be root caused before enabling" + ), +] # ---------------------------------------------------------------------- # LOGGING diff --git a/tests/profiles/test_1800_chat_session.py b/tests/profiles/test_1800_chat_session.py index 4390f23..a05901f 100644 --- a/tests/profiles/test_1800_chat_session.py +++ b/tests/profiles/test_1800_chat_session.py @@ -23,6 +23,10 @@ logger = logging.getLogger(__name__) +pytestmark = pytest.mark.skip( + reason="Temporarily skipped due to long execution times and intermittent failures. This needs to be root caused before enabling" +) + PROFILE_PREFIX = f"PYSAI_1800_{uuid.uuid4().hex.upper()}" CATEGORY_PROMPTS = { diff --git a/tests/profiles/test_1900_chat_session_async.py b/tests/profiles/test_1900_chat_session_async.py index a5ab0af..cea0d17 100644 --- a/tests/profiles/test_1900_chat_session_async.py +++ b/tests/profiles/test_1900_chat_session_async.py @@ -23,6 +23,10 @@ logger = logging.getLogger(__name__) +pytestmark = pytest.mark.skip( + reason="Temporarily skipped due to long execution times and intermittent failures. This needs to be root caused before enabling" +) + PROFILE_PREFIX = f"PYSAI_1900_{uuid.uuid4().hex.upper()}" CATEGORY_PROMPTS = { From 94b7f2116c8a540ce82a225c5056ba026187d9ec Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Sat, 1 Aug 2026 13:04:33 -0700 Subject: [PATCH 6/9] Run tests on branch push only --- .github/workflows/test.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a26e78f..4b35757 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -1,6 +1,8 @@ name: select_ai_py_tests on: push: + branches: + - "**" workflow_call: permissions: From f5868f45e8f047b9626b0ebe05d91528b56b2a74 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Sat, 1 Aug 2026 16:14:14 -0700 Subject: [PATCH 7/9] Isolation of resources in vector index --- tests/vector_index/conftest.py | 9 ++++- .../test_5100_async_drop_index.py | 38 ++++++++++++------ tests/vector_index/test_5100_drop_index.py | 40 +++++++++++++------ .../test_5200_async_setindex_attributes.py | 4 +- .../test_5200_setindex_attributes.py | 4 +- .../test_5300_async_getindex_attributes.py | 23 ++++++----- .../test_5300_getindex_attributes.py | 33 ++++++++++----- .../test_5500_async_enable_disable_index.py | 8 +++- .../test_5500_enable_disable_index.py | 8 +++- 9 files changed, 115 insertions(+), 52 deletions(-) diff --git a/tests/vector_index/conftest.py b/tests/vector_index/conftest.py index 172292d..983d9e3 100644 --- a/tests/vector_index/conftest.py +++ b/tests/vector_index/conftest.py @@ -104,6 +104,11 @@ def vcidx_params( embedding_location, vcidx_object_store_credentials, ): + # Test modules share a schema. Include the module name in every generated + # resource so credentials, profiles, and indexes never overlap. + module_suffix = ( + Path(request.module.__file__).stem.removeprefix("test_").upper() + ) py_suffix = os.environ.get("PYTHON_VERSION_WITHOUT_DOT") run_suffix = os.environ.get("GITHUB_RUN_ID") run_attempt = os.environ.get("GITHUB_RUN_ATTEMPT") @@ -113,9 +118,9 @@ def vcidx_params( run_suffix = uuid.uuid4().hex[:12].upper() if py_suffix: - resource_suffix = f"PY{py_suffix}_{run_suffix}" + resource_suffix = f"PY{py_suffix}_{run_suffix}_{module_suffix}" else: - resource_suffix = f"PYSAI_{run_suffix}" + resource_suffix = f"PYSAI_{run_suffix}_{module_suffix}" return { "resource_suffix": resource_suffix, diff --git a/tests/vector_index/test_5100_async_drop_index.py b/tests/vector_index/test_5100_async_drop_index.py index 20aee4e..313dad7 100644 --- a/tests/vector_index/test_5100_async_drop_index.py +++ b/tests/vector_index/test_5100_async_drop_index.py @@ -79,6 +79,9 @@ async def vector_index_test_state(request): @pytest.mark.usefixtures("delete_vec_params", "setup_and_teardown") class TestAsyncDeleteVectorIndex: + def resource_name(self, name: str) -> str: + return f"{name}_{self.delete_vec_params['resource_suffix']}" + @classmethod def get_native_cred_param(cls, cred_name=None) -> dict: logger.info("Preparing native credential params for: %s", cred_name) @@ -420,14 +423,16 @@ async def test_5108(self): async def test_5109(self): """Test delete of a nonexistent index (should not error).""" idx = select_ai.AsyncVectorIndex( - index_name="nonexistent_index", + index_name=self.resource_name("nonexistent_index"), attributes=self.vector_index_attributes, profile=self.profile, ) logger.info("Attempting to delete nonexistent index") await idx.delete(force=True) await asyncio.sleep(1) - await self.assert_index_count("^nonexistent_index", 0) + await self.assert_index_count( + f"^{self.resource_name('nonexistent_index')}$", 0 + ) logger.info("Nonexistent delete verified (no error)") async def test_5110(self): @@ -458,7 +463,7 @@ async def test_5110(self): async def test_5111(self): """Test case-sensitive name for create and delete.""" idx = select_ai.AsyncVectorIndex( - index_name="CaseSensitiveIndex", + index_name=self.resource_name("CaseSensitiveIndex"), attributes=self.vector_index_attributes, profile=self.profile, ) @@ -467,12 +472,14 @@ async def test_5111(self): logger.info("Deleting case-sensitive index") await idx.delete(force=True) await asyncio.sleep(1) - await self.assert_index_count("^CaseSensitiveIndex", 0) + await self.assert_index_count( + f"^{self.resource_name('CaseSensitiveIndex')}$", 0 + ) logger.info("Case-sensitive index delete verified") async def test_5112(self): """Test creation and deletion with long index name.""" - long_name = "index_" + "x" * 40 + long_name = self.resource_name("index_" + "x" * 40) idx = select_ai.AsyncVectorIndex( index_name=long_name, attributes=self.vector_index_attributes, @@ -488,7 +495,10 @@ async def test_5112(self): async def test_5113(self): """Test creation and bulk deletion of indexes.""" - names = [f"bulk_idx_{i}" for i in range(3)] + names = [ + f"bulk_idx_{self.delete_vec_params['resource_suffix']}_{i}" + for i in range(3) + ] logger.info("Creating bulk indexes") for name in names: await select_ai.AsyncVectorIndex( @@ -506,7 +516,9 @@ async def test_5113(self): ).delete(force=True) await asyncio.sleep(1) logger.info("Deleted %s", name) - await self.assert_index_count("^bulk_idx_", 0) + await self.assert_index_count( + f"^bulk_idx_{self.delete_vec_params['resource_suffix']}_", 0 + ) logger.info("Bulk delete verified") async def test_5114(self): @@ -545,24 +557,26 @@ async def test_5115(self): async def test_5116(self): """Test delete of one out of multiple indexes.""" idx1 = select_ai.AsyncVectorIndex( - index_name="IDX_1", + index_name=self.resource_name("IDX_1"), attributes=self.vector_index_attributes, profile=self.profile, ) idx2 = select_ai.AsyncVectorIndex( - index_name="IDX_2", + index_name=self.resource_name("IDX_2"), attributes=self.vector_index_attributes, profile=self.profile, ) - logger.info("Creating two indexes IDX_1 and IDX_2") + logger.info("Creating two isolated indexes") await idx1.create(replace=True) await idx2.create(replace=True) logger.info("Deleting IDX_1 only") - await self.delete_and_wait(force=True, pattern="^IDX_1$") + await self.delete_and_wait( + force=True, pattern=f"^{self.resource_name('IDX_1')}$" + ) remaining_idx2 = [ index async for index in self.async_vector_index.list( - index_name_pattern="^IDX_2$" + index_name_pattern=f"^{self.resource_name('IDX_2')}$" ) ] logger.info("IDX_2 entries after IDX_1 delete: %s", remaining_idx2) diff --git a/tests/vector_index/test_5100_drop_index.py b/tests/vector_index/test_5100_drop_index.py index a9248ab..276c10d 100644 --- a/tests/vector_index/test_5100_drop_index.py +++ b/tests/vector_index/test_5100_drop_index.py @@ -68,6 +68,9 @@ def log_test_name(request): @pytest.mark.usefixtures("delete_vec_params", "setup_and_teardown") class TestDeleteVectorIndex: + def resource_name(self, name: str) -> str: + return f"{name}_{self.delete_vec_params['resource_suffix']}" + @classmethod def get_native_cred_param(cls, cred_name=None) -> dict: logger.info(f"Preparing native credential params for: {cred_name}") @@ -443,14 +446,16 @@ def test_5108(self): def test_5109(self): """Test delete of a nonexistent index (should not error).""" idx = select_ai.VectorIndex( - index_name="nonexistent_index", + index_name=self.resource_name("nonexistent_index"), attributes=self.vector_index_attributes, profile=self.profile, ) logger.info("Attempting to delete nonexistent index") idx.delete(force=True) time.sleep(1) - self.assert_index_count("^nonexistent_index", 0) + self.assert_index_count( + f"^{self.resource_name('nonexistent_index')}$", 0 + ) logger.info("Nonexistent delete verified (no error)") def test_5110(self): @@ -477,7 +482,7 @@ def test_5110(self): def test_5111(self): """Test case-sensitive name for create and delete.""" idx = select_ai.VectorIndex( - index_name="CaseSensitiveIndex", + index_name=self.resource_name("CaseSensitiveIndex"), attributes=self.vector_index_attributes, profile=self.profile, ) @@ -486,12 +491,14 @@ def test_5111(self): logger.info("Deleting case-sensitive index") idx.delete(force=True) time.sleep(1) - self.assert_index_count("^CaseSensitiveIndex", 0) + self.assert_index_count( + f"^{self.resource_name('CaseSensitiveIndex')}$", 0 + ) logger.info("Case-sensitive index delete verified") def test_5112(self): """Test creation and deletion with long index name.""" - long_name = "index_" + "x" * 40 + long_name = self.resource_name("index_" + "x" * 40) idx = select_ai.VectorIndex( index_name=long_name, attributes=self.vector_index_attributes, @@ -507,7 +514,10 @@ def test_5112(self): def test_5113(self): """Test creation and bulk deletion of indexes.""" - names = [f"bulk_idx_{i}" for i in range(3)] + names = [ + f"bulk_idx_{self.delete_vec_params['resource_suffix']}_{i}" + for i in range(3) + ] logger.info("Creating bulk indexes") for n in names: select_ai.VectorIndex( @@ -525,7 +535,9 @@ def test_5113(self): ).delete(force=True) time.sleep(1) logger.info(f"Deleted {n}") - self.assert_index_count("^bulk_idx_", 0) + self.assert_index_count( + f"^bulk_idx_{self.delete_vec_params['resource_suffix']}_", 0 + ) logger.info("Bulk delete verified") def test_5114(self): @@ -556,22 +568,26 @@ def test_5115(self): def test_5116(self): """Test delete of one out of multiple indexes.""" idx1 = select_ai.VectorIndex( - index_name="IDX_1", + index_name=self.resource_name("IDX_1"), attributes=self.vector_index_attributes, profile=self.profile, ) idx2 = select_ai.VectorIndex( - index_name="IDX_2", + index_name=self.resource_name("IDX_2"), attributes=self.vector_index_attributes, profile=self.profile, ) - logger.info("Creating two indexes IDX_1 and IDX_2") + logger.info("Creating two isolated indexes") idx1.create(replace=True) idx2.create(replace=True) logger.info("Deleting IDX_1 only") - self.delete_and_wait(force=True, pattern="^IDX_1$") + self.delete_and_wait( + force=True, pattern=f"^{self.resource_name('IDX_1')}$" + ) remaining_idx2 = list( - self.vector_index.list(index_name_pattern="^IDX_2$") + self.vector_index.list( + index_name_pattern=f"^{self.resource_name('IDX_2')}$" + ) ) logger.info(f"IDX_2 entries after IDX_1 delete: {remaining_idx2}") assert len(remaining_idx2) == 1 diff --git a/tests/vector_index/test_5200_async_setindex_attributes.py b/tests/vector_index/test_5200_async_setindex_attributes.py index a4c2d67..abcd093 100644 --- a/tests/vector_index/test_5200_async_setindex_attributes.py +++ b/tests/vector_index/test_5200_async_setindex_attributes.py @@ -942,7 +942,9 @@ async def test_5228(self): async def test_5229(self): """Update on nonexistent vector index.""" logger.info("Testing update on nonexistent vector index...") - temp_index = AsyncVectorIndex(index_name="does_not_exist") + temp_index = AsyncVectorIndex( + index_name=f"does_not_exist_{self.resource_suffix}" + ) with pytest.raises(AttributeError): await temp_index.set_attribute("chunk_size", 512) logger.info( diff --git a/tests/vector_index/test_5200_setindex_attributes.py b/tests/vector_index/test_5200_setindex_attributes.py index 171908f..c9d5028 100644 --- a/tests/vector_index/test_5200_setindex_attributes.py +++ b/tests/vector_index/test_5200_setindex_attributes.py @@ -911,7 +911,9 @@ def test_5228(self): def test_5229(self): """Update on nonexistent vector index.""" logger.info("Testing update on nonexistent vector index...") - temp_index = VectorIndex(index_name="does_not_exist") + temp_index = VectorIndex( + index_name=f"does_not_exist_{self.resource_suffix}" + ) with pytest.raises(AttributeError): temp_index.set_attribute("chunk_size", 512) logger.info( diff --git a/tests/vector_index/test_5300_async_getindex_attributes.py b/tests/vector_index/test_5300_async_getindex_attributes.py index ab97ab5..7745140 100644 --- a/tests/vector_index/test_5300_async_getindex_attributes.py +++ b/tests/vector_index/test_5300_async_getindex_attributes.py @@ -106,6 +106,9 @@ async def vector_index_state(request): @pytest.mark.usefixtures("vector_attr_params", "setup_and_teardown") class TestAsyncGetVectorIndexAttributes: + def resource_name(self, name: str) -> str: + return f"{name}_{self.resource_suffix}" + @classmethod def get_native_cred_param(cls, cred_name=None): logger.info("Preparing native credential params for: %s", cred_name) @@ -263,7 +266,7 @@ async def test_5308(self): logger.info("Testing get_attributes() with a nonexistent index...") with pytest.raises(VectorIndexNotFoundError): await AsyncVectorIndex( - index_name="does_not_exist" + index_name=self.resource_name("does_not_exist") ).get_attributes() logger.info( "Nonexistent index correctly raised VectorIndexNotFoundError." @@ -273,7 +276,7 @@ async def test_5309(self): """Verify error after deleting a temporary vector index.""" logger.info("Testing error after deleting a temporary vector index...") temp_index = AsyncVectorIndex( - index_name="temp_index_for_delete", + index_name=self.resource_name("temp_index_for_delete"), attributes=OracleVectorIndexAttributes( location=self.embedding_location, object_storage_credential_name=self.objstore_cred, @@ -289,7 +292,7 @@ async def test_5309(self): ) with pytest.raises(VectorIndexNotFoundError): await AsyncVectorIndex( - index_name="temp_index_for_delete" + index_name=self.resource_name("temp_index_for_delete") ).get_attributes() logger.info("Expected error raised after deleting index.") @@ -300,7 +303,7 @@ async def test_5310(self): "the vector index..." ) temp_index = AsyncVectorIndex( - index_name="temp_index_for_delete", + index_name=self.resource_name("temp_index_for_delete"), attributes=OracleVectorIndexAttributes( location=self.embedding_location, object_storage_credential_name=self.objstore_cred, @@ -361,7 +364,7 @@ async def test_5315(self): "Creating multiple vector indices to compare their attributes..." ) index_a = AsyncVectorIndex( - index_name="index_a", + index_name=self.resource_name("index_a"), attributes=OracleVectorIndexAttributes( location=self.embedding_location, object_storage_credential_name=self.objstore_cred, @@ -370,7 +373,7 @@ async def test_5315(self): profile=self.profile, ) index_b = AsyncVectorIndex( - index_name="index_b", + index_name=self.resource_name("index_b"), attributes=OracleVectorIndexAttributes( location=self.embedding_location, object_storage_credential_name=self.objstore_cred, @@ -385,10 +388,10 @@ async def test_5315(self): await index_b.create(replace=True) logger.info("Fetching attributes for both indices...") attrs_a = await AsyncVectorIndex( - index_name="index_a" + index_name=self.resource_name("index_a") ).get_attributes() attrs_b = await AsyncVectorIndex( - index_name="index_b" + index_name=self.resource_name("index_b") ).get_attributes() logger.info("Attrs_a: %s", attrs_a) assert attrs_a.pipeline_name != attrs_b.pipeline_name @@ -411,7 +414,7 @@ async def test_5316(self): "Testing attributes consistency after delete and recreate..." ) temp_index = AsyncVectorIndex( - index_name="temp_recreate", + index_name=self.resource_name("temp_recreate"), attributes=OracleVectorIndexAttributes( location=self.embedding_location, object_storage_credential_name=self.objstore_cred, @@ -428,7 +431,7 @@ async def test_5316(self): await temp_index.create(replace=True) logger.info("Fetching attributes after recreation...") attrs = await AsyncVectorIndex( - index_name="temp_recreate" + index_name=self.resource_name("temp_recreate") ).get_attributes() assert attrs.object_storage_credential_name == self.objstore_cred logger.info("Recreate test completed successfully.") diff --git a/tests/vector_index/test_5300_getindex_attributes.py b/tests/vector_index/test_5300_getindex_attributes.py index ffb2702..a966c34 100644 --- a/tests/vector_index/test_5300_getindex_attributes.py +++ b/tests/vector_index/test_5300_getindex_attributes.py @@ -117,6 +117,9 @@ def log_test_name(request): @pytest.mark.usefixtures("vector_attr_params", "setup_and_teardown") class TestGetVectorIndexAttributes: + def resource_name(self, name: str) -> str: + return f"{name}_{self.resource_suffix}" + @classmethod def get_native_cred_param(cls, cred_name=None): logger.info(f"Preparing native credential params for: {cred_name}") @@ -284,7 +287,9 @@ def test_5308(self): """Calling get_attributes on nonexistent index raises error.""" logger.info("Testing get_attributes() with a nonexistent index...") with pytest.raises(VectorIndexNotFoundError): - VectorIndex(index_name="does_not_exist").get_attributes() + VectorIndex( + index_name=self.resource_name("does_not_exist") + ).get_attributes() logger.info( "Nonexistent index correctly raised VectorIndexNotFoundError." ) @@ -298,7 +303,7 @@ def test_5309(self): ) logger.info("Creating temporary vector index...") temp_index = VectorIndex( - index_name="temp_index_for_delete", + index_name=self.resource_name("temp_index_for_delete"), attributes=vector_index_attributes, description="Test vector index", profile=self.profile, @@ -310,7 +315,9 @@ def test_5309(self): "Temporary vector index deleted. Attempting to fetch attributes..." ) with pytest.raises(VectorIndexNotFoundError): - VectorIndex(index_name="temp_index_for_delete").get_attributes() + VectorIndex( + index_name=self.resource_name("temp_index_for_delete") + ).get_attributes() logger.info("Expected error raised after deleting index.") def test_5310(self): @@ -324,7 +331,7 @@ def test_5310(self): ) logger.info("Creating temporary vector index for deletion test...") temp_index = VectorIndex( - index_name="temp_index_for_delete", + index_name=self.resource_name("temp_index_for_delete"), attributes=vector_index_attributes, description="Test vector index", profile=self.profile, @@ -390,7 +397,7 @@ def test_5315(self): ) logger.info("Creating index_a...") index_a = VectorIndex( - index_name="index_a", + index_name=self.resource_name("index_a"), attributes=vector_index_attributes, description="Test vector index", profile=self.profile, @@ -398,16 +405,20 @@ def test_5315(self): index_a.create(replace=True) logger.info("Creating index_b...") index_b = VectorIndex( - index_name="index_b", + index_name=self.resource_name("index_b"), attributes=vector_index_attributes, description="Test vector index", profile=self.profile, ) index_b.create(replace=True) logger.info("Fetching attributes for both indices...") - attrs_a = VectorIndex(index_name="index_a").get_attributes() + attrs_a = VectorIndex( + index_name=self.resource_name("index_a") + ).get_attributes() logger.info(f"Attrs_a: {attrs_a}") - attrs_b = VectorIndex(index_name="index_b").get_attributes() + attrs_b = VectorIndex( + index_name=self.resource_name("index_b") + ).get_attributes() assert attrs_a.pipeline_name != attrs_b.pipeline_name logger.info("Indices have distinct pipeline names as expected.") logger.info("Deleting both indices...") @@ -426,7 +437,7 @@ def test_5316(self): ) logger.info("Creating temporary vector index for recreate test...") temp_index = VectorIndex( - index_name="temp_recreate", + index_name=self.resource_name("temp_recreate"), attributes=vector_index_attributes, description="Test vector index", profile=self.profile, @@ -437,7 +448,9 @@ def test_5316(self): logger.info("Recreating temporary index...") temp_index.create(replace=True) logger.info("Fetching attributes after recreation...") - attrs = VectorIndex(index_name="temp_recreate").get_attributes() + attrs = VectorIndex( + index_name=self.resource_name("temp_recreate") + ).get_attributes() assert attrs.object_storage_credential_name == self.objstore_cred temp_index.delete(force=True) logger.info("Recreate test completed successfully.") diff --git a/tests/vector_index/test_5500_async_enable_disable_index.py b/tests/vector_index/test_5500_async_enable_disable_index.py index 7d74eb2..03b1fa2 100644 --- a/tests/vector_index/test_5500_async_enable_disable_index.py +++ b/tests/vector_index/test_5500_async_enable_disable_index.py @@ -396,7 +396,9 @@ async def test_5505(self): async def test_5506(self): """Disabling a nonexistent index raises error.""" logger.info("Disabling nonexistent index to test error handling") - invalid_index = AsyncVectorIndex(index_name="does_not_exist") + invalid_index = AsyncVectorIndex( + index_name=f"does_not_exist_{self.base_index_name}" + ) with pytest.raises(oracledb.DatabaseError) as exc_info: await invalid_index.disable() logger.info( @@ -407,7 +409,9 @@ async def test_5506(self): async def test_5507(self): """Enabling a nonexistent index raises error.""" logger.info("Enabling nonexistent index to test error handling") - invalid_index = AsyncVectorIndex(index_name="does_not_exist") + invalid_index = AsyncVectorIndex( + index_name=f"does_not_exist_{self.base_index_name}" + ) with pytest.raises(oracledb.DatabaseError) as exc_info: await invalid_index.enable() logger.info( diff --git a/tests/vector_index/test_5500_enable_disable_index.py b/tests/vector_index/test_5500_enable_disable_index.py index 7084ccc..fdc6bd1 100644 --- a/tests/vector_index/test_5500_enable_disable_index.py +++ b/tests/vector_index/test_5500_enable_disable_index.py @@ -374,7 +374,9 @@ def test_5505(self): def test_5506(self): """Disabling a nonexistent index raises error.""" logger.info("Disabling nonexistent index to test error handling") - invalid_index = VectorIndex(index_name="does_not_exist") + invalid_index = VectorIndex( + index_name=f"does_not_exist_{self.base_index_name}" + ) with pytest.raises(oracledb.DatabaseError) as exc_info: invalid_index.disable() logger.info( @@ -385,7 +387,9 @@ def test_5506(self): def test_5507(self): """Enabling a nonexistent index raises error.""" logger.info("Enabling nonexistent index to test error handling") - invalid_index = VectorIndex(index_name="does_not_exist") + invalid_index = VectorIndex( + index_name=f"does_not_exist_{self.base_index_name}" + ) with pytest.raises(oracledb.DatabaseError) as exc_info: invalid_index.enable() logger.info( From c16f51c783995aee08106553b1b5a6b92610eac2 Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Sat, 1 Aug 2026 22:06:46 -0700 Subject: [PATCH 8/9] Fix request fixture --- tests/vector_index/conftest.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/vector_index/conftest.py b/tests/vector_index/conftest.py index 983d9e3..6023474 100644 --- a/tests/vector_index/conftest.py +++ b/tests/vector_index/conftest.py @@ -98,6 +98,7 @@ def vcidx_object_store_credentials(): @pytest.fixture(scope="class") def vcidx_params( + request, test_env, oci_credential, oci_compartment_id, From ec8e85a13c94538e93fdc47780b6f269d248c90b Mon Sep 17 00:00:00 2001 From: Abhishek Singh Date: Sat, 1 Aug 2026 22:31:53 -0700 Subject: [PATCH 9/9] Fetch expected index instead of .* --- tests/vector_index/test_5400_list_index.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/vector_index/test_5400_list_index.py b/tests/vector_index/test_5400_list_index.py index fe122cc..0cd48fa 100644 --- a/tests/vector_index/test_5400_list_index.py +++ b/tests/vector_index/test_5400_list_index.py @@ -121,6 +121,12 @@ def _managed_index_names(indexes): def expected_index_names(self): return [index_name.upper() for index_name in self.indexes] + def fetch_expected_indexes(self): + return [ + select_ai.VectorIndex.fetch(index_name) + for index_name in self.expected_index_names() + ] + @classmethod def get_native_cred_param(cls, cred_name=None) -> dict: logger.info(f"Preparing native credential params for: {cred_name}") @@ -226,7 +232,7 @@ def test_5402(self): """Verify each index has correct profile name.""" logger.info("Verifying each index has correct profile name...") expected_profile = self.profile_name - for index in self.vector_index.list(index_name_pattern=".*"): + for index in self.fetch_expected_indexes(): assert ( index.profile.profile_name == expected_profile ), f"Profile mismatch for {index.index_name}: expected {expected_profile}, got {index.profile.profile_name}" @@ -238,13 +244,7 @@ def test_5403(self): "Verifying each index has correct object store credential name..." ) expected_credential = self.objstore_cred - expected_names = self._managed_index_names(self.indexes) - indexes = [ - index - for index in self.vector_index.list(index_name_pattern=".*") - if index.index_name in expected_names - ] - for index in indexes: + for index in self.fetch_expected_indexes(): assert ( index.attributes.object_storage_credential_name == expected_credential @@ -255,7 +255,7 @@ def test_5404(self): """Verify descriptions for all indexes.""" logger.info("Verifying descriptions for all indexes...") expected_description = "Test vector index" - for index in self.vector_index.list(index_name_pattern=".*"): + for index in self.fetch_expected_indexes(): assert ( index.description == expected_description ), f"Description mismatch for {index.index_name}: expected {expected_description}, got {index.description}"