From c8f6bc4fc2d548910dfdd3873f54bfaaa7725c50 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 1 Aug 2026 09:16:59 +0000 Subject: [PATCH] test(docker): gate the MPRv2 Build guard on Mendix >= 11.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nightly matrix runs integration tests against 10.24.19.104498, 11.6.6 and 11.12.0. TestBuild_PreservesMPRv2StorageFormat, added with the #808 fix, failed on the 10.24 row only: Build failed: portable app distribution requires Mendix >= 11.6.1, found 10.24.19.104498 10.24 is MPRv2 (v2 storage arrived in 10.18), so the test's storage-format precondition passed and it went on to call Build, which refuses below 11.6.1 before it ever reaches the update-widgets step the test is about. The failure is a property of the matrix row, not a regression in the fix. The 11.x rows are unaffected, which is why only one job went red. Adds the missing precondition. This is a real capability gate rather than a masked failure: there is no portable app distribution to protect on 10.x, and TestCheck_PreservesMPRv2StorageFormat has no version guard, so MPRv2 preservation is still covered on every matrix row — it passes on 10.24 today. Reproduced and verified against real MxBuild installs rather than reasoned about: only 10.24 cached, before -> FAIL (the exact CI error) only 10.24 cached, after -> SKIP, and Check still PASSes only 11.x cached, after -> PASS (39s — the test still genuinely runs) The last of those matters most: a version gate that silently disabled the test everywhere would be worse than the failure it fixes. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_012XR649rKk68z6gBpngu6MA --- cmd/mxcli/docker/build_integration_test.go | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/cmd/mxcli/docker/build_integration_test.go b/cmd/mxcli/docker/build_integration_test.go index 3eb8b28d7..84be562d6 100644 --- a/cmd/mxcli/docker/build_integration_test.go +++ b/cmd/mxcli/docker/build_integration_test.go @@ -12,6 +12,7 @@ import ( "testing" "github.com/mendixlabs/mxcli/sdk/mpr" + "github.com/mendixlabs/mxcli/sdk/mpr/version" ) // TestBuild_PreservesMPRv2StorageFormat is the end-to-end guard for @@ -55,6 +56,20 @@ func TestBuild_PreservesMPRv2StorageFormat(t *testing.T) { t.Skipf("scaffolded project is %v, not MPRv2 — nothing to protect", v) } + // Precondition: Build only supports Mendix >= 11.6.1 (portable app distribution); + // below that it refuses before reaching the update-widgets step this test is about. + // The nightly matrix includes 10.24, which is MPRv2 — so the format check above + // passes and Build then fails its own version guard, which is a property of the + // matrix row rather than a regression. + // + // This is a genuine capability gate, not a masked failure: there is no PAD build to + // protect on 10.x. The Check counterpart has no version guard and does run there, + // so MPRv2 preservation is still covered on every matrix row. + if pv := mprProductVersion(t, mprPath); !pv.IsAtLeastFull(11, 6, 1) { + t.Skipf("Build (portable app distribution) requires Mendix >= 11.6.1; scaffolded project is %s — "+ + "TestCheck_PreservesMPRv2StorageFormat covers this version", pv.ProductVersion) + } + var stdout bytes.Buffer if err := Build(BuildOptions{ ProjectPath: mprPath, @@ -73,3 +88,14 @@ func TestBuild_PreservesMPRv2StorageFormat(t *testing.T) { t.Errorf("mprcontents/ missing after Build, storage format was not preserved: %v", err) } } + +// mprProductVersion opens the .mpr and returns its Mendix product version. +func mprProductVersion(t *testing.T, mprPath string) *version.ProjectVersion { + t.Helper() + reader, err := mpr.Open(mprPath) + if err != nil { + t.Fatalf("mpr.Open(%s): %v", mprPath, err) + } + defer reader.Close() + return reader.ProjectVersion() +}