test(ci): harden TUI workspace reconciliation (#16033)

This commit is contained in:
jianyx1 authored and GitHub committed 2026-11-07 17:42:14 +08:00
1 parent 0acd2851cd
commit 222ca313e2
1 file changed
+14 -3
+14 -3
View File
@@ -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'),
),