Skip to content

Commit 0a4b301

Browse files
committed
fix(ci): time packaged fresh release phases
1 parent 37a9f58 commit 0a4b301

2 files changed

Lines changed: 77 additions & 52 deletions

File tree

‎scripts/openclaw-cross-os-release-checks.ts‎

Lines changed: 65 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -786,78 +786,90 @@ async function runFreshLane(params) {
786786
const cleanup = [];
787787
try {
788788
const env = buildLaneEnv(lane, params.providerConfig, params.providerSecretValue);
789-
logLanePhase(lane, "install-candidate");
790-
await installTarballPackage({
791-
lane,
792-
env,
793-
tgzPath: params.build.candidateTgz,
794-
logPath: join(params.logsDir, "fresh-install.log"),
795-
restoreBundledPluginPostinstall: false,
789+
await runTimedLanePhase(lane, "install-candidate", async () => {
790+
await installTarballPackage({
791+
lane,
792+
env,
793+
tgzPath: params.build.candidateTgz,
794+
logPath: join(params.logsDir, "fresh-install.log"),
795+
restoreBundledPluginPostinstall: false,
796+
});
796797
});
797798
const installed = readInstalledMetadata(lane.prefixDir);
798799
verifyInstalledCandidate(installed, params.build);
799-
logLanePhase(lane, "run-bundled-plugin-postinstall");
800-
await runBundledPluginPostinstall({
801-
lane,
802-
env,
803-
logPath: join(params.logsDir, "fresh-install.log"),
800+
await runTimedLanePhase(lane, "run-bundled-plugin-postinstall", async () => {
801+
await runBundledPluginPostinstall({
802+
lane,
803+
env,
804+
logPath: join(params.logsDir, "fresh-install.log"),
805+
});
804806
});
805807

806808
let browserOverrideImportStatus = "skipped";
807809
if (shouldRunWindowsInstalledBrowserOverrideImportSmoke()) {
808-
logLanePhase(lane, "windows-browser-override-import");
809-
browserOverrideImportStatus = await runInstalledBrowserOverrideImportSmoke({
810+
browserOverrideImportStatus = await runTimedLanePhase(
810811
lane,
811-
env,
812-
prefixDir: lane.prefixDir,
813-
logPath: join(params.logsDir, "fresh-windows-browser-override-import.log"),
814-
});
812+
"windows-browser-override-import",
813+
async () =>
814+
runInstalledBrowserOverrideImportSmoke({
815+
lane,
816+
env,
817+
prefixDir: lane.prefixDir,
818+
logPath: join(params.logsDir, "fresh-windows-browser-override-import.log"),
819+
}),
820+
);
815821
}
816822

817-
logLanePhase(lane, "onboard");
818-
await runOnboard({
819-
lane,
820-
env,
821-
providerConfig: params.providerConfig,
822-
logPath: join(params.logsDir, "fresh-onboard.log"),
823+
await runTimedLanePhase(lane, "onboard", async () => {
824+
await runOnboard({
825+
lane,
826+
env,
827+
providerConfig: params.providerConfig,
828+
logPath: join(params.logsDir, "fresh-onboard.log"),
829+
});
823830
});
824831

825-
logLanePhase(lane, "models-set");
826-
await runModelsSet({
827-
lane,
828-
env,
829-
providerConfig: params.providerConfig,
830-
logPath: join(params.logsDir, "fresh-models-set.log"),
832+
await runTimedLanePhase(lane, "models-set", async () => {
833+
await runModelsSet({
834+
lane,
835+
env,
836+
providerConfig: params.providerConfig,
837+
logPath: join(params.logsDir, "fresh-models-set.log"),
838+
});
831839
});
832840

833-
logLanePhase(lane, "start-gateway");
834-
const gateway = await startGateway({
835-
lane,
836-
env,
837-
logPath: join(params.logsDir, "fresh-gateway.log"),
838-
});
841+
const gateway = await runTimedLanePhase(lane, "start-gateway", async () =>
842+
startGateway({
843+
lane,
844+
env,
845+
logPath: join(params.logsDir, "fresh-gateway.log"),
846+
}),
847+
);
839848
cleanup.push(() => stopGateway(gateway));
840849

841-
logLanePhase(lane, "wait-gateway");
842-
await waitForGateway({
843-
lane,
844-
env,
845-
logPath: join(params.logsDir, "fresh-gateway-status.log"),
850+
await runTimedLanePhase(lane, "wait-gateway", async () => {
851+
await waitForGateway({
852+
lane,
853+
env,
854+
logPath: join(params.logsDir, "fresh-gateway-status.log"),
855+
});
846856
});
847857

848-
logLanePhase(lane, "dashboard");
849-
await runDashboardSmoke({
850-
lane,
851-
logPath: join(params.logsDir, "fresh-dashboard.log"),
858+
await runTimedLanePhase(lane, "dashboard", async () => {
859+
await runDashboardSmoke({
860+
lane,
861+
logPath: join(params.logsDir, "fresh-dashboard.log"),
862+
});
852863
});
853864

854-
logLanePhase(lane, "agent-turn");
855-
const agent = await runAgentTurn({
856-
lane,
857-
env,
858-
label: "fresh",
859-
logPath: join(params.logsDir, "fresh-agent.log"),
860-
});
865+
const agent = await runTimedLanePhase(lane, "agent-turn", async () =>
866+
runAgentTurn({
867+
lane,
868+
env,
869+
label: "fresh",
870+
logPath: join(params.logsDir, "fresh-agent.log"),
871+
}),
872+
);
861873

862874
return {
863875
status: "pass",
@@ -867,6 +879,7 @@ async function runFreshLane(params) {
867879
gatewayPort: lane.gatewayPort,
868880
browserOverrideImportStatus,
869881
agentOutput: trimForSummary(agent.stdout),
882+
phaseTimings: lane.phaseTimings,
870883
};
871884
} finally {
872885
await runCleanup(cleanup);

‎test/scripts/openclaw-cross-os-release-checks.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ describe("scripts/openclaw-cross-os-release-checks", () => {
107107
expect(CROSS_OS_COMMAND_HEARTBEAT_SECONDS).toBeLessThanOrEqual(60);
108108
});
109109

110+
it("records packaged-fresh phase timings for release-check summaries", () => {
111+
const source = readFileSync("scripts/openclaw-cross-os-release-checks.ts", "utf8");
112+
const freshLaneSource = source.slice(
113+
source.indexOf("async function runFreshLane"),
114+
source.indexOf("async function runUpgradeLane"),
115+
);
116+
117+
expect(freshLaneSource).toContain('runTimedLanePhase(lane, "install-candidate"');
118+
expect(freshLaneSource).toContain('runTimedLanePhase(lane, "agent-turn"');
119+
expect(freshLaneSource).toContain("phaseTimings: lane.phaseTimings");
120+
});
121+
110122
it("accepts OK agent output from the captured log when stdout is empty", () => {
111123
const dir = mkdtempSync(join(tmpdir(), "openclaw-cross-os-agent-output-"));
112124
try {

0 commit comments

Comments
 (0)