新增 release artifact URL workflow SDK gate
This commit is contained in:
@@ -113,6 +113,7 @@ SKIP_INTERP_BUILD=1 wasm-port/tests/wasm/node/verify_sim_configs_inventory_wasm.
|
||||
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_ini_panel_browser.sh
|
||||
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 wasm-port/tests/browser/verify_release_artifact_url_workflow_browser.sh
|
||||
wasm-port/tests/ui/node/verify_ui_node_smokes.sh
|
||||
wasm-port/tests/sdk/node/verify_project_release_artifact_url_workflow.sh
|
||||
wasm-port/tests/host/verify_host_smokes.sh
|
||||
```
|
||||
|
||||
@@ -151,6 +152,7 @@ opfs_session_docs_node_smoke=ok
|
||||
sim_configs_coverage_docs_node_smoke=ok
|
||||
host_runtime_boundary_docs_node_smoke=ok
|
||||
sdk_surface_node_smoke=ok
|
||||
project_release_artifact_url_workflow_node_smoke=ok
|
||||
```
|
||||
|
||||
The expected browser INI panel smoke outputs include:
|
||||
|
||||
@@ -252,6 +252,10 @@ action-plan output without executing release gates.
|
||||
`createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel()` turns the
|
||||
URL workflow result into stable dashboard status text and rows for ready,
|
||||
missing-input, fetch-failure, and artifact-validation-blocked states.
|
||||
`tests/sdk/node/verify_project_release_artifact_url_workflow.sh` is the
|
||||
dedicated executable SDK gate for that URL workflow. It verifies caller-provided
|
||||
fetch handling, ready summaries, missing input, HTTP failure, thrown fetch
|
||||
errors, and ends with `project_release_artifact_url_workflow_node_smoke=ok`.
|
||||
|
||||
## OPFS/session persistence exports
|
||||
|
||||
|
||||
@@ -57,8 +57,10 @@ for (const phrase of [
|
||||
"verify_project_release_gate.sh",
|
||||
"build/project-release-readiness.json",
|
||||
"verify_project_release_readiness_artifact.sh",
|
||||
"verify_project_release_artifact_url_workflow.sh",
|
||||
"host_wasm_opfs_browser_smokes=ok",
|
||||
"project_release_readiness_artifact_node_smoke=ok",
|
||||
"project_release_artifact_url_workflow_node_smoke=ok",
|
||||
"project_release_gate=ok",
|
||||
"sim_configs_wasm_node_inventory_unexpected_fail=0",
|
||||
"browser_ini_shell_integration_workflow_smoke=ok",
|
||||
@@ -91,6 +93,7 @@ for (const phrase of [
|
||||
"verify_host_smokes.sh",
|
||||
"write_project_release_readiness_artifact.mjs",
|
||||
"verify_project_release_readiness_artifact.sh",
|
||||
"verify_project_release_artifact_url_workflow.sh",
|
||||
"project_release_gate=ok",
|
||||
]) {
|
||||
assert.match(projectReleaseGateText, literalRegExp(phrase));
|
||||
@@ -123,6 +126,8 @@ for (const phrase of [
|
||||
"loadIniPanelShellWorkflowOverviewReleaseReadinessArtifactUrl()",
|
||||
"loadProjectReleaseReadinessArtifactUrlWorkflow()",
|
||||
"createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel()",
|
||||
"verify_project_release_artifact_url_workflow.sh",
|
||||
"project_release_artifact_url_workflow_node_smoke=ok",
|
||||
"build/project-release-readiness.json",
|
||||
"INI panel shell handoff exports",
|
||||
"createIniPanelShellApiSurfaceInventory()",
|
||||
|
||||
@@ -14,6 +14,7 @@ SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/wasm/node/verify_sim_configs_inventory_wasm
|
||||
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/browser/verify_ini_panel_browser.sh"
|
||||
SKIP_INI_BUILD=1 SKIP_INTERP_BUILD=1 "$ROOT_DIR/tests/browser/verify_release_artifact_url_workflow_browser.sh"
|
||||
"$ROOT_DIR/tests/ui/node/verify_ui_node_smokes.sh"
|
||||
"$ROOT_DIR/tests/sdk/node/verify_project_release_artifact_url_workflow.sh"
|
||||
"$ROOT_DIR/tests/host/verify_host_smokes.sh"
|
||||
|
||||
node "$ROOT_DIR/tests/host/write_project_release_readiness_artifact.mjs"
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
import {
|
||||
createProjectReleaseGateManifest,
|
||||
createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel,
|
||||
createProjectReleaseReadinessReport,
|
||||
loadProjectReleaseReadinessArtifactUrlWorkflow,
|
||||
} from "../../../runtime/sdk/src/index.js";
|
||||
|
||||
const manifest = createProjectReleaseGateManifest();
|
||||
const readyArtifactJson = JSON.stringify(createProjectReleaseReadinessReport({
|
||||
gateResults: Object.fromEntries(manifest.gateIds.map((id) => [id, true])),
|
||||
}));
|
||||
|
||||
let fetchedUrl = null;
|
||||
const readyWorkflow = await loadProjectReleaseReadinessArtifactUrlWorkflow({
|
||||
artifactUrl: "/project-release-readiness.json",
|
||||
fetchRef: async (url) => {
|
||||
fetchedUrl = url;
|
||||
return {
|
||||
ok: true,
|
||||
status: 200,
|
||||
text: async () => readyArtifactJson,
|
||||
};
|
||||
},
|
||||
});
|
||||
const readySummary = createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(readyWorkflow);
|
||||
|
||||
assert.equal(fetchedUrl, "/project-release-readiness.json");
|
||||
assert.equal(readyWorkflow.apiName, "project-release-readiness-artifact-url-workflow");
|
||||
assert.equal(readyWorkflow.workflowVersion, 1);
|
||||
assert.equal(readyWorkflow.ready, true);
|
||||
assert.equal(readyWorkflow.fetched, true);
|
||||
assert.equal(readyWorkflow.httpStatus, 200);
|
||||
assert.equal(readyWorkflow.fetchError, null);
|
||||
assert.equal(readyWorkflow.jsonWorkflow.ready, true);
|
||||
assert.equal(readyWorkflow.validation.ready, true);
|
||||
assert.equal(readyWorkflow.actionPlan.ready, true);
|
||||
assert.equal(readySummary.apiName, "project-release-readiness-artifact-url-workflow-summary-view-model");
|
||||
assert.equal(readySummary.statusLine, "Ready: Artifact URL workflow complete");
|
||||
assert.deepEqual(
|
||||
readySummary.rows.map(({ id, value }) => [id, value]),
|
||||
[
|
||||
["artifact-url", "/project-release-readiness.json"],
|
||||
["fetch", "ready (200)"],
|
||||
["json-workflow", "ready"],
|
||||
["artifact-validation", "ready"],
|
||||
["next-command", "none"],
|
||||
["missing", "none"],
|
||||
],
|
||||
);
|
||||
|
||||
const missingInputWorkflow = await loadProjectReleaseReadinessArtifactUrlWorkflow({
|
||||
artifactUrl: "",
|
||||
fetchRef: null,
|
||||
});
|
||||
const missingInputSummary = createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
missingInputWorkflow,
|
||||
);
|
||||
assert.equal(missingInputWorkflow.ready, false);
|
||||
assert.equal(missingInputWorkflow.fetched, false);
|
||||
assert.deepEqual(missingInputWorkflow.missing.slice(0, 2), ["artifact-url", "fetch"]);
|
||||
assert.match(missingInputSummary.statusLine, /^Blocked: artifact-url, fetch/);
|
||||
assert.equal(missingInputSummary.rows.find(({ id }) => id === "artifact-url")?.value, "missing");
|
||||
|
||||
const httpFailureWorkflow = await loadProjectReleaseReadinessArtifactUrlWorkflow({
|
||||
artifactUrl: "/missing.json",
|
||||
fetchRef: async () => ({
|
||||
ok: false,
|
||||
status: 404,
|
||||
text: async () => "",
|
||||
}),
|
||||
});
|
||||
const httpFailureSummary = createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
httpFailureWorkflow,
|
||||
);
|
||||
assert.equal(httpFailureWorkflow.ready, false);
|
||||
assert.equal(httpFailureWorkflow.fetched, false);
|
||||
assert.equal(httpFailureWorkflow.httpStatus, 404);
|
||||
assert.match(httpFailureWorkflow.fetchError, /404/);
|
||||
assert.equal(httpFailureWorkflow.missing[0], "artifact-fetch");
|
||||
assert.equal(
|
||||
httpFailureWorkflow.actionPlan.nextCommand,
|
||||
"wasm-port/tests/host/verify_project_release_gate.sh",
|
||||
);
|
||||
assert.match(httpFailureSummary.statusLine, /^Blocked: artifact-fetch/);
|
||||
assert.equal(httpFailureSummary.rows.find(({ id }) => id === "fetch")?.value, "blocked");
|
||||
|
||||
const thrownFetchWorkflow = await loadProjectReleaseReadinessArtifactUrlWorkflow({
|
||||
artifactUrl: "/throws.json",
|
||||
fetchRef: async () => {
|
||||
throw new Error("network unavailable");
|
||||
},
|
||||
});
|
||||
const thrownFetchSummary = createProjectReleaseReadinessArtifactUrlWorkflowSummaryViewModel(
|
||||
thrownFetchWorkflow,
|
||||
);
|
||||
assert.equal(thrownFetchWorkflow.ready, false);
|
||||
assert.equal(thrownFetchWorkflow.fetched, false);
|
||||
assert.equal(thrownFetchWorkflow.httpStatus, null);
|
||||
assert.equal(thrownFetchWorkflow.fetchError, "network unavailable");
|
||||
assert.equal(thrownFetchWorkflow.missing[0], "artifact-fetch");
|
||||
assert.match(thrownFetchSummary.statusLine, /^Blocked: artifact-fetch/);
|
||||
|
||||
console.log("project_release_artifact_url_workflow_node_smoke=ok");
|
||||
6
wasm-port/tests/sdk/node/verify_project_release_artifact_url_workflow.sh
Executable file
6
wasm-port/tests/sdk/node/verify_project_release_artifact_url_workflow.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
|
||||
node "$ROOT_DIR/tests/sdk/node/verify_project_release_artifact_url_workflow.mjs"
|
||||
@@ -5,3 +5,4 @@ ROOT_DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
|
||||
|
||||
node "$ROOT_DIR/tests/sdk/node/verify_sdk_surface.mjs"
|
||||
"$ROOT_DIR/tests/sdk/node/verify_project_release_gate_manifest.sh"
|
||||
"$ROOT_DIR/tests/sdk/node/verify_project_release_artifact_url_workflow.sh"
|
||||
|
||||
Reference in New Issue
Block a user