build-support/php: add installCheckPhase#261429
Conversation
There was a problem hiding this comment.
The implementation you are suggesting is straightforward and minimal 👍🏻
I tried to test this, and I believe I found one issue: installCheck is likely disabled in many configurations, and so you should consider additionally exposing doInstallCheck.
nixpkgs/pkgs/stdenv/generic/make-derivation.nix
Lines 126 to 128 in c00c516
The default for doInstallCheck is false. It can be overriden by setting config.doCheckByDefault = true. I tried this, but some derivation quite far away from my test in its dependency tree failed to build. I think it's unreasonable to expect consumers to set config.doCheckByDefault.
|
Job done, can you check again ? |
|
@GrahamcOfBorg build phpPackages.composer |
There was a problem hiding this comment.
With this PR I was able to initiate execution of unit tests of a PHP project. In other words by setting doInstallCheck = true; installCheckPhase = "..."; I could test the code I am packaging. Since the changes are quite minimal, easy to understand, and improve buildComposerProject by allowing test execution, I approve this PR.
Description of changes
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)