Skip to content

Commit

Permalink
refactor extraScript in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ibizaman authored and ibizaman committed Jan 23, 2025
1 parent b776bd0 commit 7bc7cd4
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions test/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7bc7cd4

Please sign in to comment.