Skip to content

Commit

Permalink
ci: wrap tilt ci tests in script to handle logs
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Feb 2, 2024
1 parent 11f6ba8 commit 4e2a325
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
for LABEL in "${LABELS[@]}"; do
case "$LABEL" in
dashboard|consent|pay|core|admin-panel)
ARGS+=" --test $LABEL"
ARGS+=" $LABEL"
;;
esac
done
Expand All @@ -40,4 +40,4 @@ jobs:
echo "args=$ARGS" >> "$GITHUB_OUTPUT"
- name: Tilt CI
if: steps.prepare_args.outputs.args != ''
run: nix develop -c xvfb-run tilt --file dev/Tiltfile ci -- ${{ steps.prepare_args.outputs.args }}
run: nix develop -c xvfb-run ./dev/bin/tilt-ci.sh ${{ steps.prepare_args.outputs.args }}
2 changes: 1 addition & 1 deletion ci/apps/app-template.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ plan:
#@ params["GOOGLE_CREDENTIALS"] = "((staging-gcp-creds.creds_json))"
#@ params["SSH_PRIVATE_KEY"] = "((staging-ssh.ssh_private_key))"
#@ params["SSH_PUB_KEY"] = "((staging-ssh.ssh_public_key))"
#@ params["CMD"] = "tilt --file dev/Tiltfile ci -- --test " + app
#@ params["CMD"] = "./dev/bin/tilt-ci.sh " + app
name: #@ tilt_integration_test_name(app)
serial: true
plan:
Expand Down
2 changes: 1 addition & 1 deletion ci/core/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ jobs:
- #@ build_edge_image(component)
#@ end
- #@ build_edge_image("api", sub_file = "migrate")
- #@ on_nix_host("core-bundle-integration-tests", "api", "tilt --file dev/Tiltfile ci -- --test core")
- #@ on_nix_host("core-bundle-integration-tests", "api", "./dev/bin/tilt-ci.sh core")
- #@ on_nix_host("core-bundle-bats-tests", "api", "bats --setup-suite-file bats/ci_setup_suite.bash -t bats/core/**")
- name: release-core-bundle
plan:
Expand Down
16 changes: 16 additions & 0 deletions dev/bin/tilt-ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

apps="$@"

REPO_ROOT=$(git rev-parse --show-toplevel)

tilt --file dev/Tiltfile ci -- --test "$apps" \
| tee "${REPO_ROOT}/bats/.e2e-tilt.log" \
| grep -- "-test "
status=${PIPESTATUS[0]}

if [[ $status -eq 0 ]]; then
echo "Tilt CI passed"
fi

exit "$status"

0 comments on commit 4e2a325

Please sign in to comment.