From: Simon Ruderich Date: Sat, 1 Nov 2025 08:03:40 +0000 (+0100) Subject: tests: end-to-end: don't remove helper before almost all tests X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=b11f5dbfd4b1ffda6a1e4963427d2bd52af8f6a3;p=safcm%2Fsafcm.git tests: end-to-end: don't remove helper before almost all tests There's no need to test uploading the helper in each test. Not uploading it also makes the tests run slightly faster (~1s). --- diff --git a/cmd/safcm/main_sync_test.go b/cmd/safcm/main_sync_test.go index 8bb860c..dbab316 100644 --- a/cmd/safcm/main_sync_test.go +++ b/cmd/safcm/main_sync_test.go @@ -148,20 +148,18 @@ func TestSyncSshEndToEnd(t *testing.T) { { "no changes (dry-run)", false, - true, + false, []string{"-n", "no-changes.example.org"}, - `[info] [no-changes.example.org] remote helper upload in progress -[info] [no-changes.example.org] no changes + `[info] [no-changes.example.org] no changes `, nil, }, { "no changes (dry-run -log debug2)", false, - true, + false, []string{"-n", "-log", "debug2", "no-changes.example.org"}, - `[info] [no-changes.example.org] remote helper upload in progress -[verbose] [no-changes.example.org] host groups: all no-changes.example.org + `[verbose] [no-changes.example.org] host groups: all no-changes.example.org [verbose] [no-changes.example.org] host group priorities (descending): no-changes.example.org [debug] [no-changes.example.org] files: "/" (no-changes.example.org): unchanged [debug] [no-changes.example.org] files: "/etc" (no-changes.example.org): unchanged @@ -173,20 +171,18 @@ func TestSyncSshEndToEnd(t *testing.T) { { "no changes", skipUnlessHarmless, - true, + false, []string{"no-changes.example.org"}, - `[info] [no-changes.example.org] remote helper upload in progress -[info] [no-changes.example.org] no changes + `[info] [no-changes.example.org] no changes `, nil, }, { "no changes (-log debug2)", skipUnlessHarmless, - true, + false, []string{"-log", "debug2", "no-changes.example.org"}, - `[info] [no-changes.example.org] remote helper upload in progress -[verbose] [no-changes.example.org] host groups: all no-changes.example.org + `[verbose] [no-changes.example.org] host groups: all no-changes.example.org [verbose] [no-changes.example.org] host group priorities (descending): no-changes.example.org [debug] [no-changes.example.org] files: "/" (no-changes.example.org): unchanged [debug] [no-changes.example.org] files: "/etc" (no-changes.example.org): unchanged @@ -199,10 +195,9 @@ func TestSyncSshEndToEnd(t *testing.T) { { "no effect commands (dry-run)", false, - true, + false, []string{"-n", "no-effect-commands.example.org"}, - `[info] [no-effect-commands.example.org] remote helper upload in progress -[info] [no-effect-commands.example.org] + `[info] [no-effect-commands.example.org] will execute 2 command(s): (dry-run) "echo this is a command" "true" @@ -212,10 +207,9 @@ will execute 2 command(s): (dry-run) { "no effect commands (dry-run -log debug2)", false, - true, + false, []string{"-n", "-log", "debug2", "no-effect-commands.example.org"}, - `[info] [no-effect-commands.example.org] remote helper upload in progress -[verbose] [no-effect-commands.example.org] host groups: all no-effect-commands.example.org + `[verbose] [no-effect-commands.example.org] host groups: all no-effect-commands.example.org [verbose] [no-effect-commands.example.org] host group priorities (descending): no-effect-commands.example.org [info] [no-effect-commands.example.org] will execute 2 command(s): (dry-run) @@ -227,10 +221,9 @@ will execute 2 command(s): (dry-run) { "no effect commands", false, - true, + false, []string{"no-effect-commands.example.org"}, - `[info] [no-effect-commands.example.org] remote helper upload in progress -[info] [no-effect-commands.example.org] + `[info] [no-effect-commands.example.org] executed 2 command(s): "echo this is a command": > this is a command @@ -241,10 +234,9 @@ executed 2 command(s): { "no effect commands (-log debug2)", false, - true, + false, []string{"-log", "debug2", "no-effect-commands.example.org"}, - `[info] [no-effect-commands.example.org] remote helper upload in progress -[verbose] [no-effect-commands.example.org] host groups: all no-effect-commands.example.org + `[verbose] [no-effect-commands.example.org] host groups: all no-effect-commands.example.org [verbose] [no-effect-commands.example.org] host group priorities (descending): no-effect-commands.example.org [verbose] [no-effect-commands.example.org] commands: running "/bin/sh" "-c" "echo this is a command" (no-effect-commands.example.org) [debug2] [no-effect-commands.example.org] commands: command output: @@ -262,10 +254,9 @@ executed 2 command(s): { "no effect commands failing (dry-run)", false, - true, + false, []string{"-n", "no-effect-commands-failing.example.org"}, - `[info] [no-effect-commands-failing.example.org] remote helper upload in progress -[info] [no-effect-commands-failing.example.org] + `[info] [no-effect-commands-failing.example.org] will execute 2 command(s): (dry-run) "echo this is a command" "echo failing; false" @@ -275,10 +266,9 @@ will execute 2 command(s): (dry-run) { "no effect commands failing (dry-run -log debug2)", false, - true, + false, []string{"-n", "-log", "debug2", "no-effect-commands-failing.example.org"}, - `[info] [no-effect-commands-failing.example.org] remote helper upload in progress -[verbose] [no-effect-commands-failing.example.org] host groups: all no-effect-commands-failing.example.org + `[verbose] [no-effect-commands-failing.example.org] host groups: all no-effect-commands-failing.example.org [verbose] [no-effect-commands-failing.example.org] host group priorities (descending): no-effect-commands-failing.example.org [info] [no-effect-commands-failing.example.org] will execute 2 command(s): (dry-run) @@ -290,10 +280,9 @@ will execute 2 command(s): (dry-run) { "no effect commands failing", false, - true, + false, []string{"no-effect-commands-failing.example.org"}, - `[info] [no-effect-commands-failing.example.org] remote helper upload in progress -[info] [no-effect-commands-failing.example.org] + `[info] [no-effect-commands-failing.example.org] executed 2 command(s): "echo this is a command": > this is a command @@ -306,10 +295,9 @@ executed 2 command(s): { "no effect commands failing (-log debug2)", false, - true, + false, []string{"-log", "debug2", "no-effect-commands-failing.example.org"}, - `[info] [no-effect-commands-failing.example.org] remote helper upload in progress -[verbose] [no-effect-commands-failing.example.org] host groups: all no-effect-commands-failing.example.org + `[verbose] [no-effect-commands-failing.example.org] host groups: all no-effect-commands-failing.example.org [verbose] [no-effect-commands-failing.example.org] host group priorities (descending): no-effect-commands-failing.example.org [verbose] [no-effect-commands-failing.example.org] commands: running "/bin/sh" "-c" "echo this is a command" (no-effect-commands-failing.example.org) [debug2] [no-effect-commands-failing.example.org] commands: command output: