ci: split install smoke fast path

This commit is contained in:
Peter Steinberger
2026-04-24 00:51:35 +01:00
parent 4ca5ef694f
commit 3a2f0e7a1a
7 changed files with 242 additions and 28 deletions

View File

@@ -5,7 +5,7 @@ import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import { bundledPluginFile } from "../../test/helpers/bundled-plugin-paths.js";
const { detectChangedScope, listChangedPaths } =
const { detectChangedScope, detectInstallSmokeScope, listChangedPaths } =
(await import("../../scripts/ci-changed-scope.mjs")) as unknown as {
detectChangedScope: (paths: string[]) => {
runNode: boolean;
@@ -16,6 +16,10 @@ const { detectChangedScope, listChangedPaths } =
runChangedSmoke: boolean;
runControlUiI18n: boolean;
};
detectInstallSmokeScope: (paths: string[]) => {
runFastInstallSmoke: boolean;
runFullInstallSmoke: boolean;
};
listChangedPaths: (base: string, head?: string) => string[];
};
@@ -319,7 +323,7 @@ describe("detectChangedScope", () => {
runAndroid: false,
runWindows: false,
runSkillsPython: false,
runChangedSmoke: true,
runChangedSmoke: false,
runControlUiI18n: false,
});
expect(detectChangedScope(["scripts/postinstall-bundled-plugins.mjs"])).toEqual({
@@ -351,7 +355,7 @@ describe("detectChangedScope", () => {
});
});
it("runs changed-smoke for Docker-covered core and extension runtime surfaces", () => {
it("runs changed-smoke for Docker-covered core runtime surfaces", () => {
expect(detectChangedScope(["src/plugins/loader.ts"])).toEqual({
runNode: true,
runMacos: false,
@@ -394,11 +398,42 @@ describe("detectChangedScope", () => {
runAndroid: false,
runWindows: false,
runSkillsPython: false,
runChangedSmoke: true,
runChangedSmoke: false,
runControlUiI18n: false,
});
});
it("splits install smoke into fast and full scopes", () => {
expect(detectInstallSmokeScope([])).toEqual({
runFastInstallSmoke: true,
runFullInstallSmoke: true,
});
expect(detectInstallSmokeScope(["docs/ci.md"])).toEqual({
runFastInstallSmoke: false,
runFullInstallSmoke: false,
});
expect(detectInstallSmokeScope(["scripts/install.sh"])).toEqual({
runFastInstallSmoke: true,
runFullInstallSmoke: true,
});
expect(detectInstallSmokeScope(["Dockerfile"])).toEqual({
runFastInstallSmoke: true,
runFullInstallSmoke: true,
});
expect(detectInstallSmokeScope([bundledPluginFile("matrix", "package.json")])).toEqual({
runFastInstallSmoke: true,
runFullInstallSmoke: false,
});
expect(detectInstallSmokeScope(["src/plugins/loader.ts"])).toEqual({
runFastInstallSmoke: true,
runFullInstallSmoke: false,
});
expect(detectInstallSmokeScope([bundledPluginFile("matrix", "index.ts")])).toEqual({
runFastInstallSmoke: false,
runFullInstallSmoke: false,
});
});
it("keeps changed-smoke off for runtime-surface tests", () => {
expect(detectChangedScope(["src/plugins/loader.test.ts"])).toEqual({
runNode: true,
@@ -483,6 +518,8 @@ describe("detectChangedScope", () => {
run_windows: "false",
run_skills_python: "false",
run_changed_smoke: "false",
run_fast_install_smoke: "false",
run_full_install_smoke: "false",
run_control_ui_i18n: "false",
});
});