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
wrapGAppsHook: add basic tests #85976
Conversation
@@ -0,0 +1,23 @@ | |||
PREFIX = $(out) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other tests are in pkgs/test
, BTW, though I am sympathetic to putting tests near what is being tested, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, did not notice that. It might be cleaner to move it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python tests are in pkgs/development/interpreters/python/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about it more, I prefer having it near as well.
One thing I do not like is that everything is in bash. Some testing library would be nice. |
I used pytest for the Python tests but I doubt you would gain much considering the site of the test. It could on the other hand invite one to write more tests. |
I verified that #86416 with the following patch successfully passes --- a/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix
+++ b/pkgs/build-support/setup-hooks/wrap-gapps-hook/default.nix
@@ -13,13 +13,14 @@
makeSetupHook {
deps = lib.optional (!stdenv.isDarwin) dconf.lib ++ [
- gtk3
- librsvg
+ # gtk3
+ # librsvg
makeWrapper
];
substitutions = {
passthru.tests = let
sample-project = ./tests/sample-project;
+ gobject-introspection-setup-hook = makeSetupHook {} gobject-introspection.setupHook;
skip = cond: lib.optionalString cond ''touch $out; echo "Skipping test $name"; exit'';
in rec {
basic = stdenv.mkDerivation {
@@ -58,7 +59,7 @@ makeSetupHook {
src = sample-project;
nativeBuildInputs = [
- gobject-introspection
+ gobject-introspection-setup-hook
wrapGAppsHook
];
@@ -84,7 +85,7 @@ makeSetupHook {
src = sample-project;
nativeBuildInputs = [
- gobject-introspection
+ gobject-introspection-setup-hook
wrapGAppsHook
];
|
35e2972
to
745a663
Compare
I would like to merge this as is as I keep discovering new and new edge cases around the setup hooks. We can improve the test framework later. |
745a663
to
0be3b18
Compare
# We use the wrapProgram function. | ||
makeWrapper | ||
]; | ||
substitutions = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The substitutions
make this a mass rebuild due to
nixpkgs/pkgs/build-support/trivial-builders.nix
Lines 382 to 384 in c61b6b1
'' + lib.optionalString (substitutions != {}) '' | |
substituteAll ${script} $out/nix-support/setup-hook | |
''); |
Motivation for this change
Wanted to reproduce #85515
cc @worldofpeace