Skip to content

Run Wasm tests in workers as well - #552

Merged
newpavlov merged 3 commits into
rust-random:masterfrom
daxpedda:wasm-test-workers
Dec 2, 2024
Merged

newpavlov merged 3 commits into
rust-random:masterfrom
daxpedda:wasm-test-workers

Conversation

@daxpedda

@daxpedda daxpedda commented Nov 29, 2024 •

Copy link
Copy Markdown
Contributor

This change runs Wasm tests in workers as well.

Fixes #319.

@daxpedda
daxpedda force-pushed the wasm-test-workers branch 2 times, most recently from 7ce3c73 to 94f3621 Compare November 29, 2024 19:11
@daxpedda
daxpedda marked this pull request as draft November 29, 2024 19:16
@daxpedda

Copy link
Copy Markdown
Contributor Author

Apparently the Node.js was broken already. I unfortunately don't know enough about Node.js, locally it seems to work for me, so I'm going to do some tests with the CI.

@daxpedda
daxpedda force-pushed the wasm-test-workers branch 3 times, most recently from fce0241 to f03425f Compare November 29, 2024 19:23
web:
name: Web
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was required because the old Node.js version is incompatible with the latest Rust versions, which enabled reference types by default. See the blog post about it.

Alternatively I can also use the official GH action to install a newer version, let me know if you want me to do something here.

@daxpedda
daxpedda marked this pull request as ready for review November 29, 2024 19:28
Comment thread tests/mod.rs Resolved
@newpavlov
newpavlov merged commit c697b5c into rust-random:master Dec 2, 2024
takumi-earth pushed a commit to earthlings-dev/getrandom that referenced this pull request Jan 27, 2026
This change runs Wasm tests in workers as well.

- Fix Node tests not actually running any tests. It was already broken
because of an interaction with the latest Rust version and an old
Node.js version.
- Test dedicated, shared and service worker by using the newly added
environment variables: wasm-bindgen/wasm-bindgen#4295.
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.

Test that getrandom works correctly in a (service) worker in web environments.

2 participants