From 5f10d3f3076cf4ddac93d955b048f484d7bfcc04 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Fri, 10 Mar 2023 00:02:33 -0800 Subject: [PATCH] add more info on how to run and write integration tests --- docs/tutorials/integrationtests.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/tutorials/integrationtests.md b/docs/tutorials/integrationtests.md index 32c276e..a017cfb 100644 --- a/docs/tutorials/integrationtests.md +++ b/docs/tutorials/integrationtests.md @@ -10,3 +10,28 @@ You can find all integration tests under the [tests/integration](/tests/integrat ```console nix-build -A tests.integration.keycloak ``` + +To run the "simple" integration test for keycloak, execute: + +```console +nix-build -A tests.integration.keycloak.simple +``` + +## Write integration tests + +To create an integration test for disnix, you'll need: +- a tarball, +- a manifest build, +- and a test definition with a test script written in Python. + +The [NixOS official +documentation](https://nixos.org/manual/nixos/stable/index.html#sec-nixos-tests) +has a complete reference on what python functions are available in the +test script. + +To iterate on the test script, the easiest is by far to use the interactive mode by using the `.driverInteractive` attribute, like so: + +```console +nix-build -A tests.integration.keycloak.simple.driverInteractive +./result/bin/nixos-test-driver +```