Skip to content
Merged
Show file tree
Hide file tree
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ jobs:
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4]
shard: [1, 2, 3, 4, 5, 6]
env:
VITE_GITTENSORY_API_ORIGIN: https://gittensory-api.aethereal.dev
steps:
Expand Down Expand Up @@ -435,13 +435,13 @@ jobs:
run: npm run build --workspace @jsonbored/gittensory-engine
- name: Prepare test reports dir
run: mkdir -p reports/junit
- name: Test with coverage (shard ${{ matrix.shard }}/4)
- name: Test with coverage (shard ${{ matrix.shard }}/6)
id: coverage
env:
# Disables vitest.config.ts's own global 90% threshold check for THIS per-shard invocation -- a
# single shard only exercises part of the tree, so it would always false-fail. The global-threshold
# "catastrophe net" this disables is NOT dropped from CI, though: validate-tests-merge (below) merges
# all 4 shards' coverage via vitest's own --mergeReports and re-checks the threshold against that
# all shards' coverage via vitest's own --mergeReports and re-checks the threshold against that
# merged (whole-suite) total, without COVERAGE_NO_THRESHOLDS set.
COVERAGE_NO_THRESHOLDS: "true"
# Same self-contained-test-file narrowing as the pre-sharding job had -- see the `mcpCliHarness`/
Expand All @@ -464,11 +464,11 @@ jobs:
--exclude "test/unit/miner-calibration-types.test.ts"
)
fi
npm run test:coverage -- --maxWorkers=4 --shard=${{ matrix.shard }}/4 --reporter=default --reporter=blob --reporter=junit --outputFile.blob=blob-report/report-${{ matrix.shard }}.blob --outputFile.junit=reports/junit/vitest.xml "${EXCLUDE_ARGS[@]}"
npm run test:coverage -- --maxWorkers=4 --shard=${{ matrix.shard }}/6 --reporter=default --reporter=blob --reporter=junit --outputFile.blob=blob-report/report-${{ matrix.shard }}.blob --outputFile.junit=reports/junit/vitest.xml "${EXCLUDE_ARGS[@]}"
- name: Test failure guidance
if: ${{ failure() && steps.coverage.conclusion == 'failure' }}
run: |
echo "::error title=Tests::The backend test coverage suite failed (shard ${{ matrix.shard }}/4)."
echo "::error title=Tests::The backend test coverage suite failed (shard ${{ matrix.shard }}/6)."
echo "Coverage itself is gated by Codecov on changed lines (codecov/patch), computed from all shards' merged lcov."
echo "Reproduce locally with: 'npm run test:coverage' (unsharded, runs the whole suite)."
- name: Verify coverage report exists
Expand All @@ -478,7 +478,7 @@ jobs:
echo "::error title=Coverage::coverage/lcov.info is missing or empty"
exit 1
fi
# Consumed by validate-tests-merge to re-check the global coverage threshold against all 4 shards
# Consumed by validate-tests-merge to re-check the global coverage threshold against all shards
# combined -- see this job's own header comment.
- name: Upload coverage blob report
if: ${{ success() }}
Expand Down Expand Up @@ -547,7 +547,7 @@ jobs:
override_pr: ${{ github.event.pull_request.number }}
fail_ci_if_error: false

# Re-checks vitest.config.ts's global 90% coverage threshold against all 4 shards MERGED -- each shard
# Re-checks vitest.config.ts's global 90% coverage threshold against all shards MERGED -- each shard
# above deliberately disables that check for itself (COVERAGE_NO_THRESHOLDS=true), since a single shard's
# partial view would always false-fail it. This is the "loose catastrophe net" (e.g. a deleted test file)
# vitest.config.ts's own comment describes; Codecov's patch gate (changed-lines only) doesn't cover a
Expand Down
2 changes: 1 addition & 1 deletion test/unit/workflow-runner-labels.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe("workflow runner labels", () => {
// validate-code so the dominant ~9-10min step no longer serializes with the much-faster checks.
const validateTestsJob = workflow.slice(workflow.indexOf("\n validate-tests:\n"), workflow.indexOf("\n validate-tests-merge:\n"));
expect(validateTestsJob).toContain("runs-on: ubuntu-latest");
// validate-tests-merge re-checks the global coverage threshold against all 4 shards merged -- see its
// validate-tests-merge re-checks the global coverage threshold against all shards merged -- see its
// own header comment in ci.yml.
const validateTestsMergeJob = workflow.slice(workflow.indexOf("\n validate-tests-merge:\n"), workflow.indexOf("\n security:\n"));
expect(validateTestsMergeJob).toContain("runs-on: ubuntu-latest");
Expand Down