|
26 | 26 | from typing import Callable, Optional, TypeVar |
27 | 27 |
|
28 | 28 | from framework import utils |
29 | | -from framework.defs import FC_WORKSPACE_DIR |
30 | 29 | from framework.properties import global_props |
31 | 30 | from framework.utils import CommandReturn |
32 | 31 | from framework.with_filelock import with_filelock |
33 | | -from host_tools.cargo_build import DEFAULT_TARGET_DIR |
34 | 32 |
|
35 | 33 | # Locally, this will always compare against main, even if we try to merge into, say, a feature branch. |
36 | 34 | # We might want to do a more sophisticated way to determine a "parent" branch here. |
@@ -95,27 +93,6 @@ def git_ab_test( |
95 | 93 | return result_a, result_b, comparison |
96 | 94 |
|
97 | 95 |
|
98 | | -DEFAULT_A_DIRECTORY = FC_WORKSPACE_DIR / "build" / "main" |
99 | | -DEFAULT_B_DIRECTORY = FC_WORKSPACE_DIR / "build" / "cargo_target" / DEFAULT_TARGET_DIR |
100 | | - |
101 | | - |
102 | | -def binary_ab_test( |
103 | | - test_runner: Callable[[Path, bool], T], |
104 | | - comparator: Callable[[T, T], U] = default_comparator, |
105 | | - *, |
106 | | - a_directory: Path = DEFAULT_A_DIRECTORY, |
107 | | - b_directory: Path = DEFAULT_B_DIRECTORY, |
108 | | -): |
109 | | - """ |
110 | | - Similar to `git_ab_test`, but instead of locally checking out different revisions, it operates on |
111 | | - directories containing firecracker/jailer binaries |
112 | | - """ |
113 | | - result_a = test_runner(a_directory, True) |
114 | | - result_b = test_runner(b_directory, False) |
115 | | - |
116 | | - return result_a, result_b, comparator(result_a, result_b) |
117 | | - |
118 | | - |
119 | 96 | def git_ab_test_host_command_if_pr( |
120 | 97 | command: str, |
121 | 98 | *, |
|
0 commit comments