Running and diagnosing package passthru tests

Hello, sorry if this seems like a noob question, but how can I run the passthru tests of a particular package and how should I go for diagnosing problems with the tests?

Currently, there’s this PR that is being held by what I think is a faulty test: vcpkg-tool-unwrapped: 2025-05-19 -> 2025-06-20 by r-ryantm · Pull Request #413467 · NixOS/nixpkgs · GitHub

I can see the tests being defined here, but I don’t know how to run locally it or see the exact reason why it fails: nixpkgs/pkgs/by-name/vc/vcpkg-tool/package.nix at 4e806e6f5efc0b4cb9906e3f5542883d179ce2d1 · NixOS/nixpkgs · GitHub

Any help would be greatly appreciated!

Tests are derivations too; you can just run (from a local Nixpkgs tree) nix-build . -A vcpkg-tool-unwrapped.tests. Tests are generally written such that ‘failure’ means they won’t build.

It looks like the test should be disabled if doWrap is false, since the test is testing the wrapper.

1 Like

That would explain why the test seemingly worked when looking at the logs for the wrapped version. Thank you for the tip!