diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aeb30f567514..c6a1f7c7eb30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1639,10 +1639,10 @@ jobs: ;; contracts-plugins-ci-routing) pnpm test:contracts:plugins - pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope.test.ts test/scripts/changed-lanes.test.ts test/scripts/ci-changed-node-test-plan.test.ts test/scripts/ci-run-node-test-shard.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts + pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope*.test.ts test/scripts/changed-lanes.test.ts test/scripts/ci-changed-node-test-plan.test.ts test/scripts/ci-run-node-test-shard.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts ;; ci-routing) - pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope.test.ts test/scripts/changed-lanes.test.ts test/scripts/ci-changed-node-test-plan.test.ts test/scripts/ci-run-node-test-shard.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts + pnpm test src/commands/status.scan-result.test.ts src/scripts/ci-changed-scope*.test.ts test/scripts/changed-lanes.test.ts test/scripts/ci-changed-node-test-plan.test.ts test/scripts/ci-run-node-test-shard.test.ts test/scripts/ci-workflow-guards.test.ts test/scripts/run-vitest.test.ts test/scripts/test-projects.test.ts ;; max-lines-ratchet) if ! has_package_script "check:max-lines-ratchet"; then diff --git a/scripts/ci-changed-scope.mjs b/scripts/ci-changed-scope.mjs index 6e2ac53a2b38..b37d639671a9 100644 --- a/scripts/ci-changed-scope.mjs +++ b/scripts/ci-changed-scope.mjs @@ -84,7 +84,7 @@ const FAST_INSTALL_SMOKE_RUNTIME_SCOPE_RE = const NODE_FAST_PLUGIN_CONTRACT_SCOPE_RE = /^src\/plugins\/contracts\/(?:inventory\/bundled-capability-metadata|registry|tts-contract-suites)\.ts$/; const NODE_FAST_CI_ROUTING_SCOPE_RE = - /^(scripts\/(?:ci-changed-scope|check-changed|run-vitest|test-projects(?:\.test-support)?)\.mjs$|scripts\/(?:test-projects\.test-support|lib\/(?:changed-path-facts|ci-changed-node-test-plan))\.d\.mts$|scripts\/lib\/(?:changed-path-facts|ci-changed-node-test-plan)\.mjs$|src\/commands\/status\.scan-result\.test\.ts$|src\/scripts\/ci-changed-scope\.test\.ts$|test\/scripts\/(?:changed-lanes|changed-path-facts|ci-changed-node-test-plan|run-vitest|test-projects)\.test\.ts$)/; + /^(scripts\/(?:ci-changed-scope|check-changed|run-vitest|test-projects(?:\.test-support)?)\.mjs$|scripts\/(?:test-projects\.test-support|lib\/(?:changed-path-facts|ci-changed-node-test-plan))\.d\.mts$|scripts\/lib\/(?:changed-path-facts|ci-changed-node-test-plan)\.mjs$|src\/commands\/status\.scan-result\.test\.ts$|src\/scripts\/ci-changed-scope(?:\.[^/]+)?\.test\.ts$|test\/scripts\/(?:changed-lanes|changed-path-facts|ci-changed-node-test-plan|run-vitest|test-projects)\.test\.ts$)/; const NODE_FAST_SCOPE_RE = new RegExp( `${NODE_FAST_PLUGIN_CONTRACT_SCOPE_RE.source}|${NODE_FAST_CI_ROUTING_SCOPE_RE.source}`, ); diff --git a/scripts/test-projects.test-support.mjs b/scripts/test-projects.test-support.mjs index 4deaf1fc56e6..afbf22da43db 100644 --- a/scripts/test-projects.test-support.mjs +++ b/scripts/test-projects.test-support.mjs @@ -1829,6 +1829,12 @@ const pluginPrerelease = "plugin-prerelease-test-plan"; const releaseCheck = "test/release-check.test.ts"; const installDocker = "test-install-sh-docker"; const changedScope = "src/scripts/ci-changed-scope.test.ts"; +const changedScopeTests = [ + "src/scripts/ci-changed-scope.control-ui.test.ts", + "src/scripts/ci-changed-scope.native-i18n.test.ts", + changedScope, + "src/scripts/ci-changed-scope.windows.test.ts", +]; const dockerCache = "src/docker-build-cache.test.ts"; const dockerDigests = "src/docker-image-digests.test.ts"; const openaiChatToolsE2e = "test/e2e/qa-lab/runtime/openai-compatible-chat-tools.e2e.test.ts"; @@ -2092,7 +2098,7 @@ const SEMANTIC_TOOLING_TARGET_PATTERNS = [ [/^\.github\/actions\/ensure-base-commit\/action\.yml$/u, [workflowGuards]], [/^tsconfig\.scripts\.json$/u, ["changed-lanes", "test-projects"]], [/^scripts\/test-projects\.test-support\.mjs$/u, ["test-projects"]], - [/^scripts\/ci-changed-scope\.mjs$/u, [changedScope, "control-ui-i18n"]], + [/^scripts\/ci-changed-scope\.mjs$/u, [...changedScopeTests, "control-ui-i18n"]], [/^scripts\/check-changed\.mjs$/u, ["changed-lanes"]], [ new RegExp( diff --git a/src/scripts/ci-changed-scope.test.ts b/src/scripts/ci-changed-scope.test.ts index 1cd482b5cd38..c1b8f64dc428 100644 --- a/src/scripts/ci-changed-scope.test.ts +++ b/src/scripts/ci-changed-scope.test.ts @@ -899,7 +899,10 @@ describe("detectChangedScope", () => { "scripts/run-vitest.mjs", "scripts/test-projects.test-support.d.mts", "src/commands/status.scan-result.test.ts", + "src/scripts/ci-changed-scope.control-ui.test.ts", + "src/scripts/ci-changed-scope.native-i18n.test.ts", "src/scripts/ci-changed-scope.test.ts", + "src/scripts/ci-changed-scope.windows.test.ts", "test/scripts/changed-lanes.test.ts", "test/scripts/run-vitest.test.ts", "test/scripts/test-projects.test.ts", diff --git a/test/scripts/ci-workflow-guards.test.ts b/test/scripts/ci-workflow-guards.test.ts index 77acbca74eee..9a42cbf2198d 100644 --- a/test/scripts/ci-workflow-guards.test.ts +++ b/test/scripts/ci-workflow-guards.test.ts @@ -6463,6 +6463,7 @@ printf '%s\n' "\${CURL_SUCCESS_IP:-203.0.113.7}" path: ".artifacts/qa-e2e/smoke-ci-profile-${{ matrix.slug }}/", "if-no-files-found": "warn", }); + expect(runStep.run.match(/src\/scripts\/ci-changed-scope\*\.test\.ts/g)).toHaveLength(2); expect(runStep.run.match(/test\/scripts\/ci-workflow-guards\.test\.ts/g)?.length).toBe(2); expect(runStep.run.match(/test\/scripts\/ci-changed-node-test-plan\.test\.ts/g)?.length).toBe( 2, diff --git a/test/scripts/test-projects.test.ts b/test/scripts/test-projects.test.ts index 8d5ae4a6e17b..47728763cc0f 100644 --- a/test/scripts/test-projects.test.ts +++ b/test/scripts/test-projects.test.ts @@ -1302,9 +1302,14 @@ describe("scripts/test-projects changed-target routing", () => { }); it("keeps CI, dependency, and docs tooling edits on owner tests", () => { + const changedScopeTestFamily = fs + .readdirSync("src/scripts") + .filter((file) => /^ci-changed-scope(?:\.[^/]+)?\.test\.ts$/u.test(file)) + .map((file) => `src/scripts/${file}`) + .toSorted((left, right) => left.localeCompare(right)); expectChangedTargets( ["scripts/ci-changed-scope.mjs"], - ["src/scripts/ci-changed-scope.test.ts", "test/scripts/control-ui-i18n.test.ts"], + [...changedScopeTestFamily, "test/scripts/control-ui-i18n.test.ts"], ); expectChangedTargets(