Way to get the binary for `cargo-test/cargo-nextest`
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?
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
@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!