-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OPIK-360 Andrei/projects crud tests #565
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! nice to see more coverage :)
def delete_project_by_name_sdk(name: str): | ||
client = OpikApi() | ||
project = find_project_by_name_sdk(name=name) | ||
client.projects.delete_project_by_id(project[0]['id']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why project
is an array here, maybe find_project_by_name_sdk
should just return the first element and that's it?
def wait_for_project_to_be_visible(project_name, timeout=10, initial_delay=1): | ||
start_time = time.time() | ||
delay = initial_delay | ||
|
||
while time.time() - start_time < timeout: | ||
if find_project_by_name_sdk(project_name): | ||
return True | ||
|
||
time.sleep(delay) | ||
delay = min(delay*2, timeout-(time.time() - start_time)) | ||
|
||
raise TimeoutError(f'could not get created project {project_name} via API within {timeout} seconds') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure at some point we'll need an abstraction of this mechanism sending some function to wait until it's accomplished or throwing timeout as you did here (similar in TypeScript: https://playwright.dev/docs/test-assertions#expectpoll)
{"input": "Paris", "expected_output": "Hello, Paris!"} | ||
{"input": "London", "expected_output": "Hello, London!"} | ||
{"input": "New York", "expected_output": "Hello, New York!"} | ||
{"input": "Tokyo", "expected_output": "Hello, Tokyo!"} | ||
{"input": "Berlin", "expected_output": "Hello, Berlin!"} | ||
{"input": "Sydney", "expected_output": "Hello, Sydney!"} | ||
{"input": "Cairo", "expected_output": "Hello, Cairo!"} | ||
{"input": "Toronto", "expected_output": "Hello, Toronto!"} | ||
{"input": "Stockholm", "expected_output": "Hello, Stockholm!"} | ||
{"input": "Sao Paulo", "expected_output": "Hello, Sao Paulo!"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's okay for now but maybe worth to make the mock data more diverse to cover more cases in one shot? (different structures, different fields, and so on)
Details
Created automated suite for testing all projects CRUD operations according to OPIK-360. Tests and their descriptions can be found inside test_projects_crud_operations.py
Reorganized file structure in tests_end_to_end for better separation between sanity tests and specific feature test suites. WILL ADD A WORKFLOW FILE TO TEST RUN THIS ON ACTIONS TOMORROW