diff --git a/.circleci/config.yml b/.circleci/config.yml index 64fbe1815..b70f3727d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,14 +41,12 @@ jobs: bazel build --config ci //tests/... - run: name: Run tests - # bazel does not support recursive bazel call, so we - # cannot use bazel run here because the test runner uses - # bazel command: | - bazel build --config ci //tests:run-tests - # run the start script test - ./bazel-ci-bin/tests/run-tests --match "/startup script/" + # Run the start script test. + # Doesn't use the test suite binary, because that depends on nixpkgs dependencies. + ./tests/run-start-script.sh # TODO: enable all tests for bindists + # (this will require tests to both work with nixpkgs and hazel backends) # ATTN: when you change anything here, don’t forget to copy it to the build-darwin section build-linux-nixpkgs: diff --git a/tests/RunTests.hs b/tests/RunTests.hs index 4891b9876..b4266f340 100644 --- a/tests/RunTests.hs +++ b/tests/RunTests.hs @@ -75,22 +75,7 @@ main = hspec $ do outputSatisfy p' (bazel ["run", "//tests/multi_repl:c_multi_repl", "--", "-ignore-dot-ghci", "-e", ":show targets"]) it "startup script" $ do - assertSuccess (safeShell [ - "pwd=$(pwd)" - , "cd $(mktemp -d)" - , "$pwd/start" - - -- Copy the bazel configuration, this is only useful for CI - , "mkdir tools" - , "cp $pwd/.bazelrc .bazelrc" - - -- Set Nixpkgs in environment variable to avoid hardcoding it in - -- start script itself - , "NIX_PATH=nixpkgs=$pwd/nixpkgs/default.nix \ - \bazel build \ - \--config=ci \ - \//:example" - ]) + assertSuccess (safeShell ["./tests/run-start-script.sh"]) describe "failures" $ do all_failure_tests <- bazelQuery "kind(rule, //tests/failures/...) intersect attr('tags', 'manual', //tests/failures/...)" diff --git a/tests/run-start-script.sh b/tests/run-start-script.sh new file mode 100755 index 000000000..dc472b716 --- /dev/null +++ b/tests/run-start-script.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# Run the start script in its own workspace +# and build the example binary target. + +set -e + +pwd=$(pwd) +cd $(mktemp -d) +$pwd/start + +# Copy the bazel configuration, this is only useful for CI +mkdir tools +cp $pwd/.bazelrc .bazelrc + +# Set Nixpkgs in environment variable to avoid hardcoding it in +# start script itself +NIX_PATH=nixpkgs=$pwd/nixpkgs/default.nix \ + bazel build \ + --config=ci \ + //:example