Skip to content

Conversation

PgBiel
Copy link
Contributor

@PgBiel PgBiel commented Aug 15, 2025

Runs wasm unit tests on CI. Browsers / exports not tested here yet.

Full details here https://typst.app/project/r314DoDea5XiYYr5bq5IFP
(I will summarize them here later)

P.S. I'll be organizing commits later, sorry for the mess :)

TODO:

  • Add command to check.sh
  • Test nothreads
  • Ignore parallel tests in nothreads
  • Ignore plugin test
  • Fix godot4-prebuilt templates assuming 64-bit architecture (instead of wasm 32-bit) leading to failing struct size assertions
  • Fix test_global_would_block test in global.rs when testing Wasm nothreads
  • Add to minimal-ci
  • Add to full-ci

@GodotRust
Copy link

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1275

@PgBiel PgBiel force-pushed the wasm-unit-tests branch 3 times, most recently from 8f3e5bd to 556bb1c Compare August 15, 2025 02:08
@Bromeon Bromeon force-pushed the master branch 2 times, most recently from 779c043 to ddc5b76 Compare August 18, 2025 19:16
Copy link
Member

@Bromeon Bromeon left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

I'll also rebase onto lastest master, to fix a CI issue that has been merged in the meantime.

Comment on lines +43 to +46
#[cfg_attr(
all(target_family = "wasm", not(target_feature = "atomics")),
ignore = "Threading not available"
)]
Copy link
Member

Choose a reason for hiding this comment

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

Might be worth a module to not annotate each individual test? 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, good idea!

./emsdk/emsdk install $EMSCRIPTEN_VERSION
./emsdk/emsdk activate $EMSCRIPTEN_VERSION
source ./emsdk/emsdk_env.sh
echo PATH=$PATH >> $GITHUB_ENV
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
echo PATH=$PATH >> $GITHUB_ENV
echo "PATH=$PATH" >> $GITHUB_ENV

I don't expect spaces, but these are a real pain to debug 😬

But apart from that, this just defines it with itself?
Should we not use GITHUB_PATH?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I didn't know about that variable. We should probably be using it.

Comment on lines +196 to +197
# More memory (256 MiB) is needed for the parallel godot-cell tests which
# spawn 70 threads each.
Copy link
Member

Choose a reason for hiding this comment

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

Good observation. Do you think this still makes sense, pushing the limits also on web?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's fine for what it's worth. We could consider reducing the tests a bit, but I'd rather get existing tests to work first.

Copy link
Contributor Author

@PgBiel PgBiel left a comment

Choose a reason for hiding this comment

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

Thanks for taking a look. I've been busy with other tasks lately, so sorry for the slow progress, but don't worry, we will get this through the finish line :)

./emsdk/emsdk install $EMSCRIPTEN_VERSION
./emsdk/emsdk activate $EMSCRIPTEN_VERSION
source ./emsdk/emsdk_env.sh
echo PATH=$PATH >> $GITHUB_ENV
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I didn't know about that variable. We should probably be using it.

Comment on lines +43 to +46
#[cfg_attr(
all(target_family = "wasm", not(target_feature = "atomics")),
ignore = "Threading not available"
)]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, good idea!

Comment on lines +196 to +197
# More memory (256 MiB) is needed for the parallel godot-cell tests which
# spawn 70 threads each.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's fine for what it's worth. We could consider reducing the tests a bit, but I'd rather get existing tests to work first.

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.

3 participants