Skip to content

Add CI/CD test pipeline and unit tests for account, order, payment, and product#7

Merged
rasadov merged 20 commits into
masterfrom
feat/testing-pipeline
Jun 26, 2026
Merged

Add CI/CD test pipeline and unit tests for account, order, payment, and product#7
rasadov merged 20 commits into
masterfrom
feat/testing-pipeline

Conversation

@rasadov

@rasadov rasadov commented Jun 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add GitHub Actions workflow (CI/CD Test Pipeline) that runs unit tests on every push/PR.
  • Add service and repository unit tests for order, payment, and product, following the same patterns as account.
  • Add orchestrator for E2E tests for managing execution order of tests
  • Move GraphQL E2E tests into tests/e2e/ and exclude them from the default unit test run.
  • Switch in-memory SQLite test setup to the pure Go driver (github.com/glebarez/sqlite) so repository tests run without CGO/gcc on Windows.
  • Fix flaky account service tests by validating JWT claims instead of comparing raw token strings (CI runs with -race, which slows bcrypt and can cause tokens to differ by iat).

Unit tests run with -race and exclude tests/e2e. E2E job starts the full Docker Compose stack and runs ./tests/e2e/....

Other changes

  • docker-compose.yaml: optional DODO_API_KEY / DODO_TEST_MODE env vars for the payment service (used in CI via secrets).
  • order/internal/repository.go: use Model(&models.Order{}) in UpdateOrderPaymentStatus for SQLite-compatible updates in tests.

Test plan

  • Unit tests pass locally: go test ./account/tests/... ./order/tests/... ./payment/tests/... ./product/tests/...
  • CI unit job passes on this PR
  • GraphQL E2E suite still passes against a running stack: go test ./tests/e2e/...

@rasadov rasadov merged commit 1bc2bde into master Jun 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant