Repository navigation
Expand file tree
/
Copy pathTaskfile.yml
More file actions
133 lines (109 loc) · 3.57 KB
/
Copy pathTaskfile.yml
File metadata and controls
133 lines (109 loc) · 3.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
version: "3"
dotenv: ['{{.HOME}}/.config/go-postgres.env', '.env']
tasks:
fmt:
desc: Format Go code
cmds:
- go fix ./...
- gofmt -w .
vet:
desc: Run go vet
cmds:
- go vet ./...
lint:
desc: Run golangci-lint
cmds:
- golangci-lint run ./...
test:
desc: Run all tests
cmds:
- go test -count=1 ./...
test:wasm:
desc: Run tests under wasip1/wasm via wazero
cmds:
- GOWASIRUNTIME=wazero GOOS=wasip1 GOARCH=wasm go test -exec "$(go env GOROOT)/lib/wasm/go_wasip1_wasm_exec" -count=1 ./...
build:
desc: Build all packages
cmds:
- go build ./...
check:
desc: Run fmt, vet, lint, and test
cmds:
- task: fmt
- task: vet
- task: lint
- task: test
deps:tidy:
desc: Tidy Go module dependencies
cmds:
- go mod tidy
clean:
desc: Clean build artifacts
cmds:
- go clean ./...
- rm -rf docs/
soak:local:
desc: Run soak test locally (set SOAK_DURATION, e.g. task soak:local SOAK_DURATION=5m)
cmds:
- SOAK_DURATION={{.SOAK_DURATION | default "1m"}} SOAK_WORKERS={{.SOAK_WORKERS | default "4"}} SOAK_OUTPUT={{.SOAK_OUTPUT | default ""}} go test -run TestSoak -timeout 0 -count=1 -v
soak:cloud:
desc: Run soak test on Hetzner cloud VM
cmds:
- SOAK_DURATION={{.SOAK_DURATION | default "30m"}} SOAK_WORKERS={{.SOAK_WORKERS | default "4"}} ./scripts/soak-cloud.sh
bench:
desc: Run translation benchmarks
cmds:
- go test -bench=. -benchmem -run='^$' -count=1 ./...
test:soak:
desc: Run native soak test (5 min default)
cmds:
- SOAK_DURATION={{.SOAK_DURATION | default "5m"}} go test -count=1 -run TestSoak -v -timeout 10m ./...
test:soak:long:
desc: Run long soak test (1 hour)
env:
SOAK_DURATION: 1h
cmds:
- go test -count=1 -run TestSoak -v -timeout 2h ./...
soak:wasm:build:
desc: Build WASM soak test binary
cmds:
- GOOS=js GOARCH=wasm go build -o cmd/soakwasm/soak.wasm ./cmd/soakwasm/
soak:wasm:
desc: Build and serve WASM soak test
deps: [soak:wasm:build]
cmds:
- go run ./cmd/soakserve
container:build:
desc: Build soak test container
cmds:
- podman build -t go-postgres-soak -f Containerfile .
container:run:
desc: Run soak test in container (512MB, 1h)
cmds:
- podman run --rm --memory=512m -e SOAK_DURATION=1h go-postgres-soak
container:run:oom:
desc: Run soak test in container with tight memory (128MB, 30m)
cmds:
- podman run --rm --memory=128m -e SOAK_DURATION=30m go-postgres-soak
docs:build:
desc: Build documentation
cmds:
- task-plus md2html --file index.md --dst docs
- task-plus md2html --file research-soak-testing.md --dst docs
- task-plus md2html --file research-numeric-views.md --dst docs
- task-plus md2html --file research-uuid-keys.md --dst docs
research:numeric-view:
desc: Run the NUMERIC balance-view study (set BENCH_PG_DSN for the native Postgres pass; SCALES overrides account counts)
dir: research
cmds:
- go run ./cmd/numeric-view -scales {{.SCALES | default "1000,10000,100000"}} -out ../research-numeric-views.md
research:uuid-keys:
desc: Run the UUID-vs-TEXT key study (set BENCH_PG_DSN for the native Postgres pass; SCALES overrides account counts)
dir: research
cmds:
- go run ./cmd/uuid-keys -scales {{.SCALES | default "1000,10000,100000"}} -out ../research-uuid-keys.md
research:test:
desc: Run the research studies' own tests
dir: research
cmds:
- go test -count=1 ./...