Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

chore(tests): e2e tests should use a fixture for OpenAI client #656

Closed
alekst23 opened this issue Jun 18, 2024 · 0 comments · Fixed by #953
Closed

chore(tests): e2e tests should use a fixture for OpenAI client #656

alekst23 opened this issue Jun 18, 2024 · 0 comments · Fixed by #953
Assignees
Labels
tech-debt Not a feature, but still necessary
Milestone

Comments

@alekst23
Copy link
Contributor

Describe what should be investigated or refactored

Currently e2e will cause pytest test discovery to fail. This is because some of the modules cause an API request during the dependency discovery.

Links to any relevant code

client = OpenAI(
    base_url="https://leapfrogai-api.uds.dev/openai/v1", api_key=create_test_user()
)

The create_test_user() function ends up being called during test discovery, not test runs, as it loads dependencies and variables.
This function performs a web request which can fail for a number of reasons, and causes test discovery to fail as well.

Additional context

We can use fixtures to load the client at test run time

@alekst23 alekst23 added the tech-debt Not a feature, but still necessary label Jun 18, 2024
@alekst23 alekst23 self-assigned this Jun 18, 2024
@alekst23 alekst23 linked a pull request Jun 18, 2024 that will close this issue
@alekst23 alekst23 added this to the EVERGREEN milestone Jul 11, 2024
@alekst23 alekst23 linked a pull request Aug 27, 2024 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tech-debt Not a feature, but still necessary
Projects
None yet
1 participant