Closed Sohalt closed 2 years ago
Totally agree. I'm not sure about the best way to do it, but it makes a lot of sense to provide a way to run the tests in the checkPhase.
What do you think about my suggestion to just pass the attributes to mkDerviation
? That way I could write something like
mkCljBin {
name = "foo";
projectSrc = ./.;
main-ns = "foo.main";
checkPhase = "clj -X:test";
}
@Sohalt I like it, probably I'll implement it that way :+1:
But first I have to finish the work I'm doing in the local-cache
branch, without those changes, specifying an alias at nix build time it's not going to work
Ah, I didn't know that. Thanks!
Done, see an example here: https://github.com/jlesquembre/clj-nix#mkcljbin
Now you can do:
mkCljBin {
# ...
doCheck = true;
checkPhase = "clj -M:test";
}
@Sohalt Thanks again for pointing me to the mkshell example :)
It would be nice to be able to use
checkPhase
to run unit tests, e.g. usingclojure -X:test
or some other test runner. Maybe a general approach would be to pass all "unknown" attributes tomkCljBin
through tomkDerivation
. This is also done in a few othermkDerivation
"wrappers", e.g. mkshell.