Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
153 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#! { "step": 0.10, "width": 77, "height": 20 } | ||
|
||
$ # In this example we will look how to test your NixOS configuration | ||
$ # We will create a simple configuration with `hello` pacakge installed | ||
$ # system wide and check that `hello` world binary works. | ||
|
||
$ bat test.nix | ||
────────┬───────────────────────────────────────────────────────────────────── | ||
│ File: test.nix | ||
────────┼───────────────────────────────────────────────────────────────────── | ||
1 │ { pkgs ? import <nixpkgs> {} | ||
2 │ }: | ||
3 │ pkgs.nixosTest ({ lib, pkgs, ...}: { | ||
4 │ name = "example-test"; | ||
5 │ # virtual machine with one package installed system wide | ||
6 │ machine = { pkgs, ... }: { | ||
7 │ environment.systemPackages = [ pkgs.hello ]; | ||
8 │ }; | ||
9 │ testScript = '' | ||
10 │ # run hello on machine and check for output | ||
11 │ machine.succeed('hello | grep "Hello, world!"') | ||
12 │ # test is a simple python script | ||
13 │ ''; | ||
14 │ }) | ||
────────┴──────────────────────────────────────────────────────────────────── | ||
$ # Pause the video to understand the test.nix | ||
|
||
$ # To run the test you simply need to run: | ||
$ nix-build test.nix | ||
... | ||
machine1: must succeed: hello | grep "Hello, world!" | ||
... | ||
/nix/store/99cb3pmmyaxp0rs6r596kqq5v8ivp45j-vm-test-run-example-test | ||
|
||
$ # While this example is simple you can imagine how handy can it be | ||
$ # to test interaction between many machines. | ||
$ # You can take screenshots, scrape for text and more. Checkout what | ||
$ # else you can do in NixOS manual under NixOS Tests section | ||
$ # Happy testing! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
#text-replacement( | ||
@image-rules: { | ||
#svg.play; | ||
background-size: 50%; | ||
background-size: 25%; | ||
}, | ||
); | ||
|
||
|
Oops, something went wrong.