Skip to content

tests: createTestStorage leaks SQUIRREL_CONTENT_STORE_PATH into later test files and breaks the store-scripts e2e #1322

Closed

Description

@nc9

createTestStorage() (apps/cli/src/crawler/storage/index.ts) sets process.env.SQUIRREL_CONTENT_STORE_PATH to a temp file when it is unset and never restores it. Seven files under apps/cli/tests/crawler call it, so once any of them has run, every later test file in the same bun test process has the variable set. The store-scripts e2e tests spawn the CLI with { ...process.env, HOME: ... }, so the child writes its content store to the shared temp file instead of its own HOME, and --store-scripts keeps every fetched script ... fails.

Repro on main: bun test tests/crawler/max-depth.test.ts tests/audit/store-scripts-1255.test.ts fails the store-scripts test; it passes alone.

Acceptance Criteria

  • createTestStorage() no longer sets or leaves SQUIRREL_CONTENT_STORE_PATH in the process environment.
  • The store-scripts e2e tests remove SQUIRREL_CONTENT_STORE_PATH from the environment they pass to the spawned CLI.
  • bun test tests/crawler/max-depth.test.ts tests/audit/store-scripts-1255.test.ts passes.

Activity

  1. added
    bug
    size: XS
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. nc9 commented on Oct 30, 2026

    @nc9
    ContributorAuthor

    Shipped in v0.0.143 (commits dcd8de5). Checked every acceptance criterion against current main: createTestStorage no longer leaks SQUIRREL_CONTENT_STORE_PATH.

    nik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsize: XS

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions