|
31 | 31 |
|
32 | 32 | from framework import utils |
33 | 33 | from framework.defs import FC_WORKSPACE_DIR |
34 | | -from framework.microvm import Microvm |
35 | 34 | from framework.utils import CommandReturn |
36 | 35 | from framework.with_filelock import with_filelock |
37 | | -from host_tools.cargo_build import DEFAULT_TARGET_DIR, get_firecracker_binaries |
| 36 | +from host_tools.cargo_build import DEFAULT_TARGET_DIR |
38 | 37 |
|
39 | 38 | # Locally, this will always compare against main, even if we try to merge into, say, a feature branch. |
40 | 39 | # We might want to do a more sophisticated way to determine a "parent" branch here. |
@@ -176,56 +175,6 @@ def set_did_not_grow_comparator( |
176 | 175 | ) |
177 | 176 |
|
178 | 177 |
|
179 | | -def precompiled_ab_test_guest_command( |
180 | | - microvm_factory: Callable[[Path, Path], Microvm], |
181 | | - command: str, |
182 | | - *, |
183 | | - comparator: Callable[[CommandReturn, CommandReturn], bool] = default_comparator, |
184 | | - a_revision: str = DEFAULT_A_REVISION, |
185 | | - b_revision: Optional[str] = None, |
186 | | -): |
187 | | - """The same as git_ab_test_command, but via SSH. The closure argument should setup a microvm using the passed |
188 | | - paths to firecracker and jailer binaries.""" |
189 | | - b_directory = ( |
190 | | - DEFAULT_B_DIRECTORY |
191 | | - if b_revision is None |
192 | | - else FC_WORKSPACE_DIR / "build" / b_revision |
193 | | - ) |
194 | | - |
195 | | - def test_runner(bin_dir, _is_a: bool): |
196 | | - microvm = microvm_factory(bin_dir / "firecracker", bin_dir / "jailer") |
197 | | - return microvm.ssh.run(command) |
198 | | - |
199 | | - (_, old_out, old_err), (_, new_out, new_err), the_same = binary_ab_test( |
200 | | - test_runner, |
201 | | - comparator, |
202 | | - a_directory=FC_WORKSPACE_DIR / "build" / a_revision, |
203 | | - b_directory=b_directory, |
204 | | - ) |
205 | | - |
206 | | - assert ( |
207 | | - the_same |
208 | | - ), f"The output of running command `{command}` changed:\nOld:\nstdout:\n{old_out}\nstderr\n{old_err}\n\nNew:\nstdout:\n{new_out}\nstderr:\n{new_err}" |
209 | | - |
210 | | - |
211 | | -def precompiled_ab_test_guest_command_if_pr( |
212 | | - microvm_factory: Callable[[Path, Path], Microvm], |
213 | | - command: str, |
214 | | - *, |
215 | | - comparator=default_comparator, |
216 | | - check_in_nonpr=True, |
217 | | -): |
218 | | - """The same as git_ab_test_command_if_pr, but via SSH""" |
219 | | - if is_pr(): |
220 | | - precompiled_ab_test_guest_command( |
221 | | - microvm_factory, command, comparator=comparator |
222 | | - ) |
223 | | - return None |
224 | | - |
225 | | - microvm = microvm_factory(*get_firecracker_binaries()) |
226 | | - return microvm.ssh.run(command, check=check_in_nonpr) |
227 | | - |
228 | | - |
229 | 178 | def check_regression( |
230 | 179 | a_samples: List[float], b_samples: List[float], *, n_resamples: int = 9999 |
231 | 180 | ): |
|
0 commit comments