Skip to content

Commit 970d555

Browse files
Add provider credential and vector index tests
1 parent 64977c6 commit 970d555

26 files changed

Lines changed: 9828 additions & 0 deletions

‎.github/workflows/test.yaml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ jobs:
6060
PYSAI_TEST_EMAIL_SENDER: ${{secrets.PYSAI_TEST_EMAIL_SENDER}}
6161
PYSAI_TEST_EMAIL_SMTPHOST: ${{secrets.PYSAI_TEST_EMAIL_SMTPHOST}}
6262
PYSAI_TEST_OPENAI_API_KEY: ${{secrets.PYSAI_TEST_OPENAI_API_KEY}}
63+
PYTEST_TEST_OBJSTORE_EMBEDDING_LOC: ${{ secrets.PYTEST_TEST_OBJSTORE_EMBEDDING_LOC }}
64+
PYTEST_TEST_OBJSTORE_USERNAME: ${{ secrets.PYTEST_TEST_OBJSTORE_USERNAME }}
65+
PYTEST_TEST_OBJSTORE_PASSWORD: ${{ secrets.PYTEST_TEST_OBJSTORE_PASSWORD }}

‎tests/credential/conftest.py‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# -----------------------------------------------------------------------------
2+
# Copyright (c) 2026, Oracle and/or its affiliates.
3+
#
4+
# Licensed under the Universal Permissive License v 1.0 as shown at
5+
# http://oss.oracle.com/licenses/upl.
6+
# -----------------------------------------------------------------------------
7+
8+
import os
9+
10+
import pytest
11+
12+
13+
def get_credential_env_value(name, default_value=None):
14+
return os.environ.get(f"PYSAI_TEST_{name}", default_value)
15+
16+
17+
@pytest.fixture(scope="session")
18+
def oci_credential():
19+
"""
20+
Override the root autouse OCI credential fixture for credential-only tests.
21+
These suites should not require OCI environment variables unless a test
22+
explicitly opts into them.
23+
"""
24+
return None
25+
26+
27+
@pytest.fixture(scope="session")
28+
def credential_test_params(test_env):
29+
return {
30+
"user": test_env.test_user,
31+
"password": test_env.test_user_password,
32+
"dsn": test_env.connect_string,
33+
"user_ocid": get_credential_env_value(
34+
"OCI_USER_OCID", default_value="user ocid"
35+
),
36+
"tenancy_ocid": get_credential_env_value(
37+
"OCI_TENANCY_OCID", default_value="tenancy ocid"
38+
),
39+
"private_key": get_credential_env_value(
40+
"OCI_PRIVATE_KEY", default_value="private key"
41+
),
42+
"fingerprint": get_credential_env_value(
43+
"OCI_FINGERPRINT", default_value="fingerprint"
44+
),
45+
"cred_username": get_credential_env_value(
46+
"CRED_USERNAME", default_value="OCI credential username"
47+
),
48+
"cred_password": get_credential_env_value(
49+
"CRED_PASSWORD", default_value="OCI credential password"
50+
),
51+
}

0 commit comments

Comments
 (0)