Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Căutișanu authored and Andrei Căutișanu committed Dec 18, 2024
1 parent 22b49d9 commit df59510
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests_end_to_end/tests/Prompts/test_prompts_crud_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class TestPromptsCrud:
def test_prompt_visibility(
self, request, page: Page, client: opik.Opik, prompt_fixture
):
"""
Tests creation of a prompt via UI and SDK and visibility in both
1. Create a prompt via either UI or SDK (each gets its own respective test instance)
2. Check the prompt is visible in both UI and SDK
"""
prompt: opik.Prompt = request.getfixturevalue(prompt_fixture)

retries = 0
Expand All @@ -35,6 +40,13 @@ def test_prompt_visibility(
def test_prompt_deletion(
self, request, page: Page, client: opik.Opik, prompt_fixture
):
"""
Tests deletion of prompt via the UI (currently no user-facing way to do it via the SDK)
1. Create a prompt via either UI or SDK (each gets its own respective test instance)
2. Delete that newly created prompt via the UI
3. Check that the prompt is no longer present in the UI
4. Check that the prompt is not returned by the SDK (client.get_prompt should return None)
"""
prompt: opik.Prompt = request.getfixturevalue(prompt_fixture)

prompt_library_page = PromptLibraryPage(page)
Expand All @@ -55,6 +67,15 @@ def test_prompt_deletion(
def test_prompt_update(
self, request, page: Page, client: opik.Opik, prompt_fixture, update_method
):
"""
Tests updating a prompt and creating a new prompt version via both UI and SDK
1. Create a prompt via either UI or SDK (each gets its own respective test instance)
2. Update that prompt with new text via either UI or SDK (each gets its own respective test instance)
3. In the UI, grab the prompt texts from the Commits tab and check that both old and new prompt versions are present
4. In the Commits tab, click the most recent commit and check that it is the updated prompt version
5. Get the Prompt via the SDK via the Prompt object without specifying a commit, check it returns the newest updated version
6. Grab the Prompt via the SDK while specifying the old commit, check that the old version is returned
"""
prompt: opik.Prompt = request.getfixturevalue(prompt_fixture)
UPDATE_TEXT = "This is an updated prompt version"

Expand Down

0 comments on commit df59510

Please sign in to comment.