From aabf14aaf99ca4b193b6104439ff150f41305659 Mon Sep 17 00:00:00 2001 From: openhands Date: Thu, 23 Jul 2026 19:14:47 +0200 Subject: [PATCH] Fix deploy workflow tests for PM2 --- src/lib/deploy-workflow-contract.test.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/lib/deploy-workflow-contract.test.ts b/src/lib/deploy-workflow-contract.test.ts index bc86ec2d..cbebee5b 100644 --- a/src/lib/deploy-workflow-contract.test.ts +++ b/src/lib/deploy-workflow-contract.test.ts @@ -49,13 +49,10 @@ describe("production deploy workflow", () => { expect(deployJob).toContain('mv "${STAGE}/node_modules" node_modules'); expect(deployJob).toContain("Rolling back .next to previous artifact"); const buildAt = deployJob.indexOf("pnpm build"); - const stopAt = deployJob.indexOf("sudo systemctl stop atom-nexst.service"); + const stopAt = deployJob.indexOf("pm2 stop next"); const migrateAt = deployJob.indexOf("pnpm db:migrate"); - const startLabelAt = deployJob.indexOf("Starting systemd service..."); - const startAt = deployJob.indexOf( - "sudo systemctl start atom-nexst.service", - startLabelAt, - ); + const startLabelAt = deployJob.indexOf("Starting PM2"); + const startAt = deployJob.indexOf("pm2 reload next", startLabelAt); expect(buildAt).toBeGreaterThan(-1); expect(stopAt).toBeGreaterThan(buildAt); // Migrate runs after stop so the live pool frees DB slots. @@ -89,7 +86,7 @@ describe("production deploy workflow", () => { it("runs an HTTP health check before declaring deploy success", () => { expect(workflow).toContain("/api/health"); expect(workflow).toContain('"database":true'); - const startAt = deployJob.indexOf("systemctl start atom-nexst.service"); + const startAt = deployJob.indexOf("pm2 reload next"); const healthAt = deployJob.indexOf("/api/health"); const successAt = deployJob.indexOf("--- Deployed successfully ---"); expect(startAt).toBeGreaterThan(-1);