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-toolkitbinary enables offline protect workflow testing. TestHelperclass 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:ruleseliminates 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 reworkdocker-compose.test.yml— Test servicestest/helpers/test-helper.ts— TestHelper classtest/integration/*.spec.ts— Integration test specstest/setup/seed-*.sh— Container seed scriptstest/mocks/bcyip-toolkit— Mock binarytest/wiremock/mappings/*.json— WireMock stubsui/e2e/*.spec.ts— Playwright e2e testsui/playwright.config.ts— Playwright config
Technical decisions
--experimental-vm-modulesis required for AWS SDK v3 ESM compatibility inside Jest VM.@sinonjs/fake-timers(post-upgrade) requires epoch milliseconds instead of Date objects injest.setSystemTime().