Skip to content

Build and test the wasm module in CI, on the Java 21 and Java 25 cases - #273

Merged
abashev merged 2 commits into
21.X.Xfrom
abashev/fix-wasm-test-cases-path
Nov 24, 2026
Merged

abashev merged 2 commits into
21.X.Xfrom
abashev/fix-wasm-test-cases-path

Conversation

@abashev

@abashev abashev commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Based on 21.X.X.

The release workflow's wasm job fails in wasmDifferentialTest: differential.mjs gets open-java-format/src/test/resources/test-cases, which no longer exists, and readdirSync throws ENOENT. The cases moved to test-cases-java21 in 970c348; FormatterCasesTest and RemoveUnusedImportsTest followed, but open-java-format-wasm/build.gradle did not, and nothing but the release builds that project (-Pwasm=true).

Changes

  • wasmDifferentialTest reads test-cases-java21 and test-cases-java25: 919 inputs. differential.mjs takes any number of case folders and names each input after its folder and file.
  • The runnable jar the module is compared with runs on the Oracle GraalVM 25 the module is built with, not on JDK 21, so that both parse with the same javac. The Java 28 cases stay out, since they need a newer javac than the module has.
  • CI gets a wasm job, after build, that runs wasmTest as the release's job does: Oracle GraalVM 25.0.4, Binaryen 133 and Node 24. It builds no zip and keeps nothing.
  • settings.gradle, the README and one comment in release.yml now say that CI builds the module too.

Checked

The jar side of differential.mjs was run locally on JDK 25 against both folders: it formats all 919 inputs and prints only lines that name one. The module side needs Oracle GraalVM and Binaryen, which the new wasm job of this pull request provides. actionlint and zizmor report nothing on ci.yml.

The test cases moved to test-cases-java21 in 970c348, but
wasmDifferentialTest still passed the old folder, so the release's
wasm job failed with ENOENT before comparing anything. The jar it
compares with runs on JDK 21, so the cases for JDK 21 are the ones.
Until now only the release built the module, so a change that broke it
showed in a release: the moved test-cases folder did. CI's new wasm job
runs wasmTest as the release's does, after build.

The differential test now runs the jar on the Oracle GraalVM 25 the
module is built with, rather than on JDK 21, so that both parse with
the same javac, and gives it the cases in test-cases-java25 as well as
those in test-cases-java21. differential.mjs takes any number of case
folders and names each input after its folder.
@abashev abashev changed the title Read the wasm differential test's cases from test-cases-java21 Build and test the wasm module in CI, on the Java 21 and Java 25 cases Nov 24, 2026
@abashev
abashev merged commit c2bd01c into 21.X.X Nov 24, 2026
17 checks passed
@abashev
abashev deleted the abashev/fix-wasm-test-cases-path branch November 24, 2026 16:25
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