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

Consistent way to test crates on CI (without hardcoding a wasm-bindgen version in CI configs) #1611

Closed
najamelan opened this issue Jun 22, 2019 · 4 comments · Fixed by #1616

Comments

@najamelan
Copy link
Contributor

Motivation

I'm trying to add CI testing to my crate following the explanation here:
https://rustwasm.github.io/wasm-bindgen/wasm-bindgen-test/continuous-integration.html

As you can see there is a lot of hardcoded version numbers for wasm-bindgen, nvm, geckodriver, chromedriver. This means that whenever wasm-bindgen is updated we would have to manually modify configuration files like .travis.yml.

This also means that the book itself is outdated all the time.

Proposed Solution

I'm wondering if we can make a simpler way to set this up which would just use the latest version of everything. I'm suspecting that wasm-bindgen can be installed with cargo install.

In either case, the book needs an update (wasm-bindgen-0.2.21), and maybe it's a good moment to consider streamlining this workflow?

@najamelan
Copy link
Contributor Author

najamelan commented Jun 22, 2019

Ok, I see, the downside of cargo install wasm-pack is that a lot of resources are wasted to compile it every time. Otherwise, this works on travis:

language: rust
cache   : cargo

rust:
  # - stable
  # - beta
  - nightly

addons:
  firefox: latest
  chrome : stable

install:
  - cargo install wasm-pack

script:

  - cargo test
  - wasm-pack test  --firefox --headless
  - wasm-pack test  --chrome  --headless

@alexcrichton
Copy link
Contributor

Thanks for the report! Indeed wasm-pack is the way to fix this, and there are prebuilt installers to avoid the compilation time of cargo install wasm-pack

@najamelan
Copy link
Contributor Author

@alexcrichton would you like me to test it and propose a PR for this file: https://github.com/rustwasm/wasm-bindgen/blob/master/guide/src/wasm-bindgen-test/continuous-integration.md ?

@alexcrichton
Copy link
Contributor

@najamelan oh oops didn't realize that was still there, yeah a PR for that would be great!

najamelan added a commit to najamelan/async_runtime that referenced this issue Jun 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants