Test more, log less.

This commit is contained in:
Nuno Cruces
2025-11-10 11:26:28 +00:00
parent 8f9a6ca4c1
commit 3132b272de
10 changed files with 32 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -euo pipefail set -euo pipefail
echo 'set -eu' > test.sh echo 'set -eux' > test.sh
for p in $(go list ./...); do for p in $(go list ./...); do
dir=".${p#github.com/ncruces/go-sqlite3}" dir=".${p#github.com/ncruces/go-sqlite3}"

View File

@@ -51,17 +51,17 @@ jobs:
run: go vet ./... run: go vet ./...
- name: Build - name: Build
run: go build -v ./... run: go build ./...
- name: Test - name: Test
run: go test -v ./... -bench . -benchtime=1x run: go test ./... -bench . -benchtime=1x
- name: Test BSD locks - name: Test BSD locks
run: go test -v -tags sqlite3_flock ./... run: go test -tags sqlite3_flock ./...
if: matrix.os != 'windows-latest' if: matrix.os != 'windows-latest'
- name: Test dot locks - name: Test dot locks
run: go test -v -tags sqlite3_dotlk ./... run: go test -tags sqlite3_dotlk ./...
if: matrix.os != 'windows-latest' if: matrix.os != 'windows-latest'
- name: Test modules - name: Test modules
@@ -69,7 +69,7 @@ jobs:
run: | run: |
go work init . go work init .
go work use -r embed gormlite go work use -r embed gormlite
go test -v ./embed/bcw2/... go test ./embed/bcw2/...
- name: Test GORM - name: Test GORM
shell: bash shell: bash
@@ -99,21 +99,19 @@ jobs:
os: os:
- name: freebsd - name: freebsd
version: '14.3' version: '14.3'
flags: '-test.v'
- name: netbsd - name: netbsd
version: '10.1' version: '10.1'
flags: '-test.v'
- name: freebsd - name: freebsd
arch: arm64 arch: arm64
version: '14.3' version: '14.3'
flags: '-test.v -test.short' tflags: '-test.short'
- name: netbsd - name: netbsd
arch: arm64 arch: arm64
version: '10.1' version: '10.1'
flags: '-test.v -test.short' tflags: '-test.short'
- name: openbsd - name: openbsd
version: '7.8' version: '7.8'
flags: '-test.v -test.short' tflags: '-test.short'
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: test needs: test
@@ -124,7 +122,7 @@ jobs:
env: env:
GOOS: ${{ matrix.os.name }} GOOS: ${{ matrix.os.name }}
GOARCH: ${{ matrix.os.arch }} GOARCH: ${{ matrix.os.arch }}
TESTFLAGS: ${{ matrix.os.flags }} TESTFLAGS: ${{ matrix.os.tflags }}
run: .github/workflows/build-test.sh run: .github/workflows/build-test.sh
- name: Test - name: Test
@@ -143,14 +141,11 @@ jobs:
os: os:
- name: dragonfly - name: dragonfly
action: 'vmactions/dragonflybsd-vm@v1' action: 'vmactions/dragonflybsd-vm@v1'
tflags: '-test.v'
- name: illumos - name: illumos
action: 'vmactions/omnios-vm@v1' action: 'vmactions/omnios-vm@v1'
tflags: '-test.v'
- name: solaris - name: solaris
action: 'vmactions/solaris-vm@v1' action: 'vmactions/solaris-vm@v1'
bflags: '-tags sqlite3_dotlk' bflags: '-tags sqlite3_dotlk'
tflags: '-test.v'
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: test needs: test
@@ -187,7 +182,7 @@ jobs:
GOARCH: wasm GOARCH: wasm
GOWASIRUNTIME: wasmtime GOWASIRUNTIME: wasmtime
GOWASIRUNTIMEARGS: '--env CI=true' GOWASIRUNTIMEARGS: '--env CI=true'
run: go test -v -short -tags sqlite3_dotlk -skip Example ./... run: go test -short -tags sqlite3_dotlk -skip Example ./...
test-qemu: test-qemu:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -200,16 +195,19 @@ jobs:
with: { go-version: stable } with: { go-version: stable }
- name: Test 386 (32-bit) - name: Test 386 (32-bit)
run: GOARCH=386 go test -v -short ./... run: GOARCH=386 go test -short ./...
- name: Test riscv64 (interpreter) - name: Test riscv64 (interpreter)
run: GOARCH=riscv64 go test -v -short ./... run: GOARCH=riscv64 go test -short ./...
- name: Test ppc64le (interpreter) - name: Test ppc64le (interpreter)
run: GOARCH=ppc64le go test -v -short ./... run: GOARCH=ppc64le go test -short ./...
- name: Test loong64 (interpreter)
run: GOARCH=loong64 go test -short ./...
- name: Test s390x (big-endian) - name: Test s390x (big-endian)
run: GOARCH=s390x go test -v -short -tags sqlite3_dotlk ./... run: GOARCH=s390x go test -short -tags sqlite3_dotlk ./...
test-linuxarm: test-linuxarm:
runs-on: ubuntu-24.04-arm runs-on: ubuntu-24.04-arm
@@ -221,7 +219,10 @@ jobs:
with: { go-version: stable } with: { go-version: stable }
- name: Test - name: Test
run: go test -v ./... run: go test ./...
- name: Test arm (32-bit)
run: GOARCH=arm GOARM=7 go test -short ./...
test-macintel: test-macintel:
runs-on: macos-15-intel runs-on: macos-15-intel
@@ -233,7 +234,7 @@ jobs:
with: { go-version: stable } with: { go-version: stable }
- name: Test - name: Test
run: go test -v ./... run: go test ./...
test-winarm: test-winarm:
runs-on: windows-11-arm runs-on: windows-11-arm
@@ -245,4 +246,4 @@ jobs:
with: { go-version: stable } with: { go-version: stable }
- name: Test - name: Test
run: go test -v ./... run: go test ./...

View File

@@ -84,7 +84,7 @@ It also benefits greatly from [SQLite's](https://sqlite.org/testing.html) and
thorough testing. thorough testing.
Every commit is tested on: Every commit is tested on:
* Linux: amd64, arm64, 386, riscv64, ppc64le, s390x * Linux: amd64, arm64, 386, arm, riscv64, ppc64le, loong64, s390x
* macOS: amd64, arm64 * macOS: amd64, arm64
* Windows: amd64, arm64 * Windows: amd64, arm64
* BSD: * BSD:

View File

@@ -1,4 +1,4 @@
//go:build ((linux || darwin || windows || freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le)) || sqlite3_flock || sqlite3_dotlk //go:build ((linux || darwin || windows || freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le || loong64)) || sqlite3_flock || sqlite3_dotlk
package vfs package vfs

View File

@@ -1,4 +1,4 @@
//go:build ((freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le) && !sqlite3_dotlk) || sqlite3_flock //go:build ((freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le || loong64) && !sqlite3_dotlk) || sqlite3_flock
package vfs package vfs

View File

@@ -1,4 +1,4 @@
//go:build (windows && (386 || arm || amd64 || arm64 || riscv64 || ppc64le)) || sqlite3_dotlk //go:build (windows && (386 || arm || amd64 || arm64 || riscv64 || ppc64le || loong64)) || sqlite3_dotlk
package vfs package vfs

View File

@@ -1,4 +1,4 @@
//go:build ((freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le)) || sqlite3_flock || sqlite3_dotlk //go:build ((freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le || loong64)) || sqlite3_flock || sqlite3_dotlk
package vfs package vfs

View File

@@ -1,4 +1,4 @@
//go:build (linux || darwin) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le) && !(sqlite3_flock || sqlite3_dotlk) //go:build (linux || darwin) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le || loong64) && !(sqlite3_flock || sqlite3_dotlk)
package vfs package vfs

View File

@@ -1,4 +1,4 @@
//go:build !(((linux || darwin || windows || freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le)) || sqlite3_flock || sqlite3_dotlk) //go:build !(((linux || darwin || windows || freebsd || openbsd || netbsd || dragonfly || illumos) && (386 || arm || amd64 || arm64 || riscv64 || ppc64le || loong64)) || sqlite3_flock || sqlite3_dotlk)
package vfs package vfs

View File

@@ -1,4 +1,4 @@
//go:build (386 || arm || amd64 || arm64 || riscv64 || ppc64le) && !sqlite3_dotlk //go:build (386 || arm || amd64 || arm64 || riscv64 || ppc64le || loong64) && !sqlite3_dotlk
package vfs package vfs