Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental coverage feature breaks stable browser test #4083

Closed
cdata opened this issue Aug 20, 2024 · 3 comments
Closed

Experimental coverage feature breaks stable browser test #4083

cdata opened this issue Aug 20, 2024 · 3 comments
Labels

Comments

@cdata
Copy link

cdata commented Aug 20, 2024

Describe the Bug

When building a trivial test against wasm-bindgen@0.2.93 and running it using wasm-bindgen-test, the browser-side test harness throws an exception as it tries to call into an experimental test coverage feature (causing the test runner to time out). The same test runs to completion when built against wasm-bindgen@0.2.92 and run the same way.

Steps to Reproduce

Using the following trivial test suite:

use wasm_bindgen_test::wasm_bindgen_test;
use wasm_bindgen_test::wasm_bindgen_test_configure;

wasm_bindgen_test_configure!(run_in_browser);

#[wasm_bindgen_test]
fn it_runs_a_test() {
    assert!(true)
}
  1. Depend on wasm-bindgen at version 0.2.93
  2. Install wasm-bindgen-cli at version 0.2.93
  3. Install the appropriate chromedriver for the local version of Chrome
  4. Run the above test with NO_HEADLESS=true CHROMEDRIVER=which chromedriver cargo test --target wasm32-unknown-unknown
  5. Open http://127.0.0.1:8000 and refer to the error in the dev tools console

Expected Behavior

The test passes; when run headlessly, the CLI output reflects the passing state.

Actual Behavior

The test never runs; when run headlessly, the CLI times out.

Additional Context

This error appears in the browser console when building against wasm-bindgen@0.2.93:

Uncaught SyntaxError: The requested module './wasm-bindgen-test' does not provide an export named '__wbgtest_cov_dump
@cdata cdata added the bug label Aug 20, 2024
@schell
Copy link

schell commented Aug 20, 2024

I've just hit this as well.

@daxpedda
Copy link
Collaborator

The issue is that you also need to update your wasm-bindgen-test dependency to v0.3.43.

This is a bit unfortunate and I'm not entirely sure how to prevent this in the future apart from pinning all dependencies on each other ...

Let me know if this doesn't solve your problem!

@cdata
Copy link
Author

cdata commented Aug 20, 2024

Thanks for the second time in 24 hours @daxpedda updating my wasm-bindgen-test crate to 0.3.43 seems to have fixed the issue.

WorldSEnder added a commit to langyo/yew that referenced this issue Aug 21, 2024
ranile added a commit to yewstack/yew that referenced this issue Oct 21, 2024
* Try to add wasi feature to avoid browser's ABI.

* Add async render for single-threaded env.

* Temporarily enable my own patch branch.
It would be modified later
after the corresponding library branches are merged.

* add example for WASI SSR.

* Ready to run WASI on wasmtime.

* complete the example

* fix fmt

* fix fmt

* I made a mistake..sry

* add yew-router suites for demo

* fix typo

* Make the async render stream function public

* Use target_os instead of feature.

* Renew gloo-history's patch.

* Exclude WASI example to avoid web-sys.

* Try to add CI for WASI example.

* Fix CI.

* Fix CI that requires compiler 1.67 or newer.

* Use CLI's flag instead of exclude example.
bytecodealliance/wasmtime#4312

* Remove patchs.

* Use LocalServerRenderer instead of ServerRenderer.
yewstack/tokise#11 (comment)

* Remove unused exports.

* Add description about `LocalServerRenderer`.

* fix fmt

* fix fmt

* Update Cargo.lock

* Bump rust compiler's version to 1.67...

* Exclude WASI on yew-router browser interfaces.

* fix fmt

* Wait for gloo's PR dealed.

* Rollback to rust compiler 1.64.
cc rustwasm/gloo#423 (comment)

* Fix lock file.

* Downgrade `toml_datetime` version.

* Fix enum for `gloo-history`.

* Well, it seems there is no way to avoid the MSRV upgrade....

* fix: Replace feature = "wasi" to target_os = "wasi".

* Remove tips for rust version.

* Bump `gloo` to 0.11.

* Try to test yew-macro on compiler 1.67.

* Try to use compiler 1.68 instead.

* Try to use compiler 1.69 instead......

* Revert MSRV back

* Pin the oldest Cargo.lock.

* Downgrade deps for MSRV.

* Bump benchmark tool's tokio to 1.35

* Try to write WASI CI.

* Rollback the quotes

* Combine CI files...

* Rollback the use that gloo-history has fixed it.

* fix

* Bump gloo-history version.

* Block raw html update tests on WASI.

* Rollback indexmap's version.

* fix CI

* fix CI

* Update some SSR test suites that replace ServerRender instead of LocalServerRender.

* Remove yew-router's cfg macro

* Fix fmt

* Try to fix CI

* Update examples/wasi_ssr_module/README.md

Co-authored-by: Elina <imelina@elina.website>

* Revert back some unnecessary changes.

* Clippy

* fmt

* Fix CI.

* Fix CI.

* Try to fix clippy.

* Fix `ToString` trait.

* Remove pin version of WASI CI test.

* Pin the newer version.

* Fix typo.

* Bump `wasm-bindgen`.

* Fix SSR example.

* Fix typo.

* Try to support non-browser environments.

* Update wasm-bindgen-test to 0.3.43

refer to rustwasm/wasm-bindgen#4083

* fix doc test running on nightly

* Update website/docs/advanced-topics/server-side-rendering.md

Co-authored-by: WorldSEnder <WorldSEnder@users.noreply.github.com>

* Update WASI CI.

* Remove WASI test for rustc 1.76.

* Try to let `wasmtime` CLI can be executed.

* Limit the function `decode_base64` that it shouldn't runnable in non-browser environment.

* Remove WASI example test for rustc 1.76.

* Revert changes.

* Fix CI

* Fix Cargo.lock

* Remove unused deps

* Undo the formatting changes.

* Undo the formatting changes.

---------

Co-authored-by: Elina <imelina@elina.website>
Co-authored-by: Martin Molzer <WorldSEnder@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants