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

reuse binary tests for prod builds #291

Open
Gankra opened this issue Jul 26, 2023 · 2 comments
Open

reuse binary tests for prod builds #291

Gankra opened this issue Jul 26, 2023 · 2 comments
Labels
feature request New feature or request

Comments

@Gankra
Copy link
Contributor

Gankra commented Jul 26, 2023

It seems vaguely plausible that we could run Cargo's binary tests (/tests/...) for production binaries, which would be nice for allowing people to test prod binaries. This is really messy to do on github infra because it doesn't like "staging" releases (draft releases have different URLs from un-drafted ones, so anything that's self-downloading will be confused...), so it may require us to bring up our own infra to do Well.

@Gankra Gankra added the feature request New feature or request label Jul 26, 2023
@Gankra
Copy link
Contributor Author

Gankra commented Aug 2, 2023

The integration tests now include an env var OVERRIDE_CARGO_BIN_EXE_cargo-dist=/path/to/binary which is checked at runtime and masks CARGO_BIN_EXE_cargo-dist. This allows you to inject an arbitrary binary from wherever into the test suite, and just run cargo test normally.

Remaining issue is to work out how to automate doing this on releases (ideally we'd somehow run the normal ci.yml test scripts, and not have to duplicate them...).

@Gankra
Copy link
Contributor Author

Gankra commented Aug 2, 2023

Also note that this can theoretically be combined with nextest's support for archiving/cross-compiling tests: https://nexte.st/book/reusing-builds.html

I originally opened nextest-rs/nextest#917 to discuss this, and rain wrote a ton of insightful notes (culminating in me being convinced that all I needed for now was the OVERRIDE_* pattern, and that no upstream work is necessary).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant