Fix deploy workflow tests for PM2
This commit is contained in:
1 parent
9226558aa0
commit
aabf14aaf9
1 file changed
+4
-7
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user