From 218e9648fefdf276d53a704bd79f96164039308d Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Mon, 13 May 2024 12:11:21 -0500 Subject: [PATCH] test: remove genv requirement for e2e --- e2e/run_test | 71 +++++++++++++++++++++++----------------------------- 1 file changed, 32 insertions(+), 39 deletions(-) diff --git a/e2e/run_test b/e2e/run_test index 46198e9f1..bfde5728a 100755 --- a/e2e/run_test +++ b/e2e/run_test @@ -44,37 +44,38 @@ remove_isolated_env() { } within_isolated_env() { - _env \ - --ignore-environment \ - --chdir="$TEST_WORKDIR" \ - - \ - ROOT="$ROOT" \ - HOME="$TEST_HOME" \ - TMPDIR="$TEST_TMPDIR" \ - SHELL="$(type -p bash)" \ - PATH="${CARGO_TARGET_DIR:-$ROOT/target}/debug:$HOME/mise/bin:$CARGO_HOME/bin:$TEST_HOME/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin" \ - MISE_DATA_DIR="$MISE_DATA_DIR" \ - MISE_STATE_DIR="$MISE_STATE_DIR" \ - MISE_CACHE_DIR="$MISE_CACHE_DIR" \ - MISE_CONFIG_DIR="$MISE_CONFIG_DIR" \ - MISE_TMP_DIR="$TEST_TMPDIR" \ - MISE_SYSTEM_DIR="$MISE_SYSTEM_DIR" \ - MISE_TRUSTED_CONFIG_PATHS="$TEST_ISOLATED_DIR" \ - MISE_EXPERIMENTAL=1 \ - MISE_YES=1 \ - TEST_NAME="$TEST" \ - TEST_ROOT="$SCRIPT_DIR" \ - TEST_SCRIPT="$TEST_SCRIPT" \ - TEST_DIR="$(dirname "$TEST_SCRIPT")" \ - GITHUB_ACTION="${GITHUB_ACTION:-}" \ - GITHUB_API_TOKEN="${GITHUB_API_TOKEN:-}" \ - CARGO_HOME="$CARGO_HOME" \ - RUSTUP_HOME="$RUSTUP_HOME" \ - LLVM_PROFILE_FILE="${LLVM_PROFILE_FILE:-}" \ - CARGO_LLVM_COV="${CARGO_LLVM_COV:-}" \ - CARGO_LLVM_COV_SHOW_ENV="${CARGO_LLVM_COV_SHOW_ENV:-}" \ - CARGO_LLVM_COV_TARGET_DIR="${CARGO_LLVM_COV_TARGET_DIR:-}" \ - "$@" || return $? + ( + cd "$TEST_ISOLATED_DIR" + env -i - \ + PWD="$TEST_WORKDIR" \ + ROOT="$ROOT" \ + HOME="$TEST_HOME" \ + TMPDIR="$TEST_TMPDIR" \ + SHELL="$(type -p bash)" \ + PATH="${CARGO_TARGET_DIR:-$ROOT/target}/debug:$HOME/mise/bin:$CARGO_HOME/bin:$TEST_HOME/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin" \ + MISE_DATA_DIR="$MISE_DATA_DIR" \ + MISE_STATE_DIR="$MISE_STATE_DIR" \ + MISE_CACHE_DIR="$MISE_CACHE_DIR" \ + MISE_CONFIG_DIR="$MISE_CONFIG_DIR" \ + MISE_TMP_DIR="$TEST_TMPDIR" \ + MISE_SYSTEM_DIR="$MISE_SYSTEM_DIR" \ + MISE_TRUSTED_CONFIG_PATHS="$TEST_ISOLATED_DIR" \ + MISE_EXPERIMENTAL=1 \ + MISE_YES=1 \ + TEST_NAME="$TEST" \ + TEST_ROOT="$SCRIPT_DIR" \ + TEST_SCRIPT="$TEST_SCRIPT" \ + TEST_DIR="$(dirname "$TEST_SCRIPT")" \ + GITHUB_ACTION="${GITHUB_ACTION:-}" \ + GITHUB_API_TOKEN="${GITHUB_API_TOKEN:-}" \ + CARGO_HOME="$CARGO_HOME" \ + RUSTUP_HOME="$RUSTUP_HOME" \ + LLVM_PROFILE_FILE="${LLVM_PROFILE_FILE:-}" \ + CARGO_LLVM_COV="${CARGO_LLVM_COV:-}" \ + CARGO_LLVM_COV_SHOW_ENV="${CARGO_LLVM_COV_SHOW_ENV:-}" \ + CARGO_LLVM_COV_TARGET_DIR="${CARGO_LLVM_COV_TARGET_DIR:-}" \ + "$@" || return $? + ) } run_test() { @@ -102,14 +103,6 @@ run_test() { return "$status" } -_env() { - if type genv >/dev/null 2>&1; then - genv "$@" - else - env "$@" - fi -} - os() { case "$(uname -s)" in Darwin) echo "macos" ;;