diff options
author | Naïm Favier <n@monade.li> | 2022-12-21 22:00:27 +0100 |
---|---|---|
committer | Naïm Favier <n@monade.li> | 2022-12-27 17:23:25 +0100 |
commit | 07cb3bf3ccaff42789336a0a22c49ea4d25d309b (patch) | |
tree | 956cae8853f1242d589d53a0b4b977d5f4ad05c9 /nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml | |
parent | 3f6fed2e59d556a5cec475b14b7af54558e19f25 (diff) |
nixos/doc: bump Pandoc
Update the pinned channel in `md-to-db`, which bumps the Pandoc version,
which fixes https://github.com/NixOS/nixpkgs/issues/125511 maybe.
Diffstat (limited to 'nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml')
-rw-r--r-- | nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml | 56 |
1 files changed, 34 insertions, 22 deletions
diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index 8e91b683f44a..dc921dad9749 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -3,7 +3,7 @@ <para> A NixOS test is a module that has the following structure: </para> - <programlisting language="bash"> + <programlisting language="nix"> { # One or more machines: @@ -58,14 +58,14 @@ Tests that are part of NixOS are added to <link xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/all-tests.nix"><literal>nixos/tests/all-tests.nix</literal></link>. </para> - <programlisting language="bash"> + <programlisting language="nix"> hostname = runTest ./hostname.nix; </programlisting> <para> Overrides can be added by defining an anonymous module in <literal>all-tests.nix</literal>. </para> - <programlisting language="bash"> + <programlisting language="nix"> hostname = runTest { imports = [ ./hostname.nix ]; defaults.networking.firewall.enable = false; @@ -87,7 +87,7 @@ nix-build -A nixosTests.hostname Outside the <literal>nixpkgs</literal> repository, you can instantiate the test by first importing the NixOS library, </para> - <programlisting language="bash"> + <programlisting language="nix"> let nixos-lib = import (nixpkgs + "/nixos/lib") { }; in @@ -633,7 +633,7 @@ machine.wait_for_unit("xautolock.service", "x-session-user") For faster dev cycles it’s also possible to disable the code-linters (this shouldn’t be committed though): </para> - <programlisting language="bash"> + <programlisting language="nix"> { skipLint = true; nodes.machine = @@ -653,7 +653,7 @@ machine.wait_for_unit("xautolock.service", "x-session-user") disable the Black linter directly (again, don’t commit this within the Nixpkgs repository): </para> - <programlisting language="bash"> + <programlisting language="nix"> testScript = '' # fmt: off @@ -665,7 +665,7 @@ machine.wait_for_unit("xautolock.service", "x-session-user") Similarly, the type checking of test scripts can be disabled in the following way: </para> - <programlisting language="bash"> + <programlisting language="nix"> { skipTypeCheck = true; nodes.machine = @@ -700,25 +700,37 @@ with foo_running: <literal>polling_condition</literal> takes the following (optional) arguments: </para> - <para> - <literal>seconds_interval</literal> - </para> - <para> - : specifies how often the condition should be polled: - </para> + <variablelist> + <varlistentry> + <term> + <literal>seconds_interval</literal> + </term> + <listitem> + <para> + specifies how often the condition should be polled: + </para> + </listitem> + </varlistentry> + </variablelist> <programlisting language="python"> @polling_condition(seconds_interval=10) def foo_running(): machine.succeed("pgrep -x foo") </programlisting> - <para> - <literal>description</literal> - </para> - <para> - : is used in the log when the condition is checked. If this is not - provided, the description is pulled from the docstring of the - function. These two are therefore equivalent: - </para> + <variablelist> + <varlistentry> + <term> + <literal>description</literal> + </term> + <listitem> + <para> + is used in the log when the condition is checked. If this is + not provided, the description is pulled from the docstring + of the function. These two are therefore equivalent: + </para> + </listitem> + </varlistentry> + </variablelist> <programlisting language="python"> @polling_condition def foo_running(): @@ -739,7 +751,7 @@ def foo_running(): <literal>extraPythonPackages</literal>. For example, you could add <literal>numpy</literal> like this: </para> - <programlisting language="bash"> + <programlisting language="nix"> { extraPythonPackages = p: [ p.numpy ]; |