-
Notifications
You must be signed in to change notification settings - Fork 90
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
nextest: produce output in result even when the command fails #305
Comments
I've experimented with the following code: nextestReportWrapped = stdenv.mkDerivation {
name = "nextest-report-wrapped";
dontCheck = true;
dontInstall = true;
broken = true;
inherit src;
outputs = [ "out" ];
buildPhase = ''
mkdir -p $out/target/nextest/ci
cp ${cargoNextest}/target/nextest/ci/rust-junit.xml $out/target/nextest/ci
if grep -q 'failures="[1-9][0-9]*"' $out/target/nextest/ci/rust-junit.xml;
then
echo "FAILURE!"
exit 1
else
echo "NO FAILURE!"
fi
'';
}; But, no matter what I've tried, the result folder was never created. |
Okay, so far the best approach I could find is the following:
|
It's worth noting that You may want to try adding an additional craneLib.cargoNextest (commonArgs // {
inherit cargoArtifacts;
# working workaround
cargoNextestExtraArgs = "--profile ci || true";
postInstall = ''
cp ./target/nextest/ci/rust-junit.xml $out/rust-junit.xml
'';
}); I suppose it may be worth exposing an |
Another thing we could do is make the package runnable by including a |
That would be nice! That's a good idea. |
I use cargo-nextest to produce a JUnit-style XML report. If all tests succeed inside Nix with crane via cargo-nextest,
result/target/nextest/ci/rust-junit.xml
contains the result file. The problem is: This file is also needed, ifcargo-nextest
fails. I triednix-build --keep-failed --keep-going release.nix -A test
but there is still no result folder.A working workaround is adding
|| true
:but it is inconvenient, as I still need the test command to fail.
I'd like to:
The text was updated successfully, but these errors were encountered: