From 35e204799fc09d32d07fe4f924b43f008aa6cbee Mon Sep 17 00:00:00 2001 From: Krzysztof Godlewski Date: Mon, 9 Dec 2024 15:37:56 +0100 Subject: [PATCH] Add another test for auto-step with mixed metrics --- tests/e2e/test_log_and_fetch.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/e2e/test_log_and_fetch.py b/tests/e2e/test_log_and_fetch.py index 6e52d04..456be55 100644 --- a/tests/e2e/test_log_and_fetch.py +++ b/tests/e2e/test_log_and_fetch.py @@ -203,3 +203,27 @@ def test_auto_step_with_manual_increase(run, ro_run): df = ro_run[path].fetch_values() assert df["step"].tolist() == [0, 10, 11] assert df["value"].tolist() == [1, 2, 3] + + +def test_auto_step_with_different_metrics(run, ro_run): + path1 = unique_path("test_series/auto_step_different_metrics1") + path2 = unique_path("test_series/auto_step_different_metrics2") + + run.log_metrics(data={path1: 1}) + run.log_metrics(data={path2: 1}, step=10) + + run.log_metrics(data={path1: 2}) + run.log_metrics(data={path2: 2}, step=20) + + run.log_metrics(data={path1: 3}, step=5) + run.log_metrics(data={path2: 3}) + + run.wait_for_processing() + + df1 = ro_run[path1].fetch_values() + assert df1["step"].tolist() == [0.0, 1.0, 5.0] + assert df1["value"].tolist() == [1, 2, 3] + + df2 = ro_run[path2].fetch_values() + assert df2["step"].tolist() == [10.0, 20.0, 21.0] + assert df2["value"].tolist() == [1, 2, 3]