Skip to content

Selet AI Tests for Vector Index.#32

Open
Pushpendra-Garg wants to merge 10 commits into
mainfrom
vecindex_sync
Open

Selet AI Tests for Vector Index.#32
Pushpendra-Garg wants to merge 10 commits into
mainfrom
vecindex_sync

Conversation

@Pushpendra-Garg

@Pushpendra-Garg Pushpendra-Garg commented May 5, 2026

Copy link
Copy Markdown
Member

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@oracle-contributor-agreement

Copy link
Copy Markdown

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label May 5, 2026
@Pushpendra-Garg Pushpendra-Garg self-assigned this May 5, 2026
@Pushpendra-Garg Pushpendra-Garg force-pushed the vecindex_sync branch 3 times, most recently from 730fdcd to 4936204 Compare May 5, 2026 08:19
Comment thread tests/credential/conftest.py Outdated
@pytest.fixture(scope="session")
def credential_connect_as(test_env):
def _connect_as(admin=False, **overrides):
select_ai.disconnect()

@aosingh aosingh May 5, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please don't run select_ai.disconnect() in individual conftest.

We have seen this causes issues as it modifies the global connection state. We already have connect/disconnect in the root level conftest.py which is automatically run for every module.

https://github.com/oracle/python-select-ai/blob/main/tests/conftest.py#L201

We should not do any connection management in individual test suites.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed additional connect/disconnect from subfolders.

Comment thread tests/credential/conftest.py Outdated
@pytest.fixture(scope="session")
def credential_async_connect_as(test_env):
async def _connect_as(admin=False, **overrides):
await select_ai.async_disconnect()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We already have async connect and disconnect here
https://github.com/oracle/python-select-ai/blob/main/tests/conftest.py#L208

No need to connect here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed additional connect/disconnect from subfolders.

@aosingh

aosingh commented Jun 6, 2026

Copy link
Copy Markdown
Member

@Pushpendra-Garg please rebase changes from main. Thanks

@Pushpendra-Garg

Copy link
Copy Markdown
Member Author

@Pushpendra-Garg please rebase changes from main. Thanks

Done.

pip install pytest anyio
pip install -e .

- name: Debug vector index secret wiring

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we please remove this debug step ?

@@ -0,0 +1,51 @@
# -----------------------------------------------------------------------------
# Copyright (c) 2025, Oracle and/or its affiliates.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For new files, Copyright header should use the current year - 2026

@@ -0,0 +1,415 @@
# -----------------------------------------------------------------------------
# Copyright (c) 2025, Oracle and/or its affiliates.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

2026

@@ -0,0 +1,356 @@
# -----------------------------------------------------------------------------
# Copyright (c) 2025, Oracle and/or its affiliates.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please update the year in all files

logger.info(f"SetUp for {method.__name__}")
self.objstore_cred = "OBJSTORE_CRED"
self.vecidx = select_ai.VectorIndex()
self.vector_index = list(self.vecidx.list(index_name_pattern=".*"))[0]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will operate on whichever vector index happens to be returned first, not the index created in setup. In a shared schema or after earlier tests, this can validate/disable the wrong object. Fetch by exact name, for example index_name_pattern=f"^{self.index_name}$", and assert exactly one match.


def test_2217(self):
"""Test Credential creation for a local test user"""
test_username = "TEST_USER1"

@aosingh aosingh Jun 10, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We run tests for different Python versions in parallel. Creating TEST_USER1 is unsafe for parallel runs. Use UUID/suffix-based names derived from the test session, and always drop them in finally.


try:
for i in range(1, 6):
user = f"DB_USER{i}"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't use user names like DB_USER1, DB_USER2. In a shared CI infrastructure this can break parallel runs. Use UUID/suffix-based names derived from the test session, and always drop them in finally

"""Test None as pattern input."""
logger.info("Testing None as pattern input...")
indexes = self.vector_index.list(None)
assert len(list(indexes)) != len(self.indexes)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What are we testing here ?

"""Test empty string as pattern input."""
logger.info("Testing empty string as pattern input...")
indexes = self.vector_index.list("")
assert len(list(indexes)) != len(self.indexes)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same, what is tested here ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants