-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
phoronix-test-suite: add tests #75117
Conversation
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.
To be honest, I do not see much value in these trivial execution tests. I would say that the application builds but does not execute after update is pretty small. And the reviewer still needs to at least run the program and try some action so it will be already covered by this.
Even a trivial actions would be enough for this approach to be worth in my eyes (e.g. testing that calculator returns 4 for 2+2). But perhaps this is a rather hard program to test, as it probably relies on real hardware.
cbaccdb
to
c2cf859
Compare
@jtojnar thanks for your feedback!
My plan is to automate this manual tests to check this boxes:
This is especially useful for automated updates with nixpkgs-update, but also for easier review with ofborg and nixpkgs-review.
Yes, this specific program downloads tests from the internet (about 1 MB or more) and run a benchmark which uses 100% CPU on one core for several minutes. Nothing you want to run on a CI. So i have choosen this dummy command to test if basic functionality is given. For other programs i would test at least one common task. Do you see a difference in testing with this automated tests and testing manual in a real terminal? |
c2cf859
to
972d999
Compare
In general, when packaging, I think «builds and fails to load a library on start» is more typical than «builds and runs but doesn't work even on simplest examples»… |
972d999
to
e9007b3
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/108 |
All remarks are resolved so this is ready to merge. There were no further comments, so this seems to be fine. I already reviewed 2 updates where this would have been helpful. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-many-people-are-paid-to-work-on-nix-nixpkgs/8307/51 |
Motivation for this change
Add tests to make reviews easier and the package more stable.
This is my attempt to implement package testing like discussed in #73076 (comment).
Please provide feedback!
Some aspects might be controversial like
with phoronix-test-suite;
. It allows to simply use"${version}"
in the tests, but usingwith
was discouraged for some reason.Also what about naming?
tests tests tests don't read nicely. should we call it "simple" or "basic"?
When it is approved i would like to add tests to more packages and document it.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @jtojnar @worldofpeace @Profpatsch @7c6f434c