Skip to content

ci: CI pipeline never runs backend tests (no jest job for 25+ existing spec files) #656

Description

@phertyameen

Summary

.github/workflows/ci.yml runs four jobs today: lint-imports, build, type-check, and contracts. None of them executes the test suite, so regressions in any of the ~25 existing *.spec.ts files reach main undetected. The root package.json even ships a placeholder script:

"test": "echo \"Error: no test specified\" && exit 1"

while backend/package.json defines working scripts (test, test:cov, test:e2e) that nothing invokes.

What exists today

  • Unit specs: backend/src/analytics/** (providers, listeners, jobs, guards), backend/src/score/providers/score.service.spec.ts, backend/src/blockchain/**, backend/src/challenge-attempt/providers/*.spec.ts, backend/src/game-sessions/providers/*.spec.ts, backend/src/health/*.spec.ts, backend/src/rewards/providers/reward.service.spec.ts, backend/src/auth/providers/guest-session.provider.spec.ts, backend/src/users/providers/xp-level.service.spec.ts
  • E2E specs: backend/test/app.e2e-spec.ts, backend/test/analytics.e2e-spec.ts (config: backend/test/jest-e2e.json)

Proposed change

  1. Add a test job to .github/workflows/ci.yml: npm --workspace backend run test -- --ci --runInBand (unit) and optionally the e2e suite against a service container (postgres/redis).
  2. Point the root test script at the workspace suites (npm --workspace backend run test) or remove it.
  3. Consider uploading coverage (jest --coverage) as a PR artifact.

Acceptance criteria

  • A green PR runs the full backend unit suite in CI.
  • Root npm test no longer prints "Error: no test specified".
  • Existing specs pass in CI environment (or documented skips for env-dependent cases).

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions