Skip to content

Commit 11de526

Browse files
committed
use gotestsum for tests
this shows only a concise summary for skipped and successful tests, but fully expands all failed tests with names
1 parent 6f559e1 commit 11de526

3 files changed

Lines changed: 19 additions & 14 deletions

File tree

.github/workflows/sanitizers.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ jobs:
102102
run: echo "$(pwd)/php/target/bin" >> "$GITHUB_PATH"
103103
- name: Install e-dant/watcher
104104
uses: ./.github/actions/watcher
105-
- name: Set Set CGO flags
105+
- name: Install gotestsum
106+
run: go install gotest.tools/gotestsum@latest
107+
- name: Set CGO flags
106108
run: |
107109
{
108110
echo "CGO_CFLAGS=$CFLAGS -I${PWD}/watcher/target/include $(php-config --includes)"
109111
echo "CGO_LDFLAGS=$LDFLAGS $(php-config --ldflags) $(php-config --libs)"
110112
} >> "$GITHUB_ENV"
111-
- name: Compile tests
112-
run: go test ${{ matrix.sanitizer == 'msan' && '-tags=nowatcher' || '' }} -${{ matrix.sanitizer }} -v -x -c
113113
- name: Run tests
114-
run: ./frankenphp.test -test.v
114+
run: gotestsum -- ${{ matrix.sanitizer == 'msan' && '-tags=nowatcher' || '' }} -${{ matrix.sanitizer }} ./...

.github/workflows/tests.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@ jobs:
6464
- name: Build testcli binary
6565
working-directory: internal/testcli/
6666
run: go build
67-
- name: Compile library tests
68-
run: go test -race -v -x -c
67+
- name: Install gotestsum
68+
run: go install gotest.tools/gotestsum@latest
6969
- name: Run library tests
70-
run: ./frankenphp.test -test.v
70+
run: gotestsum -- -race ./...
7171
- name: Run Caddy module tests
7272
working-directory: caddy/
73-
run: go test -race -v ./...
73+
run: gotestsum -- -race ./...
7474
- name: Run Fuzzing Tests
7575
working-directory: caddy/
7676
run: go test -fuzz FuzzRequest -fuzztime 20s
@@ -136,9 +136,11 @@ jobs:
136136
run: |
137137
echo "CGO_CFLAGS=$(php-config --includes)" >> "${GITHUB_ENV}"
138138
echo "CGO_LDFLAGS=$(php-config --ldflags) $(php-config --libs)" >> "${GITHUB_ENV}"
139+
- name: Install gotestsum
140+
run: go install gotest.tools/gotestsum@latest
139141
- name: Run integration tests
140142
working-directory: internal/extgen/
141-
run: go test -tags integration -v -timeout 30m
143+
run: gotestsum -- -tags integration -timeout 30m
142144
tests-mac:
143145
name: Tests (macOS, PHP 8.5)
144146
runs-on: macos-latest
@@ -164,7 +166,9 @@ jobs:
164166
env:
165167
phpts: ts
166168
debug: true
167-
- name: Set Set CGO flags
169+
- name: Install gotestsum
170+
run: go install gotest.tools/gotestsum@latest
171+
- name: Set CGO flags
168172
run: |
169173
{
170174
echo "CGO_CFLAGS=-I/opt/homebrew/include/ $(php-config --includes)"
@@ -173,7 +177,7 @@ jobs:
173177
- name: Build
174178
run: go build -tags nowatcher
175179
- name: Run library tests
176-
run: go test -tags nowatcher -race -v ./...
180+
run: gotestsum -- -tags nowatcher -race ./...
177181
- name: Run Caddy module tests
178182
working-directory: caddy/
179-
run: go test -race -v ./...
183+
run: gotestsum -- -race ./...

.github/workflows/windows.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,10 @@ jobs:
228228
"opcache.enable=0`r`nopcache.enable_cli=0" | Out-File php.ini
229229
$env:PHPRC = Get-Location
230230
231-
go test -race ./...
231+
go install gotest.tools/gotestsum@latest
232+
gotestsum -- -race ./...
232233
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
233234
cd caddy
234-
go test -race ./...
235+
gotestsum -- -race ./...
235236
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
236237
working-directory: ${{ github.workspace }}\frankenphp

0 commit comments

Comments
 (0)