Skip to content

Conversation

@Vishwas-testing
Copy link
Member

Description

Feedback tests for select ai python package . It includes positive, negative, delete feedback API tests

How Has This Been Tested?

It is a test only transaction

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Dec 12, 2025
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

PROFILE_NAME = "PYSAI_TEST_FEEDBACK_PROFILE"
Copy link
Member

@aosingh aosingh Dec 12, 2025

Choose a reason for hiding this comment

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

Use uuid just be safe because Github Actions runs tests concurrently and that can create concurrency issues accessing the profile. We run the testcases for multiple different Python versions in parallel.

Make sure the profile name is unique. We can use test suite id e.g. 1500 and a unique identifier.

import uuid

PROFILE_NAME = f"PYSAI_1500_{uuid.uuid4().hex.upper()}"

),
),
)
with select_ai.cursor() as cr:
Copy link
Member

Choose a reason for hiding this comment

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

Use existing fixture for cursor. It is module level fixture.
https://github.com/oracle/python-select-ai/blob/main/tests/conftest.py#L128-L131

def profile(oci_credential, oci_compartment_id, test_env, cursor)
    cursor.execute(...)

response = "SELECT p1.name, g1.total_points FROM people p1 JOIN gymnast g1 ON p1.id = g1.id ORDER BY g1.total_points DESC" # Valid SQL on your tables
feedback_content = "print in descending order of total_points"
success = False
try:
Copy link
Member

Choose a reason for hiding this comment

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

Please remove try..except..else block.
In case of an unknown exception, pytest will fail the testcase. And we need the full traceback for any unknown exception.

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

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants