Skip to content

test(cli): stop updater tests sending real telemetry #2249 - #2251

Merged
nc9 merged 1 commit into
mainfrom
fix/2249-tests-no-real-telemetry
Nov 22, 2026
Merged

nc9 merged 1 commit into
mainfrom
fix/2249-tests-no-real-telemetry

Conversation

@nc9

@nc9 nc9 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #2249.

What leaked: updater.test.ts deletes NO_TELEMETRY in beforeEach, but only captureTelemetry() tests replaced fetch. Every other test on a signature/attestation failure or update path sent a real POST https://api.squirrelscan.com/v1/traces.

Fix: beforeEach now sets SQUIRREL_API_SERVER=http://127.0.0.1:9 (dead local endpoint) and installs a default recording fetch stub; afterEach restores it. captureTelemetry() also records URLs and is otherwise unchanged.

Guard: afterEach (and afterAll) assert that no recorded request targeted a non-local host.

Fail-before: with the SQUIRREL_API_SERVER line removed, 29 tests fail, each listing https://api.squirrelscan.com/v1/traces (84 pass / 29 fail). With the fix: 112 pass, 0 fail.

Other files that delete NO_TELEMETRY (setup-telemetry, first-run-telemetry, install-source, telemetry, path-setup) all stub fetch in beforeEach and/or point SQUIRREL_API_SERVER at localhost:9999: confirmed safe, no change.

No production code changed. No docs change needed (test-only). Gates: tsgo, oxlint, oxfmt --check clean; bun run scripts/test-suites.ts --run cli: 4661 pass, 14 skip, 0 fail; changelog.ts check OK (no entry needed).

@nc9
nc9 merged commit 0a2f602 into main Nov 22, 2026
10 checks passed
@nc9
nc9 deleted the fix/2249-tests-no-real-telemetry branch November 22, 2026 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI tests send real telemetry to production (updater tests delete NO_TELEMETRY)

1 participant