Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }} ./...
21 changes: 13 additions & 8 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }})
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)"
Expand All @@ -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 ./...
6 changes: 4 additions & 2 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Loading