fix(build): task check runs in ~27s cold, ~12s warm
task test runs -short with the test cache on; task test:full keeps the uncached run. The 50s keepalive proof skips under -short (the deploy workflow's full go test still runs it). Sleep-bound archied watch tests run in parallel, and the read-only gate steps run concurrently after fmt and proto:check. ui:deps is run: once so the parallel UI steps install once.
This commit is contained in:
6 files changed
+39
-8
No files matched your search
@@ -118,7 +118,7 @@ golangci-lint run ./...
|
||||
| `task vet` | `go vet ./...` in the runtime module. |
|
||||
| `task lint` | `golangci-lint run ./...`. |
|
||||
| `task build` | Builds both commands into `bin/`. |
|
||||
| `task test` | `go test ./... -count=1` in the runtime module. |
|
||||
| `task test` | `go test -short ./...` in the runtime module, test cache on. `task test:full` is the uncached run including wall-clock-bound tests. |
|
||||
| `task check` | `fmt` + `proto:lint` + `proto:check` + `docs:check` + `vet` + `lint` + `build` + `test` + `test:tools` + `test:ui`. |
|
||||
| `task clean` | Recursively removes `bin/`; destructive. |
|
||||
| `task docker-build` | `docker compose build agent` only. |
|
||||
|
||||
@@ -98,7 +98,7 @@ Commands are defined in `Taskfile.yml` (requires Go 1.27.0,
|
||||
|
||||
```bash
|
||||
task build # build archied and archie-agent binaries into bin/
|
||||
task test # go test ./... -count=1
|
||||
task test # go test -short ./... (cached; task test:full runs everything uncached)
|
||||
task test:ui # dashboard node tests (DOM-building primitives)
|
||||
task ui # build dashboard into ui/dist (LAW asset)
|
||||
task fmt # go fix ./... && golangci-lint fmt
|
||||
|
||||
+25
-6
@@ -286,6 +286,9 @@ tasks:
|
||||
ui:deps:
|
||||
desc: Install the dashboard's node dependencies (ui/node_modules is gitignored)
|
||||
internal: true
|
||||
# Once per invocation: the gate's parallel UI steps both declare this, and
|
||||
# two concurrent installs into one node_modules corrupt it.
|
||||
run: once
|
||||
dir: ui
|
||||
cmds:
|
||||
- npm install --no-audit --no-fund
|
||||
@@ -314,10 +317,8 @@ tasks:
|
||||
Fix a failure with `task ui`, then commit the rebuilt bundle in the same
|
||||
commit as the source change that caused it.
|
||||
|
||||
Declares ui:deps like `ui` and `test:ui` do, so a fresh clone works; that
|
||||
means the gate runs `npm install` once for each dependent. Task's
|
||||
sources/generates up-to-date check does not apply to a node_modules
|
||||
directory, so the guard against that is a follow-up, not a claim here.
|
||||
Declares ui:deps like `ui` and `test:ui` do, so a fresh clone works;
|
||||
ui:deps is run: once, so the gate installs a single time.
|
||||
deps: [ui:deps]
|
||||
cmds:
|
||||
- bash tools/uidist.sh check
|
||||
@@ -478,7 +479,18 @@ tasks:
|
||||
- go build -ldflags "-X github.com/samcharles93/archie-core/internal/app/agentworker.version={{.RUNTIME_VERSION}} -X github.com/samcharles93/archie-core/internal/installtype.buildType=binary" -o {{.BIN_DIR}}/archie-agent ./cmd/archie-agent
|
||||
|
||||
test:
|
||||
desc: Run the Go test suite
|
||||
desc: Run the Go test suite, skipping wall-clock-bound tests and reusing cached passes
|
||||
summary: |
|
||||
-short skips tests that wait out real timers (the keepalive proof holds a
|
||||
watch open for 50s); each one names task test:full in its skip message.
|
||||
The test cache is left on: go reruns any package whose sources,
|
||||
dependencies, env or test files changed, so a cached pass is a pass on
|
||||
this tree.
|
||||
cmds:
|
||||
- go test -short ./...
|
||||
|
||||
test:full:
|
||||
desc: Run the whole Go test suite uncached, including the wall-clock-bound tests
|
||||
cmds:
|
||||
- go test ./... -count=1
|
||||
|
||||
@@ -499,9 +511,16 @@ tasks:
|
||||
check:
|
||||
desc: "Full quality gate: fmt, proto, docs, vet, lint, build, test, tools tests, ui tests and bundle"
|
||||
cmds:
|
||||
# The two steps that rewrite the tree run first and alone; everything
|
||||
# after them only reads it, so it runs concurrently.
|
||||
- task: fmt
|
||||
- task: proto:lint
|
||||
- task: proto:check
|
||||
- task: check:readonly
|
||||
|
||||
check:readonly:
|
||||
internal: true
|
||||
deps:
|
||||
- task: proto:lint
|
||||
- task: docs:check
|
||||
- task: docs:prds
|
||||
# Release notes are generated from the changelogs the release process
|
||||
|
||||
@@ -92,8 +92,10 @@ const (
|
||||
// reported, not fatal -- the kind stays absent, the file's value is the one in
|
||||
// effect, and the operator's fix in config.toml is what clears it.
|
||||
func TestStateStoreBootsWithStaleDatabaseOwnedValues(t *testing.T) {
|
||||
t.Parallel()
|
||||
for _, tt := range staleDatabaseOwnedSettings {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
dir := t.TempDir()
|
||||
path := filepath.Join(dir, "config.toml")
|
||||
body := fmt.Sprintf(
|
||||
|
||||
@@ -456,9 +456,11 @@ func TestPersonaWatchIsReEstablishedAfterTheStreamEnds(t *testing.T) {
|
||||
// than spun, a shutdown that does not wait out the backoff, and a resume point
|
||||
// that only updates carrying a version can move.
|
||||
func TestKeepWatchGuardrails(t *testing.T) {
|
||||
t.Parallel()
|
||||
log := slog.New(slog.DiscardHandler)
|
||||
versionOf := func(version int64) int64 { return version }
|
||||
t.Run("one stream is held at a time", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var opens atomic.Int64
|
||||
first := make(chan int64)
|
||||
close(first)
|
||||
@@ -485,6 +487,7 @@ func TestKeepWatchGuardrails(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("a stream that cannot be re-established is retried with backoff", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var opens atomic.Int64
|
||||
first := make(chan int64)
|
||||
close(first)
|
||||
@@ -515,6 +518,7 @@ func TestKeepWatchGuardrails(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("a cancelled context ends the watch while it is backing off", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
var opens atomic.Int64
|
||||
first := make(chan int64)
|
||||
close(first)
|
||||
@@ -540,6 +544,7 @@ func TestKeepWatchGuardrails(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("the reconnect resumes after the last version delivered", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
// A version this process applied, then the update a stream failure
|
||||
// arrives as: the failure carries no version, so it must not move the
|
||||
// resume point and the next stream must not be asked to replay history.
|
||||
@@ -744,6 +749,7 @@ func TestAttemptHealthyAtTheWindowBoundary(t *testing.T) {
|
||||
// same rule -- it ended at once having delivered nothing -- so the delay has
|
||||
// something to reset from.
|
||||
func TestKeepWatchBackoffResetsAfterASuccessfulReopen(t *testing.T) {
|
||||
t.Parallel()
|
||||
log, retries := newRetryLog()
|
||||
first := make(chan int64)
|
||||
close(first)
|
||||
@@ -793,6 +799,7 @@ func TestKeepWatchBackoffResetsAfterASuccessfulReopen(t *testing.T) {
|
||||
// minimum they start at. The delay is read off the watch's own log line, which
|
||||
// is where the loop states the wait it is about to take.
|
||||
func TestKeepWatchChargesAReopenTheStoreMerelyAccepted(t *testing.T) {
|
||||
t.Parallel()
|
||||
log, retries := newRetryLog()
|
||||
first := make(chan int64)
|
||||
close(first)
|
||||
|
||||
@@ -105,6 +105,9 @@ const keepaliveWindow = 50 * time.Second
|
||||
// above pins the same agreement in microseconds; this case is the end-to-end
|
||||
// proof, which is the part a value assertion cannot give.
|
||||
func TestStateStoreServerOptionsTolerateTheDialersKeepalive(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skipf("holds a watch open for %s of wall clock; runs in the full suite (task test:full)", keepaliveWindow)
|
||||
}
|
||||
// The options the standalone State Store serves its local profile with,
|
||||
// taken from the composition rather than hand-built here.
|
||||
served, loopback, err := stateStoreServerOpts("127.0.0.1:9090", "", &staterpc.TaskGrants{})
|
||||
|
||||
Reference in new issue
Block a user