19
19
between the two runs, performing statistical regression test across all the list-
20
20
valued properties collected.
21
21
"""
22
+
22
23
import argparse
23
24
import json
24
25
import os
@@ -180,13 +181,17 @@ def uninteresting_dimensions(processed_emf):
180
181
return uninteresting
181
182
182
183
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
+ """
185
189
binary_dir = binary_dir .resolve ()
186
190
187
191
print (f"Collecting samples with { binary_dir } " )
192
+ test_report_path = f"test_results/{ tag } /test-report.json"
188
193
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 } " ,
190
195
env = os .environ
191
196
| {
192
197
"AWS_EMF_ENVIRONMENT" : "local" ,
@@ -195,9 +200,8 @@ def collect_data(binary_dir: Path, pytest_opts: str):
195
200
check = True ,
196
201
shell = True ,
197
202
)
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 )
201
205
202
206
203
207
def analyze_data (
@@ -327,7 +331,7 @@ def analyze_data(
327
331
f"for metric \033 [1m{ metric } \033 [0m with \033 [0;31m\033 [1mp={ result .pvalue } \033 [0m. "
328
332
f"This means that observing a change of this magnitude or worse, assuming that performance "
329
333
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 )} "
331
335
)
332
336
messages .append (msg )
333
337
@@ -346,7 +350,7 @@ def ab_performance_test(
346
350
"""Does an A/B-test of the specified test with the given firecracker/jailer binaries"""
347
351
348
352
return binary_ab_test (
349
- lambda bin_dir , _ : collect_data (bin_dir , pytest_opts ),
353
+ lambda bin_dir , is_a : collect_data (is_a and "A" or "B" , bin_dir , pytest_opts ),
350
354
lambda ah , be : analyze_data (
351
355
ah ,
352
356
be ,
0 commit comments