Skip to content

Commit 51e5244

Browse files
committed
fix: propagate test status code in test runner
1 parent ac6c885 commit 51e5244

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

bin/run_tests.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22
export BB_REAL_S3_IN_TEST=1
33
process-compose up -D
44
devenv-flake-test
5+
TEST_STATUS=$?
56
process-compose down
7+
exit $TEST_STATUS

scripts/build-ci.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -euo pipefail
4+
35
# TODO: assumes nix, tar, curl (m2), ln, unlink
46

57
SYSTEM=$(nix eval --raw --impure --expr "builtins.currentSystem")
@@ -26,8 +28,8 @@ nix print-dev-env --impure .#testenv >staging/root/shell.sh
2628
nix path-info --impure -r .#devShells."$SYSTEM".testenv | xargs -P0 -I {} cp -r {} staging/nix/store
2729

2830
echo "~~~ find & replace ~~~"
29-
./scripts/replace.sh "$PWD" "/tmp/boostbox"
30-
./scripts/replace.sh "$XDG_RUNTIME_DIR" "/tmp/boostbox"
31+
./scripts/replace.sh "$PWD" "/tmp/boostbox" staging
32+
./scripts/replace.sh "$XDG_RUNTIME_DIR" "/tmp/boostbox" staging
3133

3234
echo "~~~ tar ~~~"
3335
tar -cf deps.tar -C staging .

scripts/build_test_container.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
25
sudo podman build -t boostbox_test -f Containerfile.tests

scripts/ci.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
25
sudo tar -C / -xf zstd.tar.gz
36
./zstd -d deps.tar.zst
47
sudo tar -C / -xf deps.tar
8+
rm deps.tar
59
sudo cp /root/shell.sh "$HOME"
610
sudo cp -r /root/.config "$HOME"
711
sudo cp -r /root/.m2 "$HOME"

scripts/replace.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env bash
22

3+
set -euo pipefail
4+
35
# TODO: needs rg, sed
46

57
# Script to recursively find and replace two values in files using ripgrep
@@ -34,7 +36,7 @@ REPLACE_ESCAPED=$(escape_for_sed "$REPLACE")
3436
# Use ripgrep to find all files containing the search term
3537
# -l: list files only, automatically skips binary files
3638
# --fixed-strings: treat pattern as literal string, not regex
37-
rg -l --fixed-strings -- "$SEARCH" "$DIR" | while read -r file; do
39+
rg --no-ignore -l --fixed-strings -- "$SEARCH" "$DIR" | while read -r file; do
3840
echo "Processing: $file"
3941

4042
# Use sed with escaped delimiters for safe in-place replacement

scripts/run_container_tests.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
#!/usr/bin/env bash
2-
sudo podman run --rm -v "$PWD:/app" -w /app --name boostbox_tests -it --network none -u ubuntu boostbox_tests "/app/scripts/ci.sh"
2+
3+
set -euo pipefail
4+
5+
sudo podman run --rm -v "$PWD:/app" -w /app --name boostbox_tests -it --network none -u ubuntu boostbox_test "/app/scripts/ci.sh"

0 commit comments

Comments
 (0)