Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 28 additions & 6 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-latest
# A job that hits this cap is reported as `cancelled`, not `failure`, so it reads as non-red
# on a required check. Every step below is capped in its own right and this sits above their
# sum (41 on the longest leg), so a stall surfaces as a step failure and this stays a backstop.
# sum (44 on the longest leg), so a stall surfaces as a step failure and this stays a backstop.
timeout-minutes: 45
strategy:
fail-fast: false
Expand Down Expand Up @@ -71,6 +71,7 @@ jobs:
run: node --test .github/actions/review-coverage/*.test.mjs

- name: Setup Harper
id: setup-harper
timeout-minutes: 3
env:
DEFAULTS_MODE: 'dev'
Expand All @@ -82,11 +83,32 @@ jobs:

run: node --enable-source-maps ./dist/bin/harper.js install

# `.mocharc.json` sets `timeout: 0`, so nothing inside the run can time out on its own —
# this cap is the only thing that turns a wedged suite into a reported failure.
- name: Run tests
timeout-minutes: 15
run: npm run test:unit:all
# `.mocharc.json` sets `timeout: 0`, so nothing inside a suite can time out on its own —
# each step's own cap is what turns a wedged suite into a reported failure, so one bad
# top-level suite no longer hides the rest (harper#2587, harper#2017) — `test:unit:lmdb`
# still chains its own resources/apitests/bin runs with `&&`, so a failure there stops
# at the first of those three. Per-step budgets are sized off measured Node 22 durations
# (the slowest leg): main ~2m15-2m30, apitests ~20-25s, resources ~4m30-5m25,
# lmdb ~1m55-2m05.
- name: 'Unit tests: main'
if: "!cancelled() && steps.setup-harper.outcome == 'success'"
timeout-minutes: 4
run: npm run test:unit:main

- name: 'Unit tests: apitests'
if: "!cancelled() && steps.setup-harper.outcome == 'success'"
timeout-minutes: 3
run: npm run test:unit:apitests

- name: 'Unit tests: resources'
if: "!cancelled() && steps.setup-harper.outcome == 'success'"
timeout-minutes: 7
run: npm run test:unit:resources

- name: 'Unit tests: lmdb'
if: "!cancelled() && steps.setup-harper.outcome == 'success'"
timeout-minutes: 4
run: npm run test:unit:lmdb

# Windows had no unit-level coverage at all before this job: every job above pins
# ubuntu-latest, and integration-tests.yml was the only workflow touching Windows.
Expand Down
Loading