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
Improve docs #46777
Improve docs #46777
Conversation
False statements don't cause NixOS tests to fail, we need to throw an exception or terminate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, otherwise lgtm.
</screen> | ||
The function <command>testScript</command> executes the entire test script | ||
and drops you back into the test driver command line upon its completion. | ||
This allows you to inspect the state of the VMs after the test (e.g. to debug | ||
the test script). | ||
the test script). The machine state is kept across VM restarts in | ||
<filename>/tmp/vm-state-</filename><varname>machinename</varname>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be in a separate para.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -108,7 +108,7 @@ xlink:href="https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualis | |||
<programlisting> | |||
$machine->start; | |||
$machine->waitForUnit("default.target"); | |||
$machine->succeed("uname") =~ /Linux/; | |||
die unless $machine->succeed("uname") =~ /Linux/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this change because it isn't actually something we ever do in the tests (there are no die unless
s) but I do agree we shouldn't have the comparison just be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I change it to $machine->succeed('[[ $(uname) =~ Linux ]]')
then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nah, let's take it as-is. Thank you!
FYI, regarding commit
nixos tests doc: update VM state path
: The current state path is defined here.