Skip to main content

Testing Strategy

Default CI Gate

CI should run tests with --build_tests_only so wildcard patterns do not fail on non-test build targets.

  • Monorepo non-deploy gate: .github/workflows/bazel-build.yml
  • Website deploy workflow tests: .github/workflows/cloudflare-workers.yml
  • Microservice deploy workflow tests: .github/workflows/gcp-deploy.yml
  • Android workflow tests: .github/workflows/android.yml

Example:

bazel test --build_tests_only //...

Optional Manual-Tagged Tests

Manual-tagged tests are excluded from default wildcard runs and can be triggered separately when deeper coverage is needed.

  • Workflow: .github/workflows/bazel-build.yml
  • Trigger: workflow_dispatch
  • Input: run_manual_targets=true

This job runs:

bazel query 'attr("tags", "manual", tests(//...))'
bazel test --build_tests_only <manual-test-targets>

Local Commands

Use the unified local runner for normal development and release-prep checks:

./scripts/test-local.sh doctor
./scripts/test-local.sh quick
./scripts/test-local.sh contracts
./scripts/test-local.sh local
./scripts/test-local.sh no-heavy
./scripts/test-local.sh full
./scripts/test-local.sh external-gates

For credentialed PR QA, start the unified local validation stack and run the browser/API smoke:

./scripts/local-validation.sh up
./scripts/local-validation.sh smoke all
./scripts/local-validation.sh rebuild merchant-api
./scripts/local-validation.sh ports

Run default test behavior locally:

bazel test --build_tests_only //...

Run manual-tagged tests locally:

mapfile -t MANUAL_TEST_TARGETS < <(bazel query 'attr("tags", "manual", tests(//...))')
if (( ${#MANUAL_TEST_TARGETS[@]} > 0 )); then
bazel test --build_tests_only "${MANUAL_TEST_TARGETS[@]}"
fi

Frontend Testing (Vitest)

Website tests use Vitest with the following conventions:

  • Test files: src/*.test.tsx (colocated with source files)
  • Import from vitest: import { describe, it, expect } from "vitest"
  • Use createElement for component testing (not render)
  • Run via Bazel:
bazel test //apps/websites/portals/retail:test
bazel test //apps/websites/portals/support:test

Backend Testing (JUnit)

Microservice tests use JUnit 4 + Mockito:

  • Test files: src/test/java/com/myriad/<service>/...
  • JUnit 4 style with @Test, static imports from org.junit.Assert
  • Run via Bazel:
bazel test //apps/microservices/merchant-api:core_test
bazel test //apps/microservices/management-api:core_test
bazel test //apps/microservices/...

E2E Testing (Playwright)

Behavior-level integration tests verify end-user flows against the local dev environment.

cd apps/websites/portals/retail && pnpm exec playwright test --list
cd apps/websites/portals/support && pnpm exec playwright test --list

External Gates

Some evidence is intentionally outside the local WSL test battery. Use ./scripts/test-local.sh external-gates to record current availability for:

  • Android emulator/device execution from WSL
  • Mac/Xcode XCFramework artifact proof
  • real Gateway/provider sandbox reconciliation
  • Cloudflare, Cloud Run, real App Check, email/SMS, and store-console behavior