Skip to content

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

Closed

Description

@nc9

Problem

Running the CLI test suite sends real telemetry to production (POST https://api.squirrelscan.com/v1/traces). On 2026-11-22, every CI and agent run of apps/cli/tests/self/updater.test.ts produced one fresh install ID, under version 0.0.190, reporting the same three events: error with self_update:SIGNATURE_FAILED, self_update:SIGNATURE_REQUIRED and self_update:ATTESTATION_FAILED. That's 31 rows between 10:27 and 11:29 UTC, and no released binary sends those codes yet. Leaked update events from the same tests appear too.

The cause is in the test file. describe("updater")'s beforeEach runs delete process.env.NO_TELEMETRY so telemetry behaviour can be tested, but only tests that call captureTelemetry() replace globalThis.fetch. Every other test that takes a failure path (signature, attestation) or starts an update sends a real request. Setting NO_TELEMETRY=1 in CI doesn't help, because the test removes it.

Impact: production telemetry counts for update failures and update attempts are inflated by test runs. The post-release monitoring of ATTESTATION_FAILED can't tell test runs from real installs without a heuristic.

Acceptance Criteria

  • No test in apps/cli can reach the real API: a test that wants telemetry stubs the transport. A shared default (preload or the updater file's beforeEach) points every unstubbed send at a dead local endpoint, or otherwise blocks it.
  • A guard test fails if a test in updater.test.ts attempts a request to a non-local host. Removing the default stub makes it fail.
  • Running apps/cli/tests/self/updater.test.ts with telemetry enabled and network access sends zero requests to api.squirrelscan.com. Show it, for example with a fetch spy that counts non-local calls across the file.
  • Other apps/cli test files that delete NO_TELEMETRY or DO_NOT_TRACK are checked for the same pattern, and fixed or confirmed safe.
  • The audit covers EVERY telemetry event the CLI tests can trigger, not only self_update:*. That includes update (sent when an update starts), install, first_audit_* and error via trackError. Each test file that can reach trackTelemetryEvent, trackError or trackFirstRunEvent is listed, with how it is kept off the network. Prod showed update events from about 294 distinct installs at 0.0.190-beta.1, 60 at beta.2 and 18 at 0.0.190 in 3 days, far more than real beta users, so this leak predates pub#2244.

Activity

  1. self-assigned this
    on Nov 22, 2026
  2. added
    bug
    size: S
    privacy
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcliprivacysize: S

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions