nixos/doc/running-nixos-tests: Simplify running instructions with nixosTests

This commit is contained in:
Robert Hensing 2022-06-15 18:05:48 +02:00
parent 6e2f753989
commit 537f456373
2 changed files with 6 additions and 28 deletions

View file

@ -2,22 +2,11 @@
You can run tests using `nix-build`. For example, to run the test You can run tests using `nix-build`. For example, to run the test
[`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix), [`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix),
you just do: you do:
```ShellSession ```ShellSession
$ nix-build '<nixpkgs/nixos/tests/login.nix>' $ cd /my/git/clone/of/nixpkgs
``` $ nix-build -A nixosTests.login
or, if you don't want to rely on `NIX_PATH`:
```ShellSession
$ cd /my/nixpkgs/nixos/tests
$ nix-build login.nix
running the VM test script
machine: QEMU running (pid 8841)
6 out of 6 tests succeeded
``` ```
After building/downloading all required dependencies, this will perform After building/downloading all required dependencies, this will perform

View file

@ -4,22 +4,11 @@
You can run tests using <literal>nix-build</literal>. For example, You can run tests using <literal>nix-build</literal>. For example,
to run the test to run the test
<link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix"><literal>login.nix</literal></link>, <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix"><literal>login.nix</literal></link>,
you just do: you do:
</para> </para>
<programlisting> <programlisting>
$ nix-build '&lt;nixpkgs/nixos/tests/login.nix&gt;' $ cd /my/git/clone/of/nixpkgs
</programlisting> $ nix-build -A nixosTests.login
<para>
or, if you dont want to rely on <literal>NIX_PATH</literal>:
</para>
<programlisting>
$ cd /my/nixpkgs/nixos/tests
$ nix-build login.nix
running the VM test script
machine: QEMU running (pid 8841)
6 out of 6 tests succeeded
</programlisting> </programlisting>
<para> <para>
After building/downloading all required dependencies, this will After building/downloading all required dependencies, this will