Skip to content

chore(server): move or remove the manual smoke scripts under src/ #240

Closed

Description

@gkhngyk

Summary

Two manual smoke scripts live inside the server's production source tree but are never imported by the app:

Both are run by hand (node src/test-tracking.js) and are not referenced anywhere — no import, no package.json script. A grep over server/src confirms nothing pulls them in.

Why it matters

  • They sit next to real application modules, so they read as part of the runtime — a contributor can't tell at a glance that they're throwaway smoke tests.
  • Each one calls live, paid third-party APIs (OpenAI, DataForSEO). Running them by accident costs money.
  • They blur the line the repo already draws between application code and tooling (server/src/scripts/ already exists, e.g. backfill-shopping-cards.js).

Suggested fix

Either is acceptable; moving is preferred because it keeps the scripts available for debugging and matches the existing layout:

Option A — Move (recommended). Relocate both into the existing server/src/scripts/ directory and wire them as explicit, named scripts:

// server/package.json — scripts
"smoke:tracking": "node src/scripts/test-tracking.js",
"smoke:volumes":  "node src/scripts/test-volumes.js"

Document in the server README that these hit live, paid APIs (OpenAI / DataForSEO) and should be run deliberately.

Option B — Delete. Remove both files; they remain recoverable from git history.

Either way, this is a relocation/cleanup only — no application behavior changes.

Activity

  1. gkhngyk commented on Jun 23, 2026

    @gkhngyk
    ContributorAuthor

    Resolved — no code needed. Both manual smoke scripts were removed in #256 ("Resolves the remaining server-side gaps from #125", shipped in v0.1.4): server/src/test-tracking.js and server/src/test-volumes.js are gone from the source tree, and neither server/src nor server/src/scripts/ contains them anymore.

    Rather than just relocating them, #256 replaced their purpose with proper mocked Vitest tests — server/src/lib/tracking-pipeline.test.js and server/src/lib/volumes-pipeline.test.js — which exercise the same tracking/volume pipelines with the third-party calls (OpenAI / DataForSEO) mocked, so they run in CI with no live, paid API calls. That removes the original concern (throwaway scripts next to runtime code that cost money if run by accident) entirely.

    Closing as completed.

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

    good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions