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

Create a set of integration test helpers #87

Open
Michael-F-Bryan opened this issue Nov 17, 2022 · 1 comment
Open

Create a set of integration test helpers #87

Michael-F-Bryan opened this issue Nov 17, 2022 · 1 comment
Assignees

Comments

@Michael-F-Bryan
Copy link
Contributor

Several crates have integration tests which exercise the bindings generated by wasmer-pack. Actually writing the integration test code can be kinda brittle because it relies on external programs (e.g. python and wapm) which need to be installed, and paths tend to change depending on the OS.

It'd be nice to pull all this integration test logic out into a single helper crate that lets you,

  • Compile a project to a WAPM package
  • Generate bindings for that package
  • Set up a Python/Yarn/NPM environment with the bindings installed
  • Run a set of integration tests defined in that language
  • Cache dependencies from previous runs to avoid re-downloading them

I'm imagining being able to write code like this:

#[test]
fn sha2_integration_tests() -> Result<(), Error> {
  let env = TestEnvironment::for_crate("./path/to/Cargo.toml")?;

  env.python("./my_tests.py")
     .javascript("./my_test.js")
     .typescript("./my_tests.ts")
     .execute()?;
}
@Michael-F-Bryan
Copy link
Contributor Author

I'm reopening this PR because #112 only implemented the Python side of our integration tests.

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

No branches or pull requests

2 participants