Skip to content

Commit 8881b67

Browse files
committed
ci: the single-leg dispatch scales its time with repeat, drops a step a dispatch never reaches, and reads no pull requests
1 parent 8d9adf0 commit 8881b67

2 files changed

Lines changed: 15 additions & 18 deletions

File tree

‎.github/scripts/a11y-contract-shard-workflow.test.mjs‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ describe('the single contract-leg dispatch', () => {
3939
]);
4040
expect(workflow.permissions).toEqual({});
4141
expect(job.permissions).toEqual({contents: 'read'});
42-
expect(room.permissions).toEqual({
43-
actions: 'read',
44-
contents: 'read',
45-
'pull-requests': 'read',
46-
});
42+
expect(room.permissions).toEqual({actions: 'read', contents: 'read'});
4743
});
4844

4945
it('waits for room under the CI ceiling as a pull-request run does, so a main check or release re-check fits first', () => {
@@ -67,9 +63,9 @@ describe('the single contract-leg dispatch', () => {
6763
path: '.ci-admission',
6864
'persist-credentials': false,
6965
});
70-
expect(step('Stop when CI is full').if).toBe(
71-
"steps.room.outputs.full == 'true'",
72-
);
66+
// The action turns away only a pull-request run; a dispatch starts after
67+
// its longest wait, so no step reads `full`.
68+
expect(JSON.stringify(workflow)).not.toContain('outputs.full');
7369
// A standard runner: the wait outlasts a slim job's fifteen minutes.
7470
expect(room['runs-on']).toBe('ubuntu-latest');
7571
});
@@ -143,6 +139,12 @@ describe('the single contract-leg dispatch', () => {
143139
);
144140
});
145141

142+
it('gives each repeat of the leg its own time', () => {
143+
expect(job['timeout-minutes']).toBe(
144+
'${{ 20 + 13 * fromJSON(inputs.repeat) }}',
145+
);
146+
});
147+
146148
it("keeps the leg's Playwright results, passing or failing", () => {
147149
const keep = step("Keep the leg's Playwright results");
148150
expect(keep.if).toBe("always() && steps.contracts.outcome != 'skipped'");

‎.github/workflows/a11y-contract-shard.yml‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ concurrency:
3333
cancel-in-progress: false
3434

3535
jobs:
36-
# Waits for room under the CI ceiling like a pull-request run, so it yields
37-
# to a waiting main check or release re-check (spec:AST-030 FR16, DEC-16).
36+
# Waits for room under the CI ceiling, yielding to a waiting main check or
37+
# release re-check (spec:AST-030 FR16, DEC-16). After its longest wait it
38+
# starts, as every run that is not a pull request's does.
3839
room:
3940
runs-on: ubuntu-latest
4041
timeout-minutes: 130
4142
permissions:
4243
actions: read
4344
contents: read
44-
pull-requests: read
4545
steps:
4646
- name: Check the inputs
4747
env:
@@ -77,19 +77,14 @@ jobs:
7777
max-wait-minutes: 120
7878
max-looks: 30
7979

80-
- name: Stop when CI is full
81-
if: steps.room.outputs.full == 'true'
82-
run: |
83-
echo "::error title=CI is full::CI is full: dispatch again later. The run found no room under the CI ceiling."
84-
exit 1
85-
8680
shard:
8781
name: Accessibility spec-test contracts (${{ inputs.a11y-shard }}/6) at ${{ inputs.expected-head }}
8882
needs: [room]
8983
# A free standard runner: the same four vCPUs and 16 GB as the release
9084
# check's paid 4-core-ubuntu pool.
9185
runs-on: ubuntu-latest
92-
timeout-minutes: 60
86+
# About 12 minutes of tests a pass, after about 20 of install and build.
87+
timeout-minutes: ${{ 20 + 13 * fromJSON(inputs.repeat) }}
9388
permissions:
9489
contents: read
9590
steps:

0 commit comments

Comments
 (0)