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

The wasmer-integration-tests-cli test suite isn't hygienic #4015

Closed
Michael-F-Bryan opened this issue Jun 20, 2023 · 0 comments · Fixed by #4038
Closed

The wasmer-integration-tests-cli test suite isn't hygienic #4015

Michael-F-Bryan opened this issue Jun 20, 2023 · 0 comments · Fixed by #4038
Assignees
Labels
🎉 enhancement New feature! priority-medium Medium priority issue
Milestone

Comments

@Michael-F-Bryan
Copy link
Contributor

Motivation

Almost all of the tests in the wasmer-integration-tests-cli test suite are non-hygienic. They all use the same ~/.wasmer/ directory, which means that

  1. Integration tests need to be run sequentially (i.e. --test-threads=1) and a failure midway through can sometimes mess things up for subsequent tests (I've noticed caching is particularly bad for this)
  2. After the integration tests are done, the global ~/.wasmer/wasmer.toml file will be left in a broken state and you'll need to find your old access token and log in again

Proposed solution

The way we solve this problem is by making sure each integration test uses its own independent wasmer directory. We can do this fairly trivially by setting the $WASMER_DIR environment variable to something unique like $CARGO_TARGET_TMPDIR/wasmer-integration-tests-cli/$test_name

Cargo always sets provides integration tests with a $CARGO_TARGET_TMPDIR directory inside target/ they can use as a scratch space. That also means CI will get caching for free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! priority-medium Medium priority issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants