-
I am currently writing some tests that require the docker daemon to work, hence I cannot run them inside the nix sandbox. My idea was to use Sadly, that did not work, the output derivation was simply empty. The next problem is also, that test binaries have a checksum in them, so I cannot hardcode extract them either. Is there anything from the great toolset that crane provides that would get me close to that goal? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would suggest adapting what
Hope this helps! |
Beta Was this translation helpful? Give feedback.
I would suggest adapting what
buildPackage
does for extracting the test binaries:cargo test --no-run --message-format json-render-diagnostics
and capture the logs (example)jq
to filter the binaries you care about.buildPackage
ignores tests and only looks for libraries or other executables but you might be able to achieve it with a filter like'select(.reason == "compiler-artifact" and .profile.test == true) | .executable'
(you may need to tweak it further to suit your needs but from a quick test it looks like it will achieve what you are looking for)jq
output will provide all the test binaries which would have been run for this test, and they can be copied/installed a…