-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
Add installed tests #34987
Comments
Ibus apparently has something based on gdtr fujiwarat/ibus-anthy@5a9e485, we should probably use that to prevent things like #68837 from reoccurring. |
Thank you for your contributions.
|
This is a long term tracking goal. |
I marked this as stale due to inactivity. → More info |
Hello! I'd like to start contributing to nixpkgs. I was thinking to try to improve testing to prevent regressions. Is this a good issue to start with? |
@willbush Hi. It will depend on your experience and vary from package to package. For libraries that are mostly self-contained, it may be as simple as adding the tested package and making sure the installed test files are installed by the package (usually there will be an configure option, though sometimes it is broken because upstreams do not regularly run installed tests). Sometimes there are paths that need to be patched or extra dependencies to be added, just like with any other Nix packaging. With extra dependencies, it might be nice to move the installed tests into a separate output. Here are recent commits introducing installed tests to geocode-glib as another example: fb2877c 6a7da5b
Feel free to ping me on Matrix or Discourse if you have more specific questions. |
@jtojnar Took a while to get over the learning curve, but I think json-glib PR is inline with how others were done. I noticed that graphene and json-glib tests execute very fast. I was wondering why a VM has to be spun up for them? Is it because we don't know how they modify their environment? |
@jtojnar I noticed that gtksourceview5 runs meson test in the checkPase. Would installed tests still be desired? |
@willbush Sorry, this got lost in the noise.
I think for installed tests it is desirable to make them closer to a real runtime environment.
Looks like the installed tests of gtksourceview5 run the same set of tests as the test suite so installing them is probably not necessary. I would say that the installed tests mainly make sense for tests that require realistic runtime environment or ones that take long time. If the test suite is mostly self-contained, running it in the build is sufficient. |
We want to test that packages work on NixOS but writing tests manually is a chore so not many applications are covered. Fortunately, many packages (especially from GNOME or Freedesktop) ship so called installed tests that already do what we want.
I already implemented them for gjs and fwupd and as you can see it is actually quite simple. We can even factor it out into something like:
Here is incomplete list of software that provides installed tests:
Finally, we should connect the tests to their respective packages, for example using #27604
The text was updated successfully, but these errors were encountered: