Skip to content

Commit e8483ea

Browse files
committed
test: tighten plugin prerelease workflow assertions
1 parent 43ea5c3 commit e8483ea

1 file changed

Lines changed: 88 additions & 8 deletions

File tree

test/scripts/plugin-prerelease-test-plan.test.ts

Lines changed: 88 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,18 +223,86 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
223223
expect(workflow.jobs["checks-node-extensions-shard"]).toBeUndefined();
224224
expect(preflight.outputs).not.toHaveProperty("run_plugin_prerelease_suite");
225225
expect(preflight.outputs).not.toHaveProperty("run_checks_node_extensions");
226-
expect(staticShard).toMatchObject({
226+
expect(staticShard).toEqual({
227+
if: "needs.preflight.outputs.run_plugin_prerelease_static == 'true'",
227228
name: "${{ matrix.check_name }}",
229+
needs: ["preflight"],
230+
permissions: {
231+
contents: "read",
232+
},
228233
"runs-on": "blacksmith-8vcpu-ubuntu-2404",
234+
steps: [
235+
{
236+
name: "Checkout",
237+
uses: "actions/checkout@v6",
238+
with: {
239+
"fetch-depth": 1,
240+
"fetch-tags": false,
241+
"persist-credentials": false,
242+
ref: "${{ needs.preflight.outputs.checkout_revision }}",
243+
submodules: false,
244+
},
245+
},
246+
{
247+
name: "Setup Node environment",
248+
uses: "./.github/actions/setup-node-env",
249+
with: {
250+
"install-bun": "false",
251+
},
252+
},
253+
{
254+
env: {
255+
PLUGIN_PRERELEASE_COMMAND: "${{ matrix.command }}",
256+
PLUGIN_PRERELEASE_TASK: "${{ matrix.task }}",
257+
},
258+
name: "Run plugin prerelease static shard",
259+
run: [
260+
"set -euo pipefail",
261+
'echo "Running ${PLUGIN_PRERELEASE_TASK}: ${PLUGIN_PRERELEASE_COMMAND}"',
262+
'bash -c "$PLUGIN_PRERELEASE_COMMAND"',
263+
"",
264+
].join("\n"),
265+
shell: "bash",
266+
},
267+
],
268+
strategy: {
269+
"fail-fast": false,
270+
matrix: "${{ fromJson(needs.preflight.outputs.plugin_prerelease_static_matrix) }}",
271+
},
272+
"timeout-minutes": 45,
229273
});
230274
expect(workflow.on.workflow_dispatch.inputs.full_release_validation).toBeUndefined();
231-
expect(workflow.on.workflow_dispatch.inputs.include_android).toMatchObject({
275+
expect(workflow.on.workflow_dispatch.inputs.include_android).toEqual({
232276
default: false,
277+
description: "Run Android lanes for this manual CI dispatch.",
278+
required: false,
233279
type: "boolean",
234280
});
235-
expect(manifestEnv).toMatchObject({
281+
expect(manifestEnv).toEqual({
282+
OPENCLAW_CI_CHECKOUT_REVISION: "${{ steps.checkout_ref.outputs.sha }}",
283+
OPENCLAW_CI_DOCS_CHANGED:
284+
"${{ github.event_name == 'workflow_dispatch' && 'true' || steps.docs_scope.outputs.docs_changed }}",
285+
OPENCLAW_CI_DOCS_ONLY:
286+
"${{ github.event_name == 'workflow_dispatch' && 'false' || steps.docs_scope.outputs.docs_only }}",
287+
OPENCLAW_CI_REPOSITORY: "${{ github.repository }}",
236288
OPENCLAW_CI_RUN_ANDROID:
237289
"${{ github.event_name == 'workflow_dispatch' && inputs.include_android && 'true' || steps.changed_scope.outputs.run_android || 'false' }}",
290+
OPENCLAW_CI_RUN_CONTROL_UI_I18N:
291+
"${{ github.event_name == 'workflow_dispatch' && 'true' || steps.changed_scope.outputs.run_control_ui_i18n || 'false' }}",
292+
OPENCLAW_CI_RUN_MACOS:
293+
"${{ github.event_name == 'workflow_dispatch' && 'true' || steps.changed_scope.outputs.run_macos || 'false' }}",
294+
OPENCLAW_CI_RUN_NODE:
295+
"${{ github.event_name == 'workflow_dispatch' && 'true' || steps.changed_scope.outputs.run_node || 'false' }}",
296+
OPENCLAW_CI_RUN_NODE_FAST_CI_ROUTING:
297+
"${{ github.event_name == 'workflow_dispatch' && 'false' || steps.changed_scope.outputs.run_node_fast_ci_routing || 'false' }}",
298+
OPENCLAW_CI_RUN_NODE_FAST_ONLY:
299+
"${{ github.event_name == 'workflow_dispatch' && 'false' || steps.changed_scope.outputs.run_node_fast_only || 'false' }}",
300+
OPENCLAW_CI_RUN_NODE_FAST_PLUGIN_CONTRACTS:
301+
"${{ github.event_name == 'workflow_dispatch' && 'false' || steps.changed_scope.outputs.run_node_fast_plugin_contracts || 'false' }}",
302+
OPENCLAW_CI_RUN_SKILLS_PYTHON:
303+
"${{ github.event_name == 'workflow_dispatch' && 'true' || steps.changed_scope.outputs.run_skills_python || 'false' }}",
304+
OPENCLAW_CI_RUN_WINDOWS:
305+
"${{ github.event_name == 'workflow_dispatch' && 'true' || steps.changed_scope.outputs.run_windows || 'false' }}",
238306
});
239307
expect(manifestEnv).not.toHaveProperty("OPENCLAW_CI_FULL_RELEASE_VALIDATION");
240308
expect(manifestScript).toContain("includeReleaseOnlyPluginShards: false");
@@ -262,15 +330,20 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
262330
expect(pluginManifestScript).toContain(
263331
"Plugin prerelease plan unavailable in target ref; skipping static and Docker plugin prerelease lanes.",
264332
);
265-
expect(pluginWorkflow.on.workflow_dispatch.inputs.target_ref).toMatchObject({
333+
expect(pluginWorkflow.on.workflow_dispatch.inputs.target_ref).toEqual({
266334
default: "main",
335+
description: "Branch, tag, or full commit SHA to validate",
336+
required: false,
267337
type: "string",
268338
});
269-
expect(pluginWorkflow.on.workflow_dispatch.inputs.full_release_validation).toMatchObject({
339+
expect(pluginWorkflow.on.workflow_dispatch.inputs.full_release_validation).toEqual({
270340
default: false,
341+
description: "Enable release-only Docker prerelease lanes from Full Release Validation",
342+
required: false,
271343
type: "boolean",
272344
});
273-
expect(pluginManifestEnv).toMatchObject({
345+
expect(pluginManifestEnv).toEqual({
346+
EXPECTED_SHA: "${{ inputs.expected_sha }}",
274347
FULL_RELEASE_VALIDATION: "${{ inputs.full_release_validation && 'true' || 'false' }}",
275348
});
276349
expect(pluginManifestScript).toContain(
@@ -279,7 +352,7 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
279352
expect(pluginManifestScript).toContain(
280353
"const runDocker = fullReleaseValidation && dockerLanes.length > 0;",
281354
);
282-
expect(pluginPreflight.outputs).toMatchObject({
355+
expect(pluginPreflight.outputs).toEqual({
283356
checkout_revision: "${{ steps.manifest.outputs.checkout_revision }}",
284357
plugin_prerelease_docker_lanes:
285358
"${{ steps.manifest.outputs.plugin_prerelease_docker_lanes }}",
@@ -310,9 +383,16 @@ describe("scripts/lib/plugin-prerelease-test-plan.mjs", () => {
310383
expect(
311384
staticShard.steps.find((step) => step.name === "Run plugin prerelease static shard").run,
312385
).toContain('bash -c "$PLUGIN_PRERELEASE_COMMAND"');
313-
expect(dockerSuite).toMatchObject({
386+
expect(dockerSuite).toEqual({
314387
if: "${{ inputs.full_release_validation && needs.preflight.outputs.run_plugin_prerelease_docker == 'true' }}",
388+
name: "plugin-prerelease-docker-suite",
315389
needs: ["preflight"],
390+
permissions: {
391+
actions: "read",
392+
contents: "read",
393+
packages: "write",
394+
"pull-requests": "read",
395+
},
316396
uses: "./.github/workflows/openclaw-live-and-e2e-checks-reusable.yml",
317397
with: {
318398
docker_lanes: "${{ needs.preflight.outputs.plugin_prerelease_docker_lanes }}",

0 commit comments

Comments
 (0)