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
@@ -249,17 +248,3 @@ def git_clone(clone_path, commitish):
249248 )
250249 utils .check_output (f"git branch -D { branch_name } " )
251250 return clone_path
252-
253-
254- # Once we upgrade to python 3.11, this will be in contextlib:
255- # https://docs.python.org/3/library/contextlib.html#contextlib.chdir
256- @contextlib .contextmanager
257- def chdir (to ):
258- """Context manager that temporarily `chdir`s to the specified path"""
259- cur = os .getcwd ()
260-
261- try :
262- os .chdir (to )
263- yield
264- finally :
265- 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