From 222ca313e2228b673e5a2e2f53410bd82fc77125 Mon Sep 17 00:00:00 2001 From: jianyx1 <166109249+jianyx1@users.noreply.github.com> Date: Sat, 7 Nov 2026 17:42:14 +0800 Subject: [PATCH] test(ci): harden TUI workspace reconciliation (#16033) --- scripts/tests/e2e-workflow.test.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/tests/e2e-workflow.test.js b/scripts/tests/e2e-workflow.test.js index 7059157b9bf..4815d0247b8 100644 --- a/scripts/tests/e2e-workflow.test.js +++ b/scripts/tests/e2e-workflow.test.js @@ -230,6 +230,8 @@ describe('TUI product evidence', () => { selected.includes('recovery'), ); } + if (selected.length === 0) + expect(outputs.reason).toBe('Outside the TUI build/test closure'); if (selected.length === 1) expect(outputs.reason).toContain( 'maintainers should consider manual full', @@ -637,11 +639,16 @@ describe('TUI product evidence', () => { const excludedTrees = (yamlText) => parse(yamlText) .packages.filter((entry) => entry.startsWith('!')) - .map((entry) => entry.slice(1)); + .map((entry) => entry.slice(1)) + .filter((tree) => !/[*?[\]{}]/.test(tree)); it('excludes every tree the pnpm workspace itself leaves out', async () => { const excluded = excludedTrees(readFileSync('pnpm-workspace.yaml', 'utf8')); - expect(excluded.length).toBeGreaterThan(0); + expect([...excluded].sort()).toEqual([ + 'packages/desktop', + 'packages/live-host', + 'packages/mobile-shell', + ]); for (const tree of excluded) { const { outputs } = await impact([ { filename: `${tree}/placeholder.ts` }, @@ -651,7 +658,7 @@ describe('TUI product evidence', () => { } }); - it('reconciles negations spelled with a trailing comment or another scope', () => { + it('reconciles literal negations across YAML spellings and ignores globs', () => { expect( excludedTrees( [ @@ -659,6 +666,10 @@ describe('TUI product evidence', () => { " - 'packages/*'", " - '!packages/desktop' # promoted to its own release later", " - '!integrations/generated-ui'", + " - '!**/fixtures/**'", + " - '!packages/fixture?'", + " - '!packages/[ab]'", + " - '!packages/{foo,bar}'", '', ].join('\n'), ),