Summary
Every mxcli test run injects a generated MxTest.TestRunner microflow, executes it, and then cleans up. The cleanup step (cleanup() in cmd/mxcli/testrunner/runner.go) drops the generated microflow but never drops the containing MxTest module, so an empty MxTest module permanently accumulates in the project — even when all tests pass.
Steps to reproduce
Using a fresh blank project (mxcli new, so no pre-existing project state is involved):
mxcli new MxTestRepro --version 11.12.0 --skip-init
cd MxTestRepro
cat > smoke.test.mdl << 'EOF'
/**
* @test Basic arithmetic sanity check
* @expect $result = 4
*/
DECLARE $result Integer = 2 + 2;
/
EOF
./mxcli test smoke.test.mdl -p MxTestRepro.mpr
Result: "All tests passed." Then:
./mxcli -c "SHOW MODULES" -p MxTestRepro.mpr
Shows an MxTest module with 0 entities/microflows/pages/etc. — left behind permanently.
Root cause
cmd/mxcli/testrunner/runner.go, in cleanup():
// Drop the test runner microflow
execMxcliCmd(projectPath, "DROP MICROFLOW MxTest.TestRunner")
This only removes the microflow, not the module that wraps it.
Suggested fix
DROP MODULE is already fully supported by the MDL grammar and model SDK (sdk/mpr/writer_modules.go's DeleteModuleWithCleanup). Replacing the line above with:
execMxcliCmd(projectPath, "DROP MODULE MxTest")
is sufficient — confirmed locally that DROP MODULE MxTest correctly removes the module (including the microflow) in one step.
Environment
- mxcli: built from
main @ ead892672f82fdc5f54ed8a944e98026845700a2 (2026-07-28)
- Mendix version: 11.12.0
- Reproduced on a throwaway blank project, not a production project
Summary
Every
mxcli testrun injects a generatedMxTest.TestRunnermicroflow, executes it, and then cleans up. The cleanup step (cleanup()incmd/mxcli/testrunner/runner.go) drops the generated microflow but never drops the containingMxTestmodule, so an emptyMxTestmodule permanently accumulates in the project — even when all tests pass.Steps to reproduce
Using a fresh blank project (
mxcli new, so no pre-existing project state is involved):Result: "All tests passed." Then:
./mxcli -c "SHOW MODULES" -p MxTestRepro.mprShows an
MxTestmodule with 0 entities/microflows/pages/etc. — left behind permanently.Root cause
cmd/mxcli/testrunner/runner.go, incleanup():This only removes the microflow, not the module that wraps it.
Suggested fix
DROP MODULEis already fully supported by the MDL grammar and model SDK (sdk/mpr/writer_modules.go'sDeleteModuleWithCleanup). Replacing the line above with:is sufficient — confirmed locally that
DROP MODULE MxTestcorrectly removes the module (including the microflow) in one step.Environment
main@ead892672f82fdc5f54ed8a944e98026845700a2(2026-07-28)