Files
Pulse/cmd
pulse-triage[bot] ba4e5f86cd Speed up backend test KDF and pulse-agent release-identity builds
Backend `rest-*` shards became the slowest PR checks on `Pulse` after
Vitest partitioning (`#5331`), with `internal/config`,
`internal/api/configapi`, and `cmd/pulse-agent` spending hundreds of
seconds under `-race` on 600,000-iteration PBKDF2 calls, default-cost
bcrypt hashing, and `-p=1`-serialized `go build` invocations.

- Add a test-only `PULSE_TEST_EXPORT_PBKDF2_ITERATIONS` override
  (`1000..600000`) in `internal/config/export.go`, gated strictly on
  `.test`/`.test.exe` executables just like `pkg/auth/password.go`
  (`PULSE_TEST_BCRYPT_COST`). Production binaries always use `600000`
  and `100000` legacy fallback.
- Add `TestMain` for `internal/config` and `internal/api/configapi` and
  wire `internal/api/main_test.go` to use bounded test KDF parameters
  while preserving explicit real `600000`/`100000` roundtrip and legacy
  compatibility tests (`TestExportPBKDF2ProductionDefaultsAndTestOverrideGuard`,
  `TestHandleImportConfigAcceptsLegacyVersion40Bundle`).
- Remove hardcoded `-p=1` from `cmd/pulse-agent/release_identity_test.go`
  so test builds respect `GOMAXPROCS` (`2` in CI) without altering build
  flags or release-identity verification.

Contract-Neutral: Test-only PBKDF2 override gated strictly on .test/.test.exe executables; production 600000/100000 KDF defaults, archive wire format, and API contracts are unchanged.
Change-source: pulse-maintainer
2026-11-28 01:19:46 +00:00
..
…