Skip to content

[TEST-01] Add backend tests to CI pipeline #339

Description

@grantfox-oss

Problem

Backend tests exist in micopay/backend/src/tests/ (12 test files) but are not run in CI. The .github/workflows/ci.yml only runs npm run build for the backend — no npm run test step.

This means:

  • Code changes can break tests without anyone knowing
  • Security tests (security.test.ts, abuse.service.test.ts) never run
  • Regression bugs slip through to production

Impact

  • Untested code ships to production
  • Security vulnerabilities go undetected
  • No safety net for refactoring

Proposed Fix

  1. Add npm run test step to the backend CI job in .github/workflows/ci.yml
  2. Ensure all test files can run without external dependencies (Redis, etc.)
  3. If tests require a database, use a service container in CI
  4. Add test coverage reporting (optional but recommended)

Files to modify

  • .github/workflows/ci.yml (backend job section)

Acceptance Criteria

  • Backend tests run on every PR
  • CI fails if any test fails
  • Tests complete within 5 minutes
  • No external service dependencies required for tests

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSbackendcomplexity: mediumRequiere cuenta, interceptor de tráfico, o conocimiento del protocolotesting

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions