Skip to content

Resolve ignored tests and test map unit selection through MapRequest - #1478

Merged
Frotty merged 4 commits into
masterfrom
claude/test-judgement-calls
Oct 17, 2026
Merged

Frotty merged 4 commits into
masterfrom
claude/test-judgement-calls

Conversation

@Frotty

@Frotty Frotty commented Oct 17, 2026

Copy link
Copy Markdown
Member

Roll-up of #1475 to master. #1475 was stacked on #1473 and merged into repo-cleanup-2026-10-16 after #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 in ModelManagerTests ran a test-local copy of MapRequest.purgeUnimportedFiles, which #1459 removed, and mutated getModel() directly. They are replaced by 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 MapRequest.compilationUnits keeps every unit of the model.

Resolve ignored and disabled tests

  • Deleted OptimizerTests.test_localVarMerger3: it expects an optimisation that Temp vars aren't merged properly anymore #747 closed without implementing.
  • Deleted ClassesExtTests.testMultiTuple: it passes, but LuaBackendAuditTests.tupleMemberArrayAssignmentCapturesIndex already covers it on Jass, Lua and the interpreter.
  • Deleted RealWorldExamples.criggesInitOrder1/2 and their scripts: one script is valid (its import cycle is broken by initlater). The other used the removed printError, and with print it compiles cleanly. Neither expected message can come from either script.
  • Fixed GenericsWithTypeclassesTests.normalFoldlInfer (improve generic type inference #657): it cast a new-generic value to int. It now infers through an extension of LinkedList<int>.
  • Fixed GenericsWithTypeclassesTests.identityRecTypeCreation: it asserted a placeholder. It now asserts that recursion at a growing type argument is rejected, since Jass would need endless specialisations.
  • Kept genericClassWithLLModule ignored, with the real failure as its reason. A new-generic class using the stdlib LinkedListModule type-checks, then EliminateGenerics fails at LinkedListModule.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

  • One compiledLua(testName) in WurstScriptTest replaces six private copies.
  • LuaTranslationTests cut a function body at the first end substring, so "must not contain" checks saw only part of a function. A body now ends at the end indented like its function line.
  • One test relied on the cut. genericOverrideChainBindsGlobalStateSlot... saw only the first of FSM_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.

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T08:43:46.703322Z f29bd08 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.
@Frotty

Frotty commented Oct 17, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f29bd088b9

ℹ️ 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".

@Frotty
Frotty merged commit 2f6aa9d into master Oct 17, 2026
2 checks passed
@Frotty
Frotty deleted the claude/test-judgement-calls branch November 25, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant