Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,6 @@ jobs:
PYSAI_TEST_EMAIL_SENDER: ${{secrets.PYSAI_TEST_EMAIL_SENDER}}
PYSAI_TEST_EMAIL_SMTPHOST: ${{secrets.PYSAI_TEST_EMAIL_SMTPHOST}}
PYSAI_TEST_OPENAI_API_KEY: ${{secrets.PYSAI_TEST_OPENAI_API_KEY}}
PYTEST_TEST_OBJSTORE_EMBEDDING_LOC: ${{ secrets.PYTEST_TEST_OBJSTORE_EMBEDDING_LOC }}
PYTEST_TEST_OBJSTORE_USERNAME: ${{ secrets.PYTEST_TEST_OBJSTORE_USERNAME }}
PYTEST_TEST_OBJSTORE_PASSWORD: ${{ secrets.PYTEST_TEST_OBJSTORE_PASSWORD }}
51 changes: 51 additions & 0 deletions tests/credential/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -----------------------------------------------------------------------------
# Copyright (c) 2026, Oracle and/or its affiliates.
#
# Licensed under the Universal Permissive License v 1.0 as shown at
# http://oss.oracle.com/licenses/upl.
# -----------------------------------------------------------------------------

import os

import pytest


def get_credential_env_value(name, default_value=None):
return os.environ.get(f"PYSAI_TEST_{name}", default_value)


@pytest.fixture(scope="session")
def oci_credential():
"""
Override the root autouse OCI credential fixture for credential-only tests.
These suites should not require OCI environment variables unless a test
explicitly opts into them.
"""
return None


@pytest.fixture(scope="session")
def credential_test_params(test_env):
return {
"user": test_env.test_user,
"password": test_env.test_user_password,
"dsn": test_env.connect_string,
"user_ocid": get_credential_env_value(
"OCI_USER_OCID", default_value="user ocid"
),
"tenancy_ocid": get_credential_env_value(
"OCI_TENANCY_OCID", default_value="tenancy ocid"
),
"private_key": get_credential_env_value(
"OCI_PRIVATE_KEY", default_value="private key"
),
"fingerprint": get_credential_env_value(
"OCI_FINGERPRINT", default_value="fingerprint"
),
"cred_username": get_credential_env_value(
"CRED_USERNAME", default_value="OCI credential username"
),
"cred_password": get_credential_env_value(
"CRED_PASSWORD", default_value="OCI credential password"
),
}
Loading
Loading