Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
+54
@@ -0,0 +1,54 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { parseBuildkitToml, verifyLoadedBuildkitConfig } from "./verify-deploy-buildkit-config.mjs";
|
||||
|
||||
const expected = `[history]
|
||||
maxAge = 86400
|
||||
maxEntries = 20
|
||||
|
||||
[worker.oci]
|
||||
gc = true
|
||||
reservedSpace = "2GB"
|
||||
maxUsedSpace = "30GB"
|
||||
minFreeSpace = "100GB"
|
||||
max-parallelism = 12
|
||||
`;
|
||||
|
||||
describe("verify-deploy-buildkit-config", () => {
|
||||
it("accepts Buildx-normalized ordering, quotes, and its empty parent section", () => {
|
||||
const actual = `[history]
|
||||
maxEntries = 20
|
||||
maxAge = 86400
|
||||
|
||||
[worker]
|
||||
[worker.oci]
|
||||
minFreeSpace = '100GB'
|
||||
gc = true
|
||||
maxUsedSpace = '30GB'
|
||||
reservedSpace = '2GB'
|
||||
max-parallelism = 12
|
||||
`;
|
||||
|
||||
expect(verifyLoadedBuildkitConfig(expected, actual)).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects a changed history bound", () => {
|
||||
expect(verifyLoadedBuildkitConfig(expected, expected.replace("maxEntries = 20", "maxEntries = 2000"))).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects a missing OCI cache bound", () => {
|
||||
expect(verifyLoadedBuildkitConfig(expected, expected.replace(' maxUsedSpace = "30GB"\n', ""))).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects an extra setting in a reviewed section", () => {
|
||||
expect(verifyLoadedBuildkitConfig(expected, expected.replace(" gc = true", " gc = true\n debug = true"))).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects an unexpected non-empty section", () => {
|
||||
expect(verifyLoadedBuildkitConfig(expected, `${expected}\n[registry.\"unsafe.example\"]\n insecure = true\n`)).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects duplicate keys instead of silently selecting one", () => {
|
||||
expect(() => parseBuildkitToml(expected.replace(" maxEntries = 20", " maxEntries = 20\n maxEntries = 21"))).toThrow("duplicate key history.maxEntries");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user