Repository navigation
Resolve ignored tests and test map unit selection through MapRequest - #1478
Conversation
The runmapPurge_* tests in ModelManagerTests ran a test-local copy of MapRequest.purgeUnimportedFiles, which #1459 removed: runs and builds now select their units in MapRequest.compilationUnits and leave the editor model alone. The copy also removed units with removeIf on getModel(), which the model manager forbids. So the tests checked only themselves. Replace them with MapModelReuseTests cases that compile through the real run and build requests, on Jass and Lua: - an imported dependency package is compiled and an unimported one is not; - a dependency's war3map.j is not part of the map: a reference to it fails with "not included in this map compilation"; - the packages of an unimported dependency with a config override are not compiled, after the override cache was computed (the detached-package crash the old test guarded against). Each new case fails when the selection keeps every unit of the model.
Each was run before deciding. Deleted: - OptimizerTests.test_localVarMerger3 expects "call f(test_g)": a global read forwarded past an if which does not write it. #747 was closed without that optimisation ("would need a more precise analysis"), and the merger already folds the local into the unused parameter. - ClassesExtTests.testMultiTuple (never annotated) passes, but duplicates LuaBackendAuditTests.tupleMemberArrayAssignmentCapturesIndex, which covers a two-field tuple array field with whole-tuple equality on Jass, Lua and the interpreter. - RealWorldExamples.criggesInitOrder1 expects "not yet initialized", a message the compiler no longer has. The script is valid: its cycle is broken by an initlater import, and it compiles without errors. - RealWorldExamples.criggesInitOrder2 fails on printError, which the stdlib no longer has. With print instead it compiles cleanly: the "used before it is initialized" check is about class field initialisers, and the script has none. Its two scripts go with them. Fixed and enabled: - GenericsWithTypeclassesTests.normalFoldlInfer (#657) cast a new-generic T to int, which new generics forbid. Infer foldl's result type in an extension function of LinkedList<int> instead, where the closure's parameters are int and string. - GenericsWithTypeclassesTests.identityRecTypeCreation asserted the placeholder "some error message". Recursion at a growing type argument would need the specialisations C<A>, C<C<A>>, ... without end, and it is rejected with "Wrong parameter type when calling blub" (whether the type argument is explicit or inferred, on Jass and Lua). Assert that, with a new-generic C so the test does not mix the generic systems. Still ignored, with the actual failure as the reason: - GenericsWithTypeclassesTests.genericClassWithLLModule: #886 was closed without a fix. A new-generic class using the stdlib LinkedListModule type-checks, then EliminateGenerics fails at LinkedListModule.wurst:78 with "Generics should not contain type variables". A compiler bug, not a test problem.
Six test classes each read their emitted Lua through a private copy of the same helper; WurstScriptTest now has it once, named after the class. LuaTranslationTests cut a function body at the first "end" substring, so an identifier such as "append" or a nested block ended it early and a "must not contain" check saw only part of the function. A body now ends at the "end" indented like its "function" line. One test relied on the cut: genericOverrideChainBindsGlobalStateSlot... expected a single dispatch in FSM_update, but the function dispatches the global state and then the current state. It saw only the first, ended by its if. It now requires both to go through one slot.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67587a2109
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
uniqueMatches collapses equal slot names, so the test still passed if the global-state or the current-state dispatch disappeared. Count the dispatch call sites first, then require one slot for both.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Roll-up of #1475 to master. #1475 was stacked on #1473 and merged into
repo-cleanup-2026-10-16after #1473 had already been squash-merged, so its commits never reached master. These are the same three commits, cherry-picked onto current master without conflicts and with the same diff.Commits
Test map unit selection through MapRequest instead of a copy
The
runmapPurge_*tests inModelManagerTestsran a test-local copy ofMapRequest.purgeUnimportedFiles, which #1459 removed, and mutatedgetModel()directly. They are replaced byMapModelReuseTestscases that compile through the real run and build requests on Jass and Lua:war3map.jis not part of the map: a reference to it fails with "not included in this map compilation";Each new case fails when
MapRequest.compilationUnitskeeps every unit of the model.Resolve ignored and disabled tests
OptimizerTests.test_localVarMerger3: it expects an optimisation that Temp vars aren't merged properly anymore #747 closed without implementing.ClassesExtTests.testMultiTuple: it passes, butLuaBackendAuditTests.tupleMemberArrayAssignmentCapturesIndexalready covers it on Jass, Lua and the interpreter.RealWorldExamples.criggesInitOrder1/2and their scripts: one script is valid (its import cycle is broken byinitlater). The other used the removedprintError, and withprintit compiles cleanly. Neither expected message can come from either script.GenericsWithTypeclassesTests.normalFoldlInfer(improve generic type inference #657): it cast a new-generic value toint. It now infers through an extension ofLinkedList<int>.GenericsWithTypeclassesTests.identityRecTypeCreation: it asserted a placeholder. It now asserts that recursion at a growing type argument is rejected, since Jass would need endless specialisations.genericClassWithLLModuleignored, with the real failure as its reason. A new-generic class using the stdlibLinkedListModuletype-checks, thenEliminateGenericsfails atLinkedListModule.wurst:78("Generics should not contain type variables"). That is a compiler bug ("New generic" classes cannot use modules (at least specific ones) #886 was closed without a fix) and is left for its own change.Share compiledLua and bound LuaTranslationTests' function bodies
compiledLua(testName)inWurstScriptTestreplaces six private copies.LuaTranslationTestscut a function body at the firstendsubstring, so "must not contain" checks saw only part of a function. A body now ends at theendindented like itsfunctionline.genericOverrideChainBindsGlobalStateSlot...saw only the first ofFSM_update's two dispatches; it now requires both to use one slot.Validation
All 13 touched classes, 881 tests, pass on Windows on this master-based branch. Linux and macOS are unverified locally. The new tests use temp directories and only check that a path contains
dependencies.