mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-08 22:03:59 +00:00
fix(ci): stabilize Windows startup fallback tests (#101223)
* test(windows): stabilize startup fallback fixtures * ci(windows): route daemon scheduler changes
This commit is contained in:
committed by
GitHub
parent
c5161f96ce
commit
dbba3d2a8e
@@ -47,6 +47,8 @@ const WINDOWS_SCOPE_RE =
|
||||
/^(src\/process\/|src\/infra\/windows-install-roots\.ts$|src\/shared\/(?:import-specifier|runtime-import)(?:\.test)?\.ts$|scripts\/(?:install\.ps1|(?:npm-runner|pnpm-runner|ui|vitest-process-group)\.(?:mjs|js)|lib\/format-generated-module\.mjs)$|test\/scripts\/(?:format-generated-module|install-ps1|npm-runner|pnpm-runner|ui|vitest-process-group)\.test\.ts$|package\.json$|pnpm-lock\.yaml$|pnpm-workspace\.yaml$|\.github\/workflows\/ci\.yml$|\.github\/actions\/setup-node-env\/action\.yml$|\.github\/actions\/setup-pnpm-store-cache\/action\.yml$)/;
|
||||
const WINDOWS_TEST_SCOPE_RE =
|
||||
/^(src\/process\/(?:exec\.windows|windows-command)\.test\.ts$|src\/infra\/windows-install-roots\.test\.ts$|src\/shared\/runtime-import\.test\.ts$|test\/scripts\/(?:format-generated-module|npm-runner|pnpm-runner|ui|vitest-process-group)\.test\.ts$)/;
|
||||
const WINDOWS_DAEMON_SCOPE_RE =
|
||||
/^src\/daemon\/(?:schtasks(?:[-.][^/]+)?|runtime-hints\.windows-paths(?:\.test)?|test-helpers\/schtasks-(?:base-mocks|fixtures))\.ts$/;
|
||||
const TEST_ONLY_PATH_RE =
|
||||
/(^test\/|\/test\/|\/tests\/|(?:^|\/)[^/]+\.(?:test|spec|test-utils|test-support|test-harness|e2e-harness)\.[cm]?[jt]sx?$)/;
|
||||
const CONTROL_UI_I18N_SCOPE_RE =
|
||||
@@ -132,8 +134,10 @@ export function detectChangedScope(changedPaths) {
|
||||
}
|
||||
|
||||
if (
|
||||
WINDOWS_SCOPE_RE.test(path) &&
|
||||
(!TEST_ONLY_PATH_RE.test(path) || WINDOWS_TEST_SCOPE_RE.test(path))
|
||||
(WINDOWS_SCOPE_RE.test(path) || WINDOWS_DAEMON_SCOPE_RE.test(path)) &&
|
||||
(!TEST_ONLY_PATH_RE.test(path) ||
|
||||
WINDOWS_TEST_SCOPE_RE.test(path) ||
|
||||
WINDOWS_DAEMON_SCOPE_RE.test(path))
|
||||
) {
|
||||
runWindows = true;
|
||||
}
|
||||
|
||||
@@ -326,6 +326,8 @@ function runningTaskQueryOutput() {
|
||||
|
||||
beforeEach(() => {
|
||||
resetSchtasksBaseMocks();
|
||||
// Keep generic lifecycle cases host-independent; Windows ownership cases opt in below.
|
||||
vi.spyOn(process, "platform", "get").mockReturnValue("linux");
|
||||
findVerifiedGatewayListenerPidsOnPortSync.mockReset();
|
||||
findVerifiedGatewayListenerPidsOnPortSync.mockReturnValue([]);
|
||||
inspectPortUsage.mockResolvedValue({
|
||||
|
||||
@@ -420,6 +420,24 @@ describe("detectChangedScope", () => {
|
||||
runChangedSmoke: false,
|
||||
runControlUiI18n: false,
|
||||
});
|
||||
for (const daemonPath of [
|
||||
"src/daemon/schtasks.ts",
|
||||
"src/daemon/schtasks-exec.ts",
|
||||
"src/daemon/schtasks.startup-fallback.test.ts",
|
||||
"src/daemon/runtime-hints.windows-paths.test.ts",
|
||||
"src/daemon/test-helpers/schtasks-fixtures.ts",
|
||||
]) {
|
||||
expect(detectChangedScope([daemonPath]), daemonPath).toEqual({
|
||||
runNode: true,
|
||||
runMacos: false,
|
||||
runIosBuild: false,
|
||||
runAndroid: false,
|
||||
runWindows: true,
|
||||
runSkillsPython: false,
|
||||
runChangedSmoke: false,
|
||||
runControlUiI18n: false,
|
||||
});
|
||||
}
|
||||
expect(detectChangedScope(["src/shared/runtime-import.ts"])).toEqual({
|
||||
runNode: true,
|
||||
runMacos: false,
|
||||
|
||||
Reference in New Issue
Block a user