darwin: installBinaryPackage Add install darwin binary tests#441396
darwin: installBinaryPackage Add install darwin binary tests#441396dwt wants to merge 6 commits intoNixOS:masterfrom
Conversation
acid-bong
left a comment
There was a problem hiding this comment.
Please, read the contributing docs on title conventions (they're the same for both commits and PRs). They must be formatted as SCOPE: CHANGES, where SCOPE is a name of a package or nixos/MODULENAME
Is this better? |
55fddbf to
3f0977a
Compare
|
@afh I am thinking about exploring rewriting these as $package.passthru.tests. It seems to me from the docs that runCommand might actually be enough to run this test without having to resort to virtual machines (as all it is doing is running the installer and checking a checksum. That would enable building the tests only on darwin, which is where they belong anyway and should remove all unforeseen problems with unpacking something that can only be unpacked on darwin (because of dependencies). |
3f0977a to
2178195
Compare
|
@afh what do you think about this? As far as I can tell this is a much simpler way to test this, builds natively on darwin and doesn't require any linux VMs to execute. Also the zip based test fails, as far as I can tell because the sourceRoot cannot be reset to '' (empty string) from the derivation. What do you think? Perhaps with |
5f123e5 to
3d68797
Compare
|
@dwt #293498 now contains changes—I've kept them in a separate commit for the time being—to support use of While testing these changes with the helpful tests added in this PR the tests failed with: Happy to take a look at this together… |
3d68797 to
641eec5
Compare
This pull request starts adding some test cases for darwin.installBinaryPackage to understand how it works, and ensure we can keep it working correctly indefinitely.
This is very much a work in progress right now, so please review the tests and the idea instead of the commit structure for now. I also suspect that it may be possible to write nix unit tests to check that an installed package has a specific SRI hash, but I haven't yet found out a way to do so. Still this would allow us to execute the tests locally on macOS instead of trying to get them to work on linux which would be a great simplification.
This is meant to build upon #293498 so best review them in tandem.
Note: This pull request will be rebased aggressively onto #293498 as we work on this feature.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.