Skip to content

Commit e99f0ad

Browse files
committed
Revert "final touch up"
This reverts commit 98bbd1a.
1 parent 2a9efb4 commit e99f0ad

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

tests/system/small/test_run_and_publish_benchmark.py

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,28 @@
1515
from pathlib import Path
1616
import sys
1717

18-
# Add the project root to the Python path to allow for application-specific imports.
19-
sys.path.insert(0, str(Path(__file__).resolve().parents[3]))
20-
21-
from scripts import run_and_publish_benchmark # noqa: E402
18+
from scripts import run_and_publish_benchmark
2219

20+
sys.path.insert(0, str(Path(__file__).resolve().parents[3]))
2321

24-
def test_collect_benchmark_result(tmp_path: Path):
25-
"""Tests the collect_benchmark_result function.
26-
27-
This test verifies that the function correctly reads benchmark result
28-
files from a specified directory, processes them, and returns a
29-
pandas DataFrame with the expected data and types.
3022

31-
Args:
32-
tmp_path (Path): The pytest fixture providing a temporary directory path.
33-
"""
34-
# Arrange: Create dummy log files with benchmark data.
23+
def test_collect_benchmark_result(tmp_path):
24+
# Create dummy log files
3525
(tmp_path / "benchmark1.bytesprocessed").write_text("100")
3626
(tmp_path / "benchmark1.slotmillis").write_text("1000")
3727
(tmp_path / "benchmark1.bq_exec_time_seconds").write_text("1.0")
3828
(tmp_path / "benchmark1.local_exec_time_seconds").write_text("2.0")
3929
(tmp_path / "benchmark1.query_char_count").write_text("50")
4030
(tmp_path / "benchmark1.totalrows").write_text("10")
4131

42-
# Act: Collect the benchmark results from the temporary directory.
43-
# The second argument '1' is a placeholder for the number of runs.
32+
# Collect the benchmark results
4433
df, error_message = run_and_publish_benchmark.collect_benchmark_result(
4534
str(tmp_path), 1
4635
)
4736

48-
# Assert: Verify the contents and structure of the resulting DataFrame.
49-
assert error_message is None, "Expected no error messages."
50-
assert len(df) == 1, "DataFrame should contain exactly one row."
37+
# Assert that the DataFrame is correct
38+
assert error_message is None
39+
assert len(df) == 1
5140
assert df["Benchmark_Name"][0] == "benchmark1"
5241
assert df["Bytes_Processed"][0] == 100
5342
assert df["Slot_Millis"][0] == 1000

0 commit comments

Comments
 (0)