Repository navigation
175 lines (158 loc) · 6.9 KB
/
Copy pathmutation-weekly.yml
File metadata and controls
175 lines (158 loc) · 6.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: Mutation Weekly
# Weekly mutation sweep over the enumerated decision kernels (issue #1415).
# Mutation score is the mechanical answer to "is this test load-bearing or
# decorative"; a full-suite sweep is unaffordable, so the scope is the kernel
# registry in scripts/mutation/modules.ts and nothing else.
#
# Sharded from the decision-kernel registry. Oversized sources are partitioned
# at syntax boundaries; the report job merges all required shards into one table.
#
# The lane reports and never gates (#1457): the per-kernel table lands in the job
# summary and the artifact, and a low score is an input for a human-authored
# test-strengthening PR (#1474, #1475 were written that way).
on:
schedule:
# Sundays 05:00 UTC — after the nightly lanes, before the working week.
- cron: '0 5 * * 0'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
shard:
name: Mutants (${{ matrix.name }})
runs-on: blacksmith-4vcpu-ubuntu-2404
# Bound setup and mutation separately, leaving headroom for evidence and upload.
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
# Kept in step with KERNEL_MODULES by the shard-coverage assertion in
# scripts/mutation/workflow.test.ts, which also pins --expect-shards to
# the number of entries here.
include:
- { name: kernel-errors-1, module: kernel-errors, shard: 1/5 }
- { name: kernel-errors-2, module: kernel-errors, shard: 2/5 }
- { name: kernel-errors-3, module: kernel-errors, shard: 3/5 }
- { name: kernel-errors-4, module: kernel-errors, shard: 4/5 }
- { name: kernel-errors-5, module: kernel-errors, shard: 5/5 }
- { name: daemon-ref-frame, module: daemon-ref-frame }
- { name: interaction-settle, module: interaction-settle }
- { name: scroll-edge-state, module: scroll-edge-state }
- { name: selectors-1, module: selectors, shard: 1/8 }
- { name: selectors-2, module: selectors, shard: 2/8 }
- { name: selectors-3, module: selectors, shard: 3/8 }
- { name: selectors-4, module: selectors, shard: 4/8 }
- { name: selectors-5, module: selectors, shard: 5/8 }
- { name: selectors-6, module: selectors, shard: 6/8 }
- { name: selectors-7, module: selectors, shard: 7/8 }
- { name: selectors-8, module: selectors, shard: 8/8 }
- { name: target-annotation-serde, module: target-annotation-serde }
- { name: snapshot-occlusion, module: snapshot-occlusion }
steps:
- name: Checkout
timeout-minutes: 1
uses: useblacksmith/checkout@2b9fe87d796feea153b455ec2f3125b471a7b0e7 # v1.8.2
- name: Setup toolchain
timeout-minutes: 2
uses: ./.github/actions/setup-node-pnpm
- name: Run mutants for ${{ matrix.name }}
timeout-minutes: 22
uses: ./.github/actions/run-gate
with:
gate: mutation
args: |
--modules
${{ matrix.module }}
${{ matrix.shard && '--shard' || '' }}
${{ matrix.shard || '' }}
# A shard can die before Stryker writes anything (install, config, crash);
# without this the artifact is absent and "shard failed" is indistinguishable
# from "lane never ran". --fail-envelope leaves a real verdict untouched.
- name: Record a failed shard envelope
if: failure() || cancelled()
run: |
pnpm gate mutation --modules ${{ matrix.module }} --fail-envelope \
"shard ${{ matrix.name }} failed before producing a report (run ${{ github.run_id }})" || true
- name: Upload shard report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: mutation-shard-${{ matrix.name }}
include-hidden-files: true
path: |
.tmp/mutation/mutation.json
.tmp/mutation/lane-envelope.json
if-no-files-found: warn
report:
name: Mutation score report
runs-on: blacksmith-4vcpu-ubuntu-2404
needs: shard
if: always()
timeout-minutes: 15
steps:
- name: Checkout
uses: useblacksmith/checkout@2b9fe87d796feea153b455ec2f3125b471a7b0e7 # v1.8.2
- name: Setup toolchain
uses: ./.github/actions/setup-node-pnpm
- name: Harness self-test
uses: ./.github/actions/run-gate
with: { gate: mutation-model }
- name: Download shard reports
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
pattern: mutation-shard-*
path: .tmp/mutation/shards
# run.ts writes the per-kernel score table to $GITHUB_STEP_SUMMARY when the
# runner exports it, so the summary and the artifact carry the same numbers.
# It publishes the table before judging the shard set, so even the one
# failure it can raise — an incomplete shard set — still reports the kernels
# that completed. A red lane here always means the sweep did not happen,
# never a low score.
- name: Score the merged sweep
uses: ./.github/actions/run-gate
with:
gate: mutation-check
args: |
--report-dir
.tmp/mutation/shards
--expect-shards
18
# The self-test and the artifact download both run before the scoring step,
# so a failure there would otherwise leave the aggregate lane with no envelope.
- name: Record a failed lane envelope
if: failure() || cancelled()
run: |
pnpm gate mutation --fail-envelope \
"weekly report job failed before producing a score table (run ${{ github.run_id }})" || true
# Freshness/drift telemetry (#1430): the envelope states commit, Stryker
# version, config hash, duration and result, so a lane going dark or a tool
# bump is visible without reading these logs.
- name: Lane envelope
if: always()
run: |
if [ ! -f .tmp/mutation/lane-envelope.json ]; then
echo 'No lane envelope was written — the job died before it could run node.' \
>> "$GITHUB_STEP_SUMMARY"
exit 0
fi
{
echo '<details><summary>Lane envelope (schema #1430)</summary>'
echo
echo '```json'
cat .tmp/mutation/lane-envelope.json
echo '```'
echo '</details>'
} >> "$GITHUB_STEP_SUMMARY"
- name: Upload mutation report
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: mutation-decision-kernels
include-hidden-files: true
path: |
.tmp/mutation/shards
.tmp/mutation/lane-envelope.json
if-no-files-found: warn