Repository navigation
Expand file tree
/
Copy pathtask-test.yml
More file actions
49 lines (41 loc) · 1.5 KB
/
Copy pathtask-test.yml
File metadata and controls
49 lines (41 loc) · 1.5 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
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
tasks:
test:
desc: Run all tests (Go + frontend)
deps: [rpc:generate]
cmds:
- task: test:go
- task: test:ui
# Pass packages or flags after `--`.
test:go:
desc: Run Go unit tests
cmd: gotestsum --format testname -- {{.CLI_ARGS | default "$(go list ./... | egrep -v '(/test|/codegen)$$')"}}
# Chromium by default; needs the pgsql container up.
test:e2e:
desc: Run the Playwright passkey ladder
cmd: pnpm exec vp run e2e-tests#test
test:ui:
desc: Run frontend unit tests
cmd: pnpm exec vp test {{.CLI_ARGS}}
coverage:
desc: Run Go tests with coverage
cmds:
- |
gotestsum --format testname -- \
-covermode=atomic -coverprofile=.output/coverage.out \
$(go list ./... | egrep -v '(/test|/codegen)$$')
- go tool cover -func=.output/coverage.out | tail -1
coverage:report:
desc: Open the HTML coverage report
deps: [coverage]
cmds:
- go tool cover -html=.output/coverage.out
# Against a running server; needs a seeded db — see scripts/loadtest/README.md.
bench:loadtest:
desc: Run the k6 load test
preconditions:
- sh: command -v k6
msg: k6 is not installed — see https://grafana.com/docs/k6/latest/set-up/install-k6/
cmds:
- k6 run -e K6_PROFILE={{.K6_PROFILE | default "smoke"}} -e K6_TARGET={{.K6_TARGET | default "http://localhost:3000"}} {{.CLI_ARGS}} scripts/loadtest/loadtest.mjs