Skip to content

Long lines in test output getting cut off #520

Closed
@fitzgen

Description

@fitzgen

🐛 Bug description

Lines that are longer than the terminal width are getting trimmed to terminal width in the test output when run under wasm-pack test.

👟 Steps to reproduce

  • unzip the test case and cd into it: test-case.zip
  • wasm-pack test --headless --firefox (or --chrome or whatever browser you have installed)

Actual Behavior

The lines are trimmed:

$ wasm-pack test --firefox --headless
  
  [1/6] Checking `rustc` version...
  [2/6] Adding WASM target...
  info: component 'rust-std' for target 'wasm32-unknown-unknown' is up to date
  [3/6] Compiling tests to WASM...
      Finished dev [unoptimized + debuginfo] target(s) in 0.04s
  wasm-bindgen 0.2.32
  [4/6] Installing wasm-bindgen...
  [5/6] Getting geckodriver...
  [6/6] Running tests in Firefox...
      Finished dev [unoptimized + debuginfo] target(s) in 0.04s
       Running target/wasm32-unknown-unknown/debug/deps/xxx-b461ad8f232bf13f.wasm
  no tests to run!
       Running target/wasm32-unknown-unknown/debug/deps/web-24b3a44136c49aae.wasm
Executing bindgen...                                
Vtarting new webdriver session...                   
  
  test web::pass ... FAIL
  
  failures:
  
  ---- web::pass output ----
      log output:
          really long line of output.....................................................................
  
      error output:
          panicked at 'assertion failed: false', tests/web.rs:23:5
  
      JS exception that was thrown:
          RuntimeError: unreachable executed
          __rust_start_panic@http://127.0.0.1:42037/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate
          rust_panic@http://127.0.0.1:42037/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-fu
          std::panicking::rust_panic_with_hook::h1bab7bcac8c89880@http://127.0.0.1:42037/wasm-bindgen-tes
          std::panicking::begin_panic::h450cfeb41b01b557@http://127.0.0.1:42037/wasm-bindgen-test_bg line
          web::pass::h452e2d209d9a9f89@http://127.0.0.1:42037/wasm-bindgen-test_bg line 8 > WebAssembly.i
          core::ops::function::FnOnce::call_once::h1815d467fc7682f9@http://127.0.0.1:42037/wasm-bindgen-t
          wasm_bindgen_test::__rt::Context::execute_sync::{{closure}}::hf6ba7ab4584b917e@http://127.0.0.1
          <futures::future::lazy::Lazy<F, R>>::get::h7715d1cbbf333786@http://127.0.0.1:42037/wasm-bindgen
          <futures::future::lazy::Lazy<F, R> as futures::future::Future>::poll::h69ff60a149b798b2@http://
          <wasm_bindgen_test::__rt::TestFuture<F> as futures::future::Future>::poll::{{closure}}::{{closu
          wasm_bindgen::convert::closures::invoke0_mut::h87066c0bd57b52dc@http://127.0.0.1:42037/wasm-bin
          cbarg0@http://127.0.0.1:42037/wasm-bindgen-test:220:20
          window.__wbg_test_invoke@http://127.0.0.1:42037/:37:38
          __wbg_wbgtestinvoke_f27479ae3a6c5852@http://127.0.0.1:42037/wasm-bindgen-test:233:13
          wasm_bindgen_test::__rt::__wbg_test_invoke::h21a4671e3b2c3388@http://127.0.0.1:42037/wasm-bindg
          <wasm_bindgen_test::__rt::TestFuture<F> as futures::future::Future>::poll::{{closure}}::h5c1319
          <scoped_tls::ScopedKey<T>>::set::h315f47e212789477@http://127.0.0.1:42037/wasm-bindgen-test_bg
          <wasm_bindgen_test::__rt::TestFuture<F> as futures::future::Future>::poll::h8dced3a6d53de9f6@ht
          <alloc::boxed::Box<F> as futures::future::Future>::poll::hacee3bcbba6e5649@http://127.0.0.1:420
          <wasm_bindgen_test::__rt::ExecuteTests as futures::future::Future>::poll::h3b38541d9db3f064@htt
          <futures::future::map::Map<A, F> as futures::future::Future>::poll::h3955b980d3a6d472@http://12
          <futures::future::map_err::MapErr<A, F> as futures::future::Future>::poll::h8d720cf8b79fdffe@ht
          <alloc::boxed::Box<F> as futures::future::Future>::poll::h63b820cb03898003@http://127.0.0.1:420
          <futures::task_impl::Spawn<T>>::poll_future_notify::{{closure}}::hd0caa0bba567b0c4@http://127.0
          <futures::task_impl::Spawn<T>>::enter::{{closure}}::h2b0f2ab20135c3f2@http://127.0.0.1:42037/wa
          futures::task_impl::std::set::h51b8dd6853e89e99@http://127.0.0.1:42037/wasm-bindgen-test_bg lin
          <futures::task_impl::Spawn<T>>::enter::ha7e49a8b2998e977@http://127.0.0.1:42037/wasm-bindgen-te
          <futures::task_impl::Spawn<T>>::poll_fn_notify::h35c94fd6904feb6c@http://127.0.0.1:42037/wasm-b
          <futures::task_impl::Spawn<T>>::poll_future_notify::hb0465aab94813750@http://127.0.0.1:42037/wa
          wasm_bindgen_futures::_future_to_promise::Package::poll::h152e6be4d5444487@http://127.0.0.1:420
          wasm_bindgen_futures::_future_to_promise::{{closure}}::hfbca8bb242952b00@http://127.0.0.1:42037
          wasm_bindgen::convert::closures::invoke2_mut::hb1de2da4d54e195d@http://127.0.0.1:42037/wasm-bin
          cbarg0@http://127.0.0.1:42037/wasm-bindgen-test:407:20
          __wbg_new_5dc66f71c54d38f0@http://127.0.0.1:42037/wasm-bindgen-test:420:34
          js_sys::Promise::new::h5bc5e60fe6ae165d@http://127.0.0.1:42037/wasm-bindgen-test_bg line 8 > We
          wasm_bindgen_futures::_future_to_promise::ha35bf59c895442aa@http://127.0.0.1:42037/wasm-bindgen
          wasm_bindgen_futures::future_to_promise::h0336b51e85f3141e@http://127.0.0.1:42037/wasm-bindgen-
          wasm_bindgen_test::__rt::Context::run::hd0ce0a6eede83757@http://127.0.0.1:42037/wasm-bindgen-te
          context_run@http://127.0.0.1:42037/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-f
          run@http://127.0.0.1:42037/wasm-bindgen-test:582:27
          main@http://127.0.0.1:42037/run.js:35:19
          async*@http://127.0.0.1:42037/run.js:40:1
  
  failures:
  
      web::pass
  
  test result: FAILED. 0 passed; 1 failed; 0 ignored
  console.log div contained:
      really long line of output.........................................................................
  
  console.log div contained:
      panicked at 'assertion failed: false', tests/web.rs:23:5
  
  error: some tests failed
  error: test failed, to rerun pass '--test web'
| 
Error: Running Wasm tests with wasm-bindgen-test failed
Caused by: failed to execute `cargo test`: exited with exit code: 1

🤔 Expected Behavior

We don't swallow any test output.

If I run cargo test with the wasm-bindgen-test-runner manually, I get the expected, untrimmed output, so this is something in wasm-pack.

$ CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_RUNNER=~/.cargo/bin/wasm-bindgen-test-runner cargo test --target wasm32-unknown-unknown
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running target/wasm32-unknown-unknown/debug/deps/xxx-b461ad8f232bf13f.wasm
no tests to run!
     Running target/wasm32-unknown-unknown/debug/deps/web-24b3a44136c49aae.wasm
Running headless tests in Firefox with `geckodriver`
running 1 test                                    

test web::pass ... FAIL

failures:

---- web::pass output ----
    log output:
        really long line of output..............................................................................................................................................................................................................................................................................................................................................hello
    
    error output:
        panicked at 'assertion failed: false', tests/web.rs:23:5
    
    JS exception that was thrown:
        RuntimeError: unreachable executed
        __rust_start_panic@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[2154]:0x79c8a
        rust_panic@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[2141]:0x7997c
        std::panicking::rust_panic_with_hook::h1bab7bcac8c89880@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[2136]:0x79693
        std::panicking::begin_panic::h450cfeb41b01b557@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1540]:0x61689
        web::pass::h452e2d209d9a9f89@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[157]:0x6499
        core::ops::function::FnOnce::call_once::h1815d467fc7682f9@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[75]:0x3290
        wasm_bindgen_test::__rt::Context::execute_sync::{{closure}}::hf6ba7ab4584b917e@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[124]:0x4ad6
        <futures::future::lazy::Lazy<F, R>>::get::h7715d1cbbf333786@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[128]:0x4ff8
        <futures::future::lazy::Lazy<F, R> as futures::future::Future>::poll::h69ff60a149b798b2@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[130]:0x51e1
        <wasm_bindgen_test::__rt::TestFuture<F> as futures::future::Future>::poll::{{closure}}::{{closure}}::h1c768a3e7d98cdb7@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[127]:0x4def
        wasm_bindgen::convert::closures::invoke0_mut::h87066c0bd57b52dc@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1067]:0x5262e
        cbarg0@http://127.0.0.1:36963/wasm-bindgen-test:220:20
        window.__wbg_test_invoke@http://127.0.0.1:36963/:37:38
        __wbg_wbgtestinvoke_f27479ae3a6c5852@http://127.0.0.1:36963/wasm-bindgen-test:233:13
        wasm_bindgen_test::__rt::__wbg_test_invoke::h21a4671e3b2c3388@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[519]:0x3b3ed
        <wasm_bindgen_test::__rt::TestFuture<F> as futures::future::Future>::poll::{{closure}}::h5c1319f79c06b348@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[126]:0x4d76
        <scoped_tls::ScopedKey<T>>::set::h315f47e212789477@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[108]:0x3e1a
        <wasm_bindgen_test::__rt::TestFuture<F> as futures::future::Future>::poll::h8dced3a6d53de9f6@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[125]:0x4be1
        <alloc::boxed::Box<F> as futures::future::Future>::poll::hacee3bcbba6e5649@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[981]:0x4e40f
        <wasm_bindgen_test::__rt::ExecuteTests as futures::future::Future>::poll::h3b38541d9db3f064@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[490]:0x374e7
        <futures::future::map::Map<A, F> as futures::future::Future>::poll::h3955b980d3a6d472@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1120]:0x53822
        <futures::future::map_err::MapErr<A, F> as futures::future::Future>::poll::h8d720cf8b79fdffe@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1002]:0x4f336
        <alloc::boxed::Box<F> as futures::future::Future>::poll::h63b820cb03898003@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1405]:0x5d3f5
        <futures::task_impl::Spawn<T>>::poll_future_notify::{{closure}}::hd0caa0bba567b0c4@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1248]:0x591b1
        <futures::task_impl::Spawn<T>>::enter::{{closure}}::h2b0f2ab20135c3f2@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1249]:0x59203
        futures::task_impl::std::set::h51b8dd6853e89e99@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1380]:0x5c8bd
        <futures::task_impl::Spawn<T>>::enter::ha7e49a8b2998e977@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1245]:0x590a8
        <futures::task_impl::Spawn<T>>::poll_fn_notify::h35c94fd6904feb6c@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1244]:0x58f52
        <futures::task_impl::Spawn<T>>::poll_future_notify::hb0465aab94813750@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1247]:0x59174
        wasm_bindgen_futures::_future_to_promise::Package::poll::h152e6be4d5444487@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1211]:0x57258
        wasm_bindgen_futures::_future_to_promise::{{closure}}::hfbca8bb242952b00@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1210]:0x5702b
        wasm_bindgen::convert::closures::invoke2_mut::hb1de2da4d54e195d@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1546]:0x61e40
        cbarg0@http://127.0.0.1:36963/wasm-bindgen-test:407:20
        __wbg_new_5dc66f71c54d38f0@http://127.0.0.1:36963/wasm-bindgen-test:420:34
        js_sys::Promise::new::h5bc5e60fe6ae165d@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1473]:0x5f96d
        wasm_bindgen_futures::_future_to_promise::ha35bf59c895442aa@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[1209]:0x56e52
        wasm_bindgen_futures::future_to_promise::h0336b51e85f3141e@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[600]:0x40b1c
        wasm_bindgen_test::__rt::Context::run::hd0ce0a6eede83757@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[502]:0x3a6bd
        context_run@http://127.0.0.1:36963/wasm-bindgen-test_bg line 8 > WebAssembly.instantiate:wasm-function[506]:0x3ad5e
        run@http://127.0.0.1:36963/wasm-bindgen-test:582:27
        main@http://127.0.0.1:36963/run.js:35:19
        async*@http://127.0.0.1:36963/run.js:40:1

failures:

    web::pass

test result: FAILED. 0 passed; 1 failed; 0 ignored
console.log div contained:
    really long line of output..............................................................................................................................................................................................................................................................................................................................................hello

console.log div contained:
    panicked at 'assertion failed: false', tests/web.rs:23:5

error: some tests failed                          
error: test failed, to rerun pass '--test web'

🌍 Your environment

Include the relevant details of your environment.

wasm-pack version:

$ wasm-pack --version
wasm-pack 0.6.0

rustc version:

$ rustc --version
rustc 1.33.0-nightly (c2d381d39 2019-01-10)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions