From 51954f6f1bf30bb2120b009a47af2f1581d0b587 Mon Sep 17 00:00:00 2001 From: mudler-agent Date: Sun, 25 Oct 2026 08:56:29 +0100 Subject: [PATCH] test(addons): accept either refusal of an unlisted platform in the packaging contract (#12894) The spec "refuses a platform the matrix does not enable" ran package.sh with windows/amd64 and expected the text "not enabled". That text comes from the matrix check. The tool now refuses windows/amd64 earlier, in its format check, with: platform "windows/amd64" is not os/arch of linux or darwin on amd64 or arm64. The tool still fails and writes no layout, but the substring is gone, so the add-on packages run failed in validate package rules. The format check accepts only linux and darwin on amd64 and arm64, and Tables lists and enables all four of them. No platform passes the format check and is missing from the matrix, so the spec cannot reach the matrix refusal. Assert that the output names the refused platform and that it gives one of the refusal reasons of the tool. The not this host check stays as it was. Assisted-by: Claude:claude-sonnet-5-5 [Claude Code] Signed-off-by: Ettore Di Giacinto Co-authored-by: Ettore Di Giacinto --- tests/addons/packaging/packaging_test.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/addons/packaging/packaging_test.go b/tests/addons/packaging/packaging_test.go index 38da38648..70087fb96 100644 --- a/tests/addons/packaging/packaging_test.go +++ b/tests/addons/packaging/packaging_test.go @@ -284,12 +284,14 @@ var _ = Describe("first-party package", func() { }) It("refuses a platform the matrix does not enable and a missing executable of another platform", func() { - // Tables enables every platform the CI hosts run on, so the refused - // platform is one the matrix never lists. + // Tables enables every platform the tool accepts, so the refused + // platform is one the matrix never lists. The tool may refuse it in the + // format check or in the matrix check; both name the platform. layout := filepath.Join(GinkgoT().TempDir(), "leg") out, err := packageSh("--layout", layout, "--version", "1.0.0", "--platform", "windows/amd64", "--executable", binary) Expect(err).To(HaveOccurred(), out) - Expect(out).To(ContainSubstring("not enabled")) + Expect(out).To(ContainSubstring("windows/amd64")) + Expect(out).To(Or(ContainSubstring("not enabled"), ContainSubstring("is not os/arch of"), ContainSubstring("not in the platform matrix"))) Expect(layout).NotTo(BeADirectory()) other := "linux/arm64" if hostPlat == other {