Skip to content

Commit

Permalink
Functional tests fixed after experiments introduction (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raalsky authored May 15, 2024
1 parent d891c51 commit f8d6625
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/features/fetching_table.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Feature: Fetching runs dataframe
Given we have a read-only project
And we filter by run names regex
When we fetch runs dataframe
Then we should get second run
Then we should get first run

Scenario: Custom id regex
Given we have a read-only project
Expand Down
11 changes: 9 additions & 2 deletions tests/features/steps/fetching_runs_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def step_impl(context):

@given("we filter by run names regex")
def step_impl(context):
context.kwargs = {"names_regex": f"{context.project_key}-[2-9]+"}
context.kwargs = {"names_regex": "my-.*-experiment"}


@given("we filter by custom id regex")
Expand All @@ -57,10 +57,17 @@ def step_impl(context):
assert len(context.dataframe) == 1


@then("we should get first run")
def step_impl(context):
print(context.dataframe.to_dict())
assert len(context.dataframe) == 1
assert context.dataframe["sys/id"].values[0] == f"{context.project_key}-1"


@then("we should get second run")
def step_impl(context):
assert len(context.dataframe) == 1
assert context.dataframe["sys/name"].values[0] == f"{context.project_key}-2"
assert context.dataframe["sys/id"].values[0] == f"{context.project_key}-2"


@then("we should have selected columns included")
Expand Down
4 changes: 2 additions & 2 deletions tests/features/steps/project_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def step_impl(context):
assert sorted(context.runs, key=lambda kv: kv["sys/id"]) == [
{
"sys/id": f"{context.project_key}-1",
"sys/name": f"{context.project_key}-1",
"sys/name": "my-lovely-experiment",
"sys/custom_run_id": "fetcher-aa-1",
},
{
"sys/id": f"{context.project_key}-2",
"sys/name": f"{context.project_key}-2",
"sys/name": "",
"sys/custom_run_id": "fetcher-bb-2",
},
]
2 changes: 1 addition & 1 deletion tests/prepare_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
kafka_topic="ingest.feed",
)

run1_id = client.create_run(run_id="fetcher-aa-1")
run1_id = client.create_run(run_id="fetcher-aa-1", experiment_id="my-lovely-experiment")
for i in range(3):
client.log(
run_id=run1_id,
Expand Down

0 comments on commit f8d6625

Please sign in to comment.