fix: wait for QuickStack deployment visibility
vadimenovikau/Platform-CI: Immutable QuickStack OCI deployment / Build once and deploy exact digest (push) Successful in 30s
Platform CI tests / QuickStack deploy action tests (pull_request) Successful in 22s
vadimenovikau/Platform-CI: Immutable QuickStack OCI deployment / Build once and deploy exact digest (pull_request) Successful in 21s

This commit is contained in:
2026-08-18 19:39:59 +02:00
parent c27dce00b3
commit d2a611aee6
2 changed files with 47 additions and 2 deletions
@@ -147,3 +147,35 @@ test("transient QuickStack deployment failures retry the desired immutable image
assert.equal(current.sourceType, "CONTAINER");
assert.equal(current.containerImageSource, image);
});
test("a newly created deployment may be briefly unavailable without triggering rollback", async () => {
let current = app();
let deployments = 0;
let lookups = 0;
const image = `gitea.example/owner/app@sha256:${"c".repeat(64)}`;
const client = {
getApp: async () => current,
saveApp: async (payload) => { current = { ...current, ...payload }; },
deployApp: async () => ({ deploymentId: `deployment-${++deployments}` }),
getDeployment: async (_appId, deploymentId) => {
lookups += 1;
if (lookups === 1) throw Object.assign(new Error("not visible"), { statusCode: 404 });
return { deploymentId, status: "DEPLOYED" };
},
};
const result = await deployExactImage({
client,
appId: "app-one",
image,
registryUsername: "deploy",
registryToken: "token",
sha: "3".repeat(40),
sleep: async () => {},
});
assert.equal(deployments, 1);
assert.equal(lookups, 2);
assert.equal(result.image, image);
assert.equal(current.sourceType, "CONTAINER");
});