-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathTaskfile.yml
More file actions
102 lines (102 loc) · 3.03 KB
/
Copy pathTaskfile.yml
File metadata and controls
102 lines (102 loc) · 3.03 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
version: "3"
set:
- errexit
- nounset
- pipefail
tasks:
default:
desc: List available tasks
cmds:
- task --list
fmt:
desc: Format all project files
cmds:
- nix fmt
lint:
desc: Lint Go code
cmds:
- golangci-lint run
lint:fix:
desc: Lint Go code and auto-fix fixable issues
cmds:
- golangci-lint run --fix
test:
desc: Run unit tests (no backend services required)
cmds:
- go test -race ./...
test:integration:
desc: Run full test suite (backing services must already be running)
cmds:
- eval "$(enable-integration-tests)" && go test -race ./...
test:auto:
desc: Start fresh backing services on random ports, run full suite, teardown
cmds:
- bash dev-scripts/test-auto.sh
test:e2e:
desc: "Run a unified e2e harness scenario. Pass-through args, e.g. CLI_ARGS='--mode local --scenario cdc-lifecycle', CLI_ARGS='--mode local --all', CLI_ARGS='--mode kubernetes --scenario single-s3-postgres', or CLI_ARGS='--list'"
cmds:
- nix run .#e2e -- {{.CLI_ARGS}}
test:e2e:unit:
desc: "Run the fast offline unit tests for the e2e harness (CLI/runner/catalog logic)"
cmds:
- python3 -m pytest nix/e2e-tests/tests -m "not catalog" -q
test:deps:start:
desc: Allocate random ports, start backing services in detached mode, write state file
cmds:
- bash dev-scripts/test-auto.sh --start-only
test:deps:stop:
desc: Stop backing services started by test:deps:start
cmds:
- |
STATE_FILE="${TMPDIR:-/tmp}/ncps-test-deps.env"
if [ ! -f "$STATE_FILE" ]; then
echo "No state file found at $STATE_FILE, nothing to stop." >&2
exit 0
fi
# shellcheck source=/dev/null
. "$STATE_FILE"
if command -v process-compose >/dev/null 2>&1; then
process-compose down -p "$TEST_PC_PORT" || true
else
nix run .#test-deps -- down -p "$TEST_PC_PORT" 2>/dev/null || true
fi
rm -f "$STATE_FILE"
build:
desc: Build the ncps binary
cmds:
- go build .
dev:
desc: Start the development server with hot-reload
cmds:
- ./dev-scripts/run.py
deps:
desc: Start backing services (Garage, PostgreSQL, MariaDB, Redis)
cmds:
- nix run .#deps
ent:generate:
desc: Regenerate the Ent client from schemas
cmds:
- go generate ./ent/...
ent:lint:
desc: Lint Ent schemas for codegen invariant violations
cmds:
- go run ./cmd/ent-lint --root .
ent:check:
desc: Regenerate Ent client and lint schemas (CI check)
deps:
- ent:generate
- ent:lint
migrations:gen:
desc: Generate per-dialect Atlas migrations (NAME=<snake_case_name> required)
requires:
vars:
- NAME
cmds:
- go run ./cmd/generate-migrations --name={{.NAME}}
migrations:sql:
desc: Generate an empty SQL-only migration stub (NAME=<snake_case_name> required)
requires:
vars:
- NAME
cmds:
- go run ./cmd/generate-migrations --sql-only --name={{.NAME}}