Skip to content

Tests optimizations #35327

Closed
Closed

Description

@mruff-aeq

Measured CI critical path across BC Registries repos (latest green run of each). Goal: cut PR feedback time without reducing coverage.

Done (PR bcgov/business-dashboard-ui#303): Cypress 6m33s to 2m55s via 3 shards, removed hard sleeps, stubbed LaunchDarkly / state filing / external navigations, flaky-attempt logger.

Remaining work, ranked by payoff:

  1. lear legal-api pytest: 13 min single process. Shard-ready (testcontainers Postgres, session DB, nested-transaction rollback per test, no serial marks). Split into 3 matrix jobs (services / resources / rest) with coverage merge, or pytest-xdist with per-worker DB. Target ~4 min. Needs a shard input in bcregistry-sre backend-ci.yaml or a lear-local workflow.
  2. bcregistry-sre frontend-ci.yaml: npx nuxt prepare runs on non-Nuxt apps (35-43s per job, 3 jobs per run) and the lint job gates unit tests and build. Guard nuxt prepare on nuxt.config presence, run lint in parallel with tests. Saves ~1.5 min on business-filings-ui, business-create-ui, business-edit-ui each. Owner: SRE.
  3. business-ui corps Playwright: 158s on 1 shard. Matrix already supports --shard; set shardIndex: [1,2,3,4], shardTotal: [4] (currently commented out). Target ~60s.
  4. bcrs-shared-components: uncached 88s npm install in each of 3 jobs. Add setup-node npm cache and npm ci. Saves ~1 min per job.
  5. business-ui business-registry-ui vitest 126s. Review pool/isolation config, est. 30-50%.

Out of scope: filer, emailer, colin-api, Vue repo unit test configs (already reasonable).

Activity

  1. added
    Entities TeamA label to filter on the tickets for the Entities based team that takes care of front end features
    on Oct 21, 2026
  2. self-assigned this
    on Oct 21, 2026
  3. mruff-aeq commented on Oct 21, 2026

    @mruff-aeq
    CollaboratorAuthor

    Final numbers, all four PRs green with measured timings in their descriptions:

    Repo PR Before After
    lear (legal-api) bcgov/lear#4884 unit-testing job 13m55s (pytest 12m59s) 4m45s (pytest 3m59s)
    business-dashboard-ui bcgov/business-dashboard-ui#304 Cypress job 10m33s 2m55s across 3 shards, 142 tests
    business-ui bcgov/business-ui#585 corps e2e job 272s (Playwright 158s, 1 shard) 165-191s per shard, 4 in parallel (Playwright 53-85s)
    bcrs-shared-components bcgov/bcrs-shared-components#324 jobs 104s / 123s / 102s 46s / 68s / 50s
  4. mruff-aeq commented on Oct 23, 2026

    @mruff-aeq
    CollaboratorAuthor

    only improvements to github infrastructure, not to be qa tested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Entities TeamA label to filter on the tickets for the Entities based team that takes care of front end features

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions