Skip to content

Commit 68a3bde

Browse files
committed
Fix writing of profiler data on CI
1 parent d826fe5 commit 68a3bde

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.github/workflows/integration_tests.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ jobs:
6464
steps=("ecm_prep" "run")
6565
for step in "${steps[@]}"; do
6666
psrecord --log memory_log_${step}.txt --include-children --interval 1 "python tests/integration_testing/run_workflow.py --run_step $step --yaml tests/integration_testing/integration_test.yml --with_profiler"
67-
(echo -e; echo "# Elapsed time,CPU (%),Peak Real (MB),Peak Virtual (MB)"; grep -v "time" memory_log_${step}.txt | sort -k3 -n -r | head -n 1 | column -t | tr -s '[:blank:]' ',') >> tests/integration_testing/results/profile_${step}.csv
68-
mv memory_log_${step}.txt ./tests/integration_testing/results/
67+
(echo -e; echo "# Elapsed time,CPU (%),Peak Real (MB),Peak Virtual (MB)"; grep -v "time" memory_log_${step}.txt | sort -k3 -n -r | head -n 1 | column -t | tr -s '[:blank:]' ',') >> results/profile_${step}.csv
68+
mv memory_log_${step}.txt ./results/
6969
done
7070
else
7171
python tests/integration_testing/run_workflow.py --yaml tests/integration_testing/integration_test.yml
7272
fi
73-
mv -f ./results/* ./tests/integration_testing/results/
73+
rm -rf ./tests/integration_testing/results/*
74+
mv ./results/* ./tests/integration_testing/results/
7475
- name: Compare integration test results
7576
run: |
7677
git fetch origin master

tests/integration_testing/run_workflow.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22
from pathlib import Path
33
from argparse import ArgumentParser
4+
from scout.config import FilePaths as fp
45
import io
56
import sys
67
import logging
@@ -28,21 +29,19 @@ def run_workflow(config: str = "", run_step: str = None, with_profiler: bool = F
2829
compute time and peak memory. Defaults to False.
2930
"""
3031

31-
results_dir = Path(__file__).parent / "results"
32-
3332
# Run ecm_prep.py
3433
if run_step == "ecm_prep" or run_step is None:
3534
opts = ecm_args(["-y", config])
3635
if with_profiler:
37-
run_with_profiler(ecm_prep.main, opts, results_dir / "profile_ecm_prep.csv")
36+
run_with_profiler(ecm_prep.main, opts, fp.RESULTS / "profile_ecm_prep.csv")
3837
else:
3938
ecm_prep.main(opts)
4039

4140
# Run run.py
4241
if run_step == "run" or run_step is None:
4342
opts = run.parse_args(["-y", config])
4443
if with_profiler:
45-
run_with_profiler(run.main, opts, results_dir / "profile_run.csv")
44+
run_with_profiler(run.main, opts, fp.RESULTS / "profile_run.csv")
4645
else:
4746
run.main(opts)
4847

0 commit comments

Comments
 (0)