Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Cannot run the test in game-of-life tutorial with --chrome --headless #3701

Closed
inomata137 opened this issue Nov 11, 2023 · 0 comments
Closed
Labels

Comments

@inomata137
Copy link

Describe the Bug

I've just started studying wasm recently.
While doing the game-of-life tutorial, I couldn't run the test in it.
It might be related with #2261, but even a test with chrome doesn't run successfully.

Steps to Reproduce

  1. git clone https://github.com/rustwasm/wasm_game_of_life.git
  2. cd wasm_game_of_life
  3. wasm-pack test --chrome --headless

Expected Behavior

The test runs successfully.

Actual Behavior

$ wasm-pack test --chrome --headless
[INFO]: 🎯  Checking for the Wasm target...
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
[INFO]: ⬇️  Installing wasm-bindgen...
    Finished test [unoptimized + debuginfo] target(s) in 0.01s
     Running unittests src/lib.rs (target/wasm32-unknown-unknown/debug/deps/wasm_game_of_life-cd2c1547b9d103b1.wasm)
no tests to run!
     Running tests/web.rs (target/wasm32-unknown-unknown/debug/deps/web-2a319b6e200edd73.wasm)
Set timeout to 20 seconds...
Running headless tests in Chrome on `http://127.0.0.1:35891/`
Try find `webdriver.json` for configure browser's capabilities:
Not found
driver status: signal: 9 (SIGKILL)
driver stdout:
    Starting ChromeDriver 114.0.5735.90 (386bc09e8f4f2e025eddae123f36f6263096ae49-refs/branch-heads/5735@{#1052}) on port 35891
    Only local connections are allowed.
    Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
    ChromeDriver was started successfully.

Error: http://127.0.0.1:35891/session/1ac2e066841fda6f3b8a28cfa4b6c95d/url: status code 404
error: test failed, to rerun pass `--test web`

Caused by:
  process didn't exit successfully: `/home/inomata137/.cache/.wasm-pack/wasm-bindgen-a56b491eaae4bed5/wasm-bindgen-test-runner /home/inomata137/desktop/wasm_game_of_life/target/wasm32-unknown-unknown/debug/deps/web-2a319b6e200edd73.wasm` (exit status: 1)
note: test exited abnormally; to see the full output pass --nocapture to the harness.
Error: Running Wasm tests with wasm-bindgen-test failed
Caused by: Running Wasm tests with wasm-bindgen-test failed
Caused by: failed to execute `cargo test`: exited with exit status: 1
  full command: cd "/home/inomata137/desktop/wasm_game_of_life" && CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER="/home/inomata137/.cache/.wasm-pack/wasm-bindgen-a56b491eaae4bed5/wasm-bindgen-test-runner" CHROMEDRIVER="/home/inomata137/.cache/.wasm-pack/chromedriver-365490088b2eefa3/chromedriver" WASM_BINDGEN_TEST_ONLY_WEB="1" "cargo" "test" "--target" "wasm32-unknown-unknown"

Additional Context

I'm using WSL2 Ubuntu.
When I run wasm-pack test --chrome and open localhost:8000 with the Google Chrome, the page says:

running 2 tests

test web::test_tick ... ok
test web::pass ... ok

test result: ok. 2 passed; 0 failed; 0 ignored
@inomata137 inomata137 added the bug label Nov 11, 2023
@rustwasm rustwasm locked and limited conversation to collaborators Nov 11, 2023
@daxpedda daxpedda converted this issue into discussion #3702 Nov 11, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant