1919between the two runs, performing statistical regression test across all the list-
2020valued properties collected.
2121"""
22+
2223import argparse
2324import json
2425import os
@@ -180,13 +181,17 @@ def uninteresting_dimensions(processed_emf):
180181 return uninteresting
181182
182183
183- def collect_data (binary_dir : Path , pytest_opts : str ):
184- """Executes the specified test using the provided firecracker binaries"""
184+ def collect_data (tag : str , binary_dir : Path , pytest_opts : str ):
185+ """
186+ Executes the specified test using the provided firecracker binaries and
187+ stores results into the `test_results/tag` directory
188+ """
185189 binary_dir = binary_dir .resolve ()
186190
187191 print (f"Collecting samples with { binary_dir } " )
192+ test_report_path = f"test_results/{ tag } /test-report.json"
188193 subprocess .run (
189- f"./tools/test.sh --binary-dir={ binary_dir } { pytest_opts } -m ''" ,
194+ f"./tools/test.sh --binary-dir={ binary_dir } { pytest_opts } -m '' --json-report-file=../ { test_report_path } " ,
190195 env = os .environ
191196 | {
192197 "AWS_EMF_ENVIRONMENT" : "local" ,
@@ -195,9 +200,8 @@ def collect_data(binary_dir: Path, pytest_opts: str):
195200 check = True ,
196201 shell = True ,
197202 )
198- return load_data_series (
199- Path ("test_results/test-report.json" ), binary_dir , reemit = True
200- )
203+
204+ return load_data_series (Path (test_report_path ), binary_dir , reemit = True )
201205
202206
203207def analyze_data (
@@ -327,7 +331,7 @@ def analyze_data(
327331 f"for metric \033 [1m{ metric } \033 [0m with \033 [0;31m\033 [1mp={ result .pvalue } \033 [0m. "
328332 f"This means that observing a change of this magnitude or worse, assuming that performance "
329333 f"characteristics did not change across the tested commits, has a probability of { result .pvalue :.2%} . "
330- f"Tested Dimensions:\n { json .dumps ({k : v for k ,v in dimension_set if k not in do_not_print_list }, indent = 2 , sort_keys = True )} "
334+ f"Tested Dimensions:\n { json .dumps ({k : v for k , v in dimension_set if k not in do_not_print_list }, indent = 2 , sort_keys = True )} "
331335 )
332336 messages .append (msg )
333337
@@ -346,7 +350,7 @@ def ab_performance_test(
346350 """Does an A/B-test of the specified test with the given firecracker/jailer binaries"""
347351
348352 return binary_ab_test (
349- lambda bin_dir , _ : collect_data (bin_dir , pytest_opts ),
353+ lambda tag , bin_dir , _ : collect_data (tag , bin_dir , pytest_opts ),
350354 lambda ah , be : analyze_data (
351355 ah ,
352356 be ,
0 commit comments