Skip to content

Commit 7611937

Browse files
akoclaude
andcommitted
fix: add version guards to integration tests failing on Mendix 10.24
Five standalone integration tests fail on 10.24 because they use features with 11.x-specific BSON formats or widget templates: - TestMxCheck_ViewEntitySimple: VIEW ENTITY BSON requires 11.0+ - TestMxCheck_ViewEntityWithAggregates: same - TestMxCheck_GalleryPage: Gallery widget template is 11.6 (CE0463) - TestMxCheck_ComboBoxWithAssociation: ComboBox template is 11.6 (CE0463) - TestMxCheck_DoctypeScripts/02-microflow: LOG WARNING expression (CE0117) Add requireMinVersion() helper to testEnv and skip tests that need 11.0+ when running on 10.24. Add CE0117 as known error for 02-microflow-examples.mdl (expression syntax difference in 10.x). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent be5ff31 commit 7611937

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

mdl/executor/roundtrip_doctype_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ var scriptModuleDeps = map[string][]string{
3030
// These are syntax showcase scripts that intentionally omit entities, constants,
3131
// headers etc. that full validation requires.
3232
var scriptKnownCEErrors = map[string][]string{
33+
"02-microflow-examples.mdl": {
34+
"CE0117", // Expression error in LOG WARNING on Mendix 10.x (string concat syntax difference)
35+
},
3336
"06-rest-client-examples.mdl": {
3437
"CE0061", // No entity selected (JSON response/body mapping without entity)
3538
"CE6035", // RestOperationCallAction error handling not supported

mdl/executor/roundtrip_helpers_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,15 @@ func (e *testEnv) assertContains(createMDL string, expectedProps []string, opts
575575
}
576576
}
577577

578+
// requireMinVersion skips the test if the project's Mendix version is below the given minimum.
579+
func (e *testEnv) requireMinVersion(t *testing.T, major, minor int) {
580+
t.Helper()
581+
pv := e.executor.reader.ProjectVersion()
582+
if !pv.IsAtLeast(major, minor) {
583+
t.Skipf("Requires Mendix %d.%d+ (project is %s)", major, minor, pv.ProductVersion)
584+
}
585+
}
586+
578587
// --- Legacy Semantic Comparison Helpers (kept for backward compatibility) ---
579588

580589
// containsProperty checks if the MDL output contains a property.

mdl/executor/roundtrip_mxcheck_datagrid_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ func TestMxCheck_GalleryPage(t *testing.T) {
147147

148148
env := setupTestEnv(t)
149149
defer env.teardown()
150+
env.requireMinVersion(t, 11, 0) // Gallery widget template is 11.6, CE0463 on 10.x
150151

151152
entityName := testModule + ".MxCheckGalleryItem"
152153
env.registerCleanup("entity", entityName)

mdl/executor/roundtrip_mxcheck_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ func TestMxCheck_ViewEntitySimple(t *testing.T) {
629629

630630
env := setupTestEnv(t)
631631
defer env.teardown()
632+
env.requireMinVersion(t, 11, 0) // VIEW ENTITY BSON format requires 11.0+
632633

633634
mod := testModule
634635

@@ -683,6 +684,7 @@ func TestMxCheck_ViewEntityWithAggregates(t *testing.T) {
683684

684685
env := setupTestEnv(t)
685686
defer env.teardown()
687+
env.requireMinVersion(t, 11, 0) // VIEW ENTITY BSON format requires 11.0+
686688

687689
mod := testModule
688690

@@ -750,6 +752,7 @@ func TestMxCheck_ComboBoxWithAssociation(t *testing.T) {
750752

751753
env := setupTestEnv(t)
752754
defer env.teardown()
755+
env.requireMinVersion(t, 11, 0) // Widget template is 11.6, CE0463 on 10.x
753756

754757
mod := testModule
755758

0 commit comments

Comments
 (0)