Files
openclaw/test/scripts/docker-release-policy.test.ts
T
Peter Steinberger b376b13fec feat(docker): weekly refresh of published moving image tags (#123348)
* feat(docker): schedule image refreshes

* docs(docker): explain weekly image refreshes

* test(scripts): gate workflow-step execution on bash 4 mapfile support

Stock macOS bash 3.2 lacks mapfile; CI truth is Linux bash 5.

* test: cover docker-release suffix threading and sanctioned second caller

* test(codex): wire run-attempt-state into the attempt-extra project

#123345 added the file without a project owner; the full-suite coverage
guard fails for any PR that runs it.

* fix(ci): run build-artifacts PR validation on hosted runners

ci-build-artifacts-testbox.yml pinned PR runs to blacksmith-16vcpu and
ran Testbox lifecycle steps unconditionally, so the prepare-run landing
gate starved for every PR during a Blacksmith outage even with
OPENCLAW_CI_RUNNER_BACKEND=github. PR events now build on ubuntu-24.04
with dispatch-only Testbox steps, mirroring ci-check-testbox.yml.

* test(ci): align build-artifacts dispatch guard
2026-08-13 19:20:05 -07:00

74 lines
2.3 KiB
TypeScript

import { describe, expect, it } from "vitest";
import {
resolveCurrentDockerReleaseTags,
resolveDockerReleasePolicy,
} from "../../scripts/lib/docker-release-policy.mjs";
describe("Docker release policy", () => {
it("advances regular stable aliases only for final and correction patches below 33", () => {
for (const version of ["2026.7.1", "2026.7.1-2"]) {
expect(resolveDockerReleasePolicy(version)).toEqual({
version,
channel: "stable",
movingAliases: {
default: ["latest", "main"],
slim: ["slim", "main-slim"],
browser: ["latest-browser", "main-browser"],
},
});
}
});
it("keeps extended-stable releases on dedicated moving aliases", () => {
for (const version of ["2026.6.33", "2026.6.34", "2026.6.99"]) {
expect(resolveDockerReleasePolicy(version)).toEqual({
version,
channel: "extended-stable",
movingAliases: {
default: ["extended-stable"],
slim: ["extended-stable-slim"],
browser: ["extended-stable-browser"],
},
});
}
});
it("publishes beta versions without moving a channel alias", () => {
expect(resolveDockerReleasePolicy("2026.7.2-beta.3")).toEqual({
version: "2026.7.2-beta.3",
channel: "beta",
movingAliases: { default: [], slim: [], browser: [] },
});
});
it("resolves the newest stable and extended-stable tags independently", () => {
expect(
resolveCurrentDockerReleaseTags([
"v2026.6.34",
"v2026.7.1-2",
"v2026.6.33",
"v2026.8.1-beta.1",
"not-a-release-tag",
"v2026.7.1",
]),
).toEqual({
stable: { tag: "v2026.7.1-2", version: "2026.7.1-2" },
extendedStable: { tag: "v2026.6.34", version: "2026.6.34" },
});
});
it.each([
[["v2026.6.34"], "No stable Docker release tag found"],
[["v2026.7.1"], "No extended-stable Docker release tag found"],
])("requires both moving release channels when resolving refresh sources", (tags, error) => {
expect(() => resolveCurrentDockerReleaseTags(tags)).toThrow(error);
});
it.each(["2026.6.33-1", "2026.6.33-alpha.1", "2026.0.33", "not-a-version"])(
"rejects unsupported release version %s",
(version) => {
expect(() => resolveDockerReleasePolicy(version)).toThrow();
},
);
});