diff --git a/.github/workflows/sanitizers.yaml b/.github/workflows/sanitizers.yaml index 5ba8813ba..15fe013d5 100644 --- a/.github/workflows/sanitizers.yaml +++ b/.github/workflows/sanitizers.yaml @@ -18,6 +18,7 @@ permissions: contents: read env: GOTOOLCHAIN: local + GOTESTSUM_FORMAT: pkgname-and-test-fails jobs: # Adapted from https://github.com/beberlei/hdrhistogram-php sanitizers: @@ -102,13 +103,13 @@ jobs: run: echo "$(pwd)/php/target/bin" >> "$GITHUB_PATH" - name: Install e-dant/watcher uses: ./.github/actions/watcher - - name: Set Set CGO flags + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + - name: Set CGO flags run: | { echo "CGO_CFLAGS=$CFLAGS -I${PWD}/watcher/target/include $(php-config --includes)" echo "CGO_LDFLAGS=$LDFLAGS $(php-config --ldflags) $(php-config --libs)" } >> "$GITHUB_ENV" - - name: Compile tests - run: go test ${{ matrix.sanitizer == 'msan' && '-tags=nowatcher' || '' }} -${{ matrix.sanitizer }} -v -x -c - name: Run tests - run: ./frankenphp.test -test.v + run: gotestsum -- ${{ matrix.sanitizer == 'msan' && '-tags=nowatcher' || '' }} -${{ matrix.sanitizer }} ./... diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 407d9fb0c..396d9ccf7 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -19,6 +19,7 @@ permissions: env: GOTOOLCHAIN: local GOEXPERIMENT: cgocheck2 + GOTESTSUM_FORMAT: pkgname-and-test-fails jobs: tests-linux: name: Tests (Linux, PHP ${{ matrix.php-versions }}) @@ -64,13 +65,13 @@ jobs: - name: Build testcli binary working-directory: internal/testcli/ run: go build - - name: Compile library tests - run: go test -race -v -x -c + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest - name: Run library tests - run: ./frankenphp.test -test.v + run: gotestsum -- -race ./... - name: Run Caddy module tests working-directory: caddy/ - run: go test -race -v ./... + run: gotestsum -- -race ./... - name: Run Fuzzing Tests working-directory: caddy/ run: go test -fuzz FuzzRequest -fuzztime 20s @@ -136,9 +137,11 @@ jobs: run: | echo "CGO_CFLAGS=$(php-config --includes)" >> "${GITHUB_ENV}" echo "CGO_LDFLAGS=$(php-config --ldflags) $(php-config --libs)" >> "${GITHUB_ENV}" + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest - name: Run integration tests working-directory: internal/extgen/ - run: go test -tags integration -v -timeout 30m + run: gotestsum -- -tags integration -timeout 30m tests-mac: name: Tests (macOS, PHP 8.5) runs-on: macos-latest @@ -164,7 +167,9 @@ jobs: env: phpts: ts debug: true - - name: Set Set CGO flags + - name: Install gotestsum + run: go install gotest.tools/gotestsum@latest + - name: Set CGO flags run: | { echo "CGO_CFLAGS=-I/opt/homebrew/include/ $(php-config --includes)" @@ -173,7 +178,7 @@ jobs: - name: Build run: go build -tags nowatcher - name: Run library tests - run: go test -tags nowatcher -race -v ./... + run: gotestsum -- -tags nowatcher -race ./... - name: Run Caddy module tests working-directory: caddy/ - run: go test -race -v ./... + run: gotestsum -- -race ./... diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index c8510b557..8da554789 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -33,6 +33,7 @@ permissions: env: GOTOOLCHAIN: local + GOTESTSUM_FORMAT: pkgname-and-test-fails GOFLAGS: "-ldflags=-extldflags=-fuse-ld=lld -tags=nobadger,nomysql,nopgx" PHP_DOWNLOAD_BASE: "https://downloads.php.net/~windows/releases/" CC: clang @@ -228,9 +229,10 @@ jobs: "opcache.enable=0`r`nopcache.enable_cli=0" | Out-File php.ini $env:PHPRC = Get-Location - go test -race ./... + go install gotest.tools/gotestsum@latest + gotestsum -- -race ./... if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } cd caddy - go test -race ./... + gotestsum -- -race ./... if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } working-directory: ${{ github.workspace }}\frankenphp