Skip to content
Closed
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
27 changes: 26 additions & 1 deletion .github/scripts/ci-heavy-lanes.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const SUITE = {
'pr-a11y-specs': 'a11y',
'pr-a11y': 'a11y',
'visual-scout': 'visual',
'pr-visual': 'visual',
'pr-rtl-shard': 'rtl',
'pr-rtl-merge': 'rtl',
'pr-rtl': 'rtl',
Expand Down Expand Up @@ -57,6 +56,32 @@ describe('visual, accessibility and RTL owners', () => {
},
);

it('runs pr-visual on every pull request: its full check only with ci:run-visual, otherwise the default touched check', () => {
const visual = ci.jobs['pr-visual'];
const condition = ungated(visual.if);
expect(condition).toContain(
"(github.event_name == 'pull_request' &&\n needs.build-storybook.result == 'success')",
);
expect(visual.needs).toContain('run-labels');
const step = name =>
visual.steps.find(candidate => candidate.name === name);
expect(step('Run the visual gate for the touched components').if).toContain(
"needs.run-labels.outputs.visual == 'true'",
);
expect(step('Decide the default touched visual check').if).toContain(
"needs.run-labels.outputs.visual != 'true'",
);
const touched = step('Visual check for the default touched components');
expect(touched.if).toBe(
"steps.touched.outputs.has_components == 'true' && steps.touched.outputs.visual_components != ''",
);
expect(touched.run).toContain('gate.mjs check');
expect(touched.run).toContain('--tiers component');
expect(touched.run).toContain('--no-scout');
expect(touched.run).not.toContain('--dependents');
expect(touched.run).not.toContain('gate.mjs release');
});

it('decides the suites in one gate job from the trusted decision script', () => {
const gate = ci.jobs['run-labels'];
expect(gate['runs-on']).toBe('ubuntu-slim');
Expand Down
1 change: 1 addition & 0 deletions .github/scripts/ci-test-routing.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ describe('ci.yml RTL package sharding', () => {
'pr-rtl',
'pr-rtl-merge',
'pr-rtl-shard',
'pr-touched-components',
'pr-visual',
'visual-scout',
].sort(),
Expand Down
Loading
Loading