Running tests faster/raw (not within Qemu)

Is there a way to kick off the tests `raw’ in nixos/tests/ without firing up the kvm/qemu isolation (as this is 90+ second affair from the docker containers that I use) ?

Or is this documented somewhere (including cleanly just running one or passing (valgrind/electric-fence params) ?

Thanks !

Dw

2 Likes

if you need “two+ machines” to talk to each other, then I don’t think so.

Or is this documented somewhere (including cleanly just running one or passing (valgrind/electric-fence params) ?

This sounds like you just want to test a package with more utilities instead of service to service communication which is the goal of nixos tests. You can always do an override and add additional steps to the checkphase of a derivation.

my-package-with-tests = mypackage.overrideAttrs(oldAttrs: {
  doInstallCheck = true;
  installCheckInputs = oldAttrs.installCheckInputs ++ [ valgrind ];
  checkPhase = oldAttrs.checkPhase + ''
    valgrind ...
  '';
})

I didn’t test this as I’m not familiar with using valgrind, but it should be close to what you’re looking for.

1 Like

As to the second question – Thanks for that valgrind hint - got that working.

As to the first – In my case - not actually need to start up a new machine – so fine to not start KVM/qemu at all.

Is there an option for that ?

As to the first – In my case - not actually need to start up a new machine – so fine to not start KVM/qemu at all.

I’m not aware of nixos test construction using alternative virtualization methods. But I’m also not super familiar with nixos testing, to be honest.

My two cents here:
Figured out a working example how to do this. Thanks for the inspiration!
Sources: https://kuznero.com/post/linux/haskell-project-structure-in-nixos/,
https://discourse.nixos.org/t/running-tests-faster-raw-not-within-qemu/5396