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

Way to get the binary for cargo-test/cargo-nextest #600

Open
guskovd opened this issue Apr 30, 2024 · 2 comments
Open

Way to get the binary for cargo-test/cargo-nextest #600

guskovd opened this issue Apr 30, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@guskovd
Copy link

guskovd commented Apr 30, 2024

Way to get the binary for cargo-test/cargo-nextest

For some reason, I would like to run tests not at the time of building the application, but after

For example, this can be useful when running integration tests

Therefore, I would like to understand whether such binaries can be assembled using crane?

@guskovd guskovd added the enhancement New feature or request label Apr 30, 2024
@dpc
Copy link
Contributor

dpc commented Apr 30, 2024

Yeah. cargo nextest --no-run. Though I'm not sure if normal craneLib.buildPackage, would pick these binaries out of ./target. You might need to keep the target and just extract it outside of Nix or something. It's definitely doable though. Anything cargo can do directly, crane can handle too.

https://github.com/fedimint/fedimint/blob/084798db569773b61e9e0470d69ad37b2d1b548d/scripts/tests/test-ci-all.sh#L29

@ipetkov
Copy link
Owner

ipetkov commented May 1, 2024

@guskovd you can set doCheck = false; in your buildPackage derivation, and directly use craneLib.cargoTest or craneLib.cargoNextest to run the tests both of which should automatically find any test binaries compiled by cargo. Hope this helps!

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

No branches or pull requests

3 participants