Skip to main content

QA Strategy & Test Infrastructure

Overview

Multi-layer automated testing pipeline for Tower: backend unit tests, Docker-based integration tests with real services, front-end unit tests (Vitest), and Playwright e2e tests.

How it works

Backend

  • Unit tests cover guards, services, storage adapters, and source providers.
  • Integration tests run against real MinIO, Azurite, Gitea, WireMock, FTP/SFTP, and Jaeger containers via docker-compose.test.yml.
  • A mock bcyip-toolkit binary enables offline protect workflow testing.
  • TestHelper class provides S3/Azure/FTP helpers and webhook trigger utilities.

Frontend

  • Vitest unit tests: Dashboard, login, activate, RenderWhen, format, tasks.
  • Playwright e2e tests: auth flow, dashboard flow, storage flow, workflow creation.
  • Test render helper (ui/src/test/render.tsx) wraps components with all providers.

CI Pipeline

  • workflow:rules eliminates duplicate branch + MR pipelines.
  • Split into 4 test stages: test:back:unit, test:back:integration, test:front:unit, test:front:e2e.
  • Integration and e2e run automatically on MR→master and develop/master pushes; manual otherwise.
  • Jest coverage threshold + JUnit/Cobertura artifact export.

Key files

  • .gitlab-ci.yml — Full CI rework
  • docker-compose.test.yml — Test services
  • test/helpers/test-helper.ts — TestHelper class
  • test/integration/*.spec.ts — Integration test specs
  • test/setup/seed-*.sh — Container seed scripts
  • test/mocks/bcyip-toolkit — Mock binary
  • test/wiremock/mappings/*.json — WireMock stubs
  • ui/e2e/*.spec.ts — Playwright e2e tests
  • ui/playwright.config.ts — Playwright config

Technical decisions

  • --experimental-vm-modules is required for AWS SDK v3 ESM compatibility inside Jest VM.
  • @sinonjs/fake-timers (post-upgrade) requires epoch milliseconds instead of Date objects in jest.setSystemTime().