Skip to content

Commit

Permalink
.circleci: run start script test without the test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
Profpatsch committed Apr 2, 2019
1 parent 7ea18f8 commit b432574
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 22 deletions.
10 changes: 4 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 1 addition & 16 deletions tests/RunTests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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/...)"
Expand Down
21 changes: 21 additions & 0 deletions tests/run-start-script.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b432574

Please sign in to comment.