File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed
integration_tests/performance Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change 2121of both invocations is the same, the test passes (with us being alerted to this situtation via a special pipeline that
2222does not block PRs). If not, it fails, preventing PRs from introducing new vulnerable dependencies.
2323"""
24- import contextlib
2524import os
2625import statistics
2726from pathlib import Path
@@ -267,17 +266,3 @@ def git_clone(clone_path, commitish):
267266 utils .check_output (f"git clone -b { branch_name } { git_root .strip ()} { clone_path } " )
268267 utils .check_output (f"git branch -D { branch_name } " )
269268 return clone_path
270-
271-
272- # Once we upgrade to python 3.11, this will be in contextlib:
273- # https://docs.python.org/3/library/contextlib.html#contextlib.chdir
274- @contextlib .contextmanager
275- def chdir (to ):
276- """Context manager that temporarily `chdir`s to the specified path"""
277- cur = os .getcwd ()
278-
279- try :
280- os .chdir (to )
281- yield
282- finally :
283- os .chdir (cur )
Original file line number Diff line number Diff line change 11# Copyright 2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
22# SPDX-License-Identifier: Apache-2.0
33"""Optional benchmarks-do-not-regress test"""
4+ import contextlib
45import json
56import logging
67import platform
1011import pytest
1112
1213from framework import utils
13- from framework .ab_test import chdir , git_ab_test
14+ from framework .ab_test import git_ab_test
1415from host_tools .cargo_build import cargo
1516
1617LOGGER = logging .getLogger (__name__ )
@@ -32,7 +33,7 @@ def run_criterion(firecracker_checkout: Path, is_a: bool) -> Path:
3233 """
3334 baseline_name = "a_baseline" if is_a else "b_baseline"
3435
35- with chdir (firecracker_checkout ):
36+ with contextlib . chdir (firecracker_checkout ):
3637 # Passing --message-format json to cargo tells it to print its log in a json format. At the end, instead of the
3738 # usual "placed executable <...> at <...>" we'll get a json object with an 'executable' key, from which we
3839 # extract the path to the compiled benchmark binary.
You can’t perform that action at this time.
0 commit comments