Skip to content

Commit

Permalink
fix: green up --version flag test
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Feb 27, 2023
1 parent 50a3b23 commit 967eec4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 8 additions & 3 deletions integration_tests/aspect/common.bats
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ aspect() {
# but the configured path is only writable by specific users which we can't run as within the sandbox.
# these system wide flag affect the output path of the bazel-in-bazel that is run inside the tests leading to errors.
# NOTE: the output files left by bazel-in-bazel should be discarded as they are not part of the action.
"$TEST_SRCDIR/build_aspect_cli/cmd/aspect/aspect_/aspect" --nosystem_rc --nohome_rc $@
"$TEST_SRCDIR/build_aspect_cli/cmd/aspect/aspect_/aspect" --nosystem_rc --nohome_rc "$@"
}

aspect_bare() {
"$TEST_SRCDIR/build_aspect_cli/cmd/aspect/aspect_/aspect" "$@"
}

setup_file() {
export USE_BAZEL_VERSION=$(realpath $BAZEL_BINARY)
USE_BAZEL_VERSION="$(realpath "$BAZEL_BINARY")"
export USE_BAZEL_VERSION
export HOME="$TEST_TMPDIR"
mkdir -p "$HOME/.aspect/cli"
touch "$HOME/.aspect/cli/config.yaml"
Expand All @@ -19,4 +24,4 @@ setup_file() {
teardown_file() {
aspect shutdown
rm -f "$HOME/.aspect/cli/config.yaml"
}
}
4 changes: 3 additions & 1 deletion integration_tests/aspect/version_test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ setup() {
}

@test '--version flag should work' {
run aspect --version
# Use aspect_bare so we don't also set additional flags such as --nosystem_rc and --nohome_rc;
# --version flag has special handling and should be the only flag passed
run aspect_bare --version
assert_output --partial "aspect unknown [not built with --stamp]"
}

0 comments on commit 967eec4

Please sign in to comment.