Skip to content

Commit 1154af7

Browse files
authored
[CICD] stream go test output, and turn off DEVBOX_DEBUG for example tests (#906)
## Summary The current test output when the macos tests timeout is not helpful. We don't know if any of the specific example tests is taking longer: https://github.com/jetpack-io/devbox/actions/runs/4685049031/jobs/8301872973 In this PR: 1. set `go test -v`. This should stream the output as the tests run. It also has the benefit of printing a summary of which testscripts passed versus failed (tho not useful for timeouts). I use this always locally when running these example testscripts. 2. turn off DEVBOX_DEBUG for example testscripts. The devbox-internal logging is less useful for examples testscripts, and makes it hard to follow where in the examples's `run_test` the script is failing or getting stuck on. DEVBOX_DEBUG _is_ useful for other unit tests so left it on for those. ## How was it tested? buildkite run, will inspect.
1 parent 5ae8c20 commit 1154af7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/cli-tests.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ on:
2323
type: boolean
2424
run-mac-tests:
2525
type: boolean
26+
# run the example tests with DEVBOX_DEBUG=1
27+
example-debug:
28+
type: boolean
2629

2730
permissions:
2831
contents: read
@@ -117,11 +120,14 @@ jobs:
117120
nix-build-user-count: 4
118121
- name: Run tests
119122
env:
123+
# For example tests, we default to non-debug mode since the debug output is less useful than for unit testscripts.
124+
# But we allow overriding via inputs.example-debug
125+
DEVBOX_DEBUG: ${{ (!matrix.run-example-tests || inputs.example-debug) && '1' || '0' }}
120126
DEVBOX_EXAMPLE_TESTS: ${{ matrix.run-example-tests }}
121127
# Used in `go test -timeout` flag. Needs a value that time.ParseDuration can parse.
122128
DEVBOX_GOLANG_TEST_TIMEOUT: "${{ (github.ref == 'refs/heads/main' || inputs.run-mac-tests) && '35m' || '15m' }}"
123129
run: |
124-
go test -timeout $DEVBOX_GOLANG_TEST_TIMEOUT ./...
130+
go test -v -timeout $DEVBOX_GOLANG_TEST_TIMEOUT ./...
125131
126132
auto-nix-install: # ensure Devbox installs nix and works properly after installation.
127133
strategy:

0 commit comments

Comments
 (0)