fix: enforce dev report port lifecycle
This commit is contained in:
@@ -4,6 +4,11 @@ import { readFile } from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import {
|
||||
findForbiddenActiveDeprecatedEndpoints,
|
||||
REPORT_LIFECYCLE_VERSION
|
||||
} from "../internal/dev-report-lifecycle.mjs";
|
||||
|
||||
const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||
const reportPath = path.join(repoRoot, "reports/dev-gate/dev-m2-deploy-smoke-active.json");
|
||||
|
||||
@@ -26,10 +31,22 @@ function assertTimestamp(value, label) {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const report = JSON.parse(await readFile(reportPath, "utf8"));
|
||||
const raw = await readFile(reportPath, "utf8");
|
||||
const report = JSON.parse(raw);
|
||||
assertObject(report, "report");
|
||||
assert.equal(report.issue, "pikasTech/HWLAB#23");
|
||||
assert.equal(report.taskId, "m2-dev-deploy-smoke");
|
||||
assertObject(report.reportLifecycle, "reportLifecycle");
|
||||
assert.equal(report.reportLifecycle.version, REPORT_LIFECYCLE_VERSION);
|
||||
assert.equal(report.reportLifecycle.state, "active");
|
||||
assert.equal(report.reportLifecycle.activeEndpoint, "http://74.48.78.17:16667");
|
||||
assert.equal(report.reportLifecycle.activeBrowserEndpoint, "http://74.48.78.17:16666");
|
||||
assert.equal(report.reportLifecycle.deprecatedEndpoint, null);
|
||||
assert.deepEqual(
|
||||
findForbiddenActiveDeprecatedEndpoints(report, raw),
|
||||
[],
|
||||
"active M2 report must not present deprecated public ports as current endpoint evidence"
|
||||
);
|
||||
assert.equal(report.status, "pass");
|
||||
assert.equal(report.endpoint, "http://74.48.78.17:16667");
|
||||
assert.equal(report.frontendEndpoint, "http://74.48.78.17:16666");
|
||||
|
||||
Reference in New Issue
Block a user