From 9de76246f5a1f36cc65dee29de1f8f75b480e9d0 Mon Sep 17 00:00:00 2001 From: Sander van der Burg Date: Thu, 22 Apr 2021 21:15:11 +0200 Subject: [PATCH] Add services to the release expression, improve documentation --- README.md | 9 +++++---- release.nix | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 97bac6a..5f235a2 100644 --- a/README.md +++ b/README.md @@ -855,11 +855,12 @@ The above Nix expression invokes `testService` with the following parameters: `processes-advanced.nix` capturing the properties of a system that consists of multiple `webapp` and `nginx` instances, as described earlier. * The `readiness` parameter refers to a function that does a readiness check - for each process instance. In the above example, it checks whether the service + for each process instance. In the above example, it checks whether each service is actually listening on the required TCP port. * The `tests` parameter refers to a function that executes tests for each process instance. In the above example, it ignores all but the `nginx` - instances. For each `nginx` instance it checks whether all `webapp` instances + instances, because explicitly testing a `webapp` instance is a redundant + operation. For each `nginx` instance, it checks whether all `webapp` instances can be reached from it, by running the `curl` command. The `readiness` and `tests` functions take `instanceName` as a parameter that @@ -950,13 +951,13 @@ $ nix-build -A nginx-reverse-proxy-hostbased.privileged.sysvinit ``` Although the test driver makes it possible to test all possible variants of a -service, doing so is very expensive. In the above example, we have two +service, doing so may be very expensive. In the above example, we have two configuration profiles and six process managers, resulting in twelve possible variants of the same service. To get a reasonable level of confidence, it typically suffices to implement the following strategy: -* Only pick two process managers: one that prefers foreground processes +* Pick two process managers: one that prefers foreground processes (e.g. `supervisord`) and one that prefers daemons (e.g. `sysvinit`). This is the most significant difference (from a configuration perspective) between all these different process managers. diff --git a/release.nix b/release.nix index 734c3be..7b43e8f 100644 --- a/release.nix +++ b/release.nix @@ -17,6 +17,10 @@ rec { inherit pkgs nix-processmgmt; }; + services = import ./tests/services { + inherit pkgs system; + }; + multi-process-images = import ./tests/multi-process-images.nix { inherit nixpkgs; };