From 7bc7cd49cf28eef243089326f670e02a831aaa62 Mon Sep 17 00:00:00 2001 From: ibizaman Date: Thu, 23 Jan 2025 20:52:01 +0100 Subject: [PATCH] refactor extraScript in tests --- test/common.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/test/common.nix b/test/common.nix index 0d61a7a..c5b55e0 100644 --- a/test/common.nix +++ b/test/common.nix @@ -96,17 +96,15 @@ let script = extraScript args; indent = i: str: lib.concatMapStringsSep "\n" (x: (lib.strings.replicate i " ") + x) (lib.splitString "\n" script); in - lib.optionalString (script != "") '' - with subtest("extraScript"): - ${indent 4 script} - '')); + lib.optionalString (script != "") script) + ); backupScript = args: (accessScript args).override { - extraScript = { proto_fqdn, ... }: '' - with subtest("backup"): - server.succeed("systemctl start restic-backups-testinstance_opt_repos_A") - ''; - }; + extraScript = { proto_fqdn, ... }: '' + with subtest("backup"): + server.succeed("systemctl start restic-backups-testinstance_opt_repos_A") + ''; + }; in { inherit baseImports accessScript;