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

Allow overriding WASM_BINDGEN_TEST_ADDRESS #1

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mzyy94
Copy link
Owner

@mzyy94 mzyy94 commented Oct 3, 2024

When running the wasm-pack test in headless mode with WASM_BINDGEN_TEST_ADDRESS environment variable, the default address is set and the URL overriding does not work.

https://github.com/rustwasm/wasm-bindgen/blob/4765448545d7bfc0223fd52f25d966b0bfbf8004/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs#L247-L255

As a result, when the test was run with thses arguments, a different port was assigned than the specified in the WASM_BINDGEN_TEST_ADDRESS environment variable, and the test will not start forever.

$ WASM_BINDGEN_TEST_ADDRESS=http://localhost:3000  wasm-pack test --chrome --headless
[INFO]: 🎯  Checking for the Wasm target...
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.17s
[INFO]: ⬇️  Installing wasm-bindgen...
    Finished `test` profile [unoptimized + debuginfo] target(s) in 0.10s
     Running unittests src/lib.rs (target/wasm32-unknown-unknown/debug/deps/wasm_project-64358ea59372c309.wasm)
Set timeout to 20 seconds...
Running headless tests in Chrome on `http://127.0.0.1:50594/`
Try find `webdriver.json` for configure browser's capabilities:
Ok
Visiting http://localhost:3000/...

To solve this issue, I changed that the WASM_BINDGEN_TEST_ADDRESS environment variable is used when it is set, regardless of the headless mode.

Links:

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