Skip to content

ci: add automated test job once test infra exists #125

Closed

Description

@gkhngyk

Problem

Neither web nor server has automated tests, and CI runs no test step. The only test-like code today is the manual scripts server/src/test-tracking.js and server/src/test-volumes.js, which are not part of any automated suite.

This is the third gap in our CI/CD coverage (alongside web lint and the missing server pipeline).

Proposed change

  1. Pick and set up a test runner (e.g. vitest) in web and server.
  2. Add test scripts to both package.json files.
  3. Port the manual server/src/test-*.js scripts into real, runnable tests.
  4. Seed an initial set of unit tests for pure functions that are easy to cover, e.g.:
    • web/src/lib/citations/classify.ts
    • web/src/lib/citations/article-type.ts
    • web/src/lib/csv.ts
    • server/src/lib/response-parser.js
    • server/src/lib/cloro-scraper.js (response parsing)
  5. Add a test step to each job in .github/workflows/ci.yml.

Acceptance criteria

  • Test runner configured in both packages
  • test script available in web and server
  • Manual test-*.js scripts replaced by automated tests
  • CI runs tests on every PR and on push to main

Notes

This depends on (or pairs well with) the web-lint and server-CI issues. The test step can be added to the existing/added jobs rather than as a separate workflow.

Activity

  1. added
    enhancement
    help wanted
    on May 30, 2026
  2. gkhngyk commented on Jun 8, 2026

    @gkhngyk
    ContributorAuthor

    Decomposed into granular issues

    To make this epic actionable for contributors, the web-side work has been split into smaller, self-contained issues:

    Mapping to the checklist above:

    What this issue still tracks

    This stays open as the umbrella, now scoped to the parts not yet split out:

    • server/ test runner + test script
    • Port the manual server/src/test-tracking.js / test-volumes.js into real automated tests
    • Seed server-side unit tests (e.g. response-parser.js, cloro-scraper.js response parsing)
    • article-type.ts web unit tests (not yet split out)
    • Add the test step to the server CI job

    Contributors: please pick up #195 first (it unblocks the web test issues), and use this issue for the remaining server-side test work.

  3. Pallavikumarimdb commented on Jun 9, 2026

    @Pallavikumarimdb
    Contributor

    @gkhngyk I’d like to work on this issue. I’ve already completed #195 and will be picking up #196 and #198 next as part of the web-related work and server part. Does that sound good to you?

  4. gkhngyk commented on Jun 11, 2026

    @gkhngyk
    ContributorAuthor

    Hi @Pallavikumarimdb 👋 Thanks again for #195 — great work landing the web test infrastructure.

    The web side is now in good shape: #195 (Vitest infra) and #196 (csv.ts tests) are merged, and CI already runs yarn test on the web job. That leaves the server-side part of this umbrella still open:

    • server/ test runner + test script
    • Port server/src/test-tracking.js / test-volumes.js into real automated tests
    • Seed server unit tests (e.g. response-parser.js, cloro-scraper.js response parsing)
    • Add the test step to the server CI job

    Are you still planning to pick up the server part? No pressure at all — just checking so we know whether to keep it reserved for you or reopen it for other contributors. If you'd like to take it, feel free to go ahead and open a PR whenever you're ready 🙌

  5. Pallavikumarimdb commented on Jun 11, 2026

    @Pallavikumarimdb
    Contributor

    Hi @Pallavikumarimdb 👋 Thanks again for #195 — great work landing the web test infrastructure.

    The web side is now in good shape: #195 (Vitest infra) and #196 (csv.ts tests) are merged, and CI already runs yarn test on the web job. That leaves the server-side part of this umbrella still open:

    * [ ]  `server/` test runner + `test` script[ ]  Port `server/src/test-tracking.js` / `test-volumes.js` into real automated tests[ ]  Seed server unit tests (e.g. `response-parser.js`, `cloro-scraper.js` response parsing)[ ]  Add the test step to the **server** CI job
    

    Are you still planning to pick up the server part? No pressure at all — just checking so we know whether to keep it reserved for you or reopen it for other contributors. If you'd like to take it, feel free to go ahead and open a PR whenever you're ready 🙌

    Heyy @gkhngyk Yeah, I would love to pick up the server part and open the PR.

  6. gkhngyk commented on Jun 11, 2026

    @gkhngyk
    ContributorAuthor

    Awesome, thanks @Pallavikumarimdb! 🙌 The server part is yours — assigning you now. Take your time, and feel free to split it into more than one PR if that's easier (e.g. runner + CI step first, then the ported tests). Ping here if you hit any questions.

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

Metadata

Metadata

Labels

enhancementhelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions