diff options
| author | Paul Buetow <paul@buetow.org> | 2021-10-24 13:44:06 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-10-24 13:44:06 +0300 |
| commit | 87b6c47999f49c2deff42fdcc703c419b251bdbc (patch) | |
| tree | c5f0e418460c8987289cec4505eb88bb035d1dfe /integrationtests | |
| parent | 14959ffba46282dd7b8ada53db0dfc0e1b26ab2e (diff) | |
integration tests use a different known_hosts path and also dont read any external config files
Diffstat (limited to 'integrationtests')
| -rw-r--r-- | integrationtests/dcat_test.go | 6 | ||||
| -rw-r--r-- | integrationtests/dgrep_test.go | 28 | ||||
| -rw-r--r-- | integrationtests/dmap_test.go | 4 | ||||
| -rw-r--r-- | integrationtests/dtail_test.go | 6 | ||||
| -rw-r--r-- | integrationtests/dtailhealth_test.go | 2 |
5 files changed, 35 insertions, 11 deletions
diff --git a/integrationtests/dcat_test.go b/integrationtests/dcat_test.go index dc2234f..76b7c3b 100644 --- a/integrationtests/dcat_test.go +++ b/integrationtests/dcat_test.go @@ -17,7 +17,7 @@ func TestDCat(t *testing.T) { stdoutFile := "dcat.out" _, err := runCommand(context.TODO(), t, stdoutFile, - "../dcat", "--spartan", testdataFile) + "../dcat", "--spartan", "--cfg", "none", testdataFile) if err != nil { t.Error(err) @@ -40,7 +40,7 @@ func TestDCat2(t *testing.T) { expectedFile := "dcat2.txt.expected" stdoutFile := "dcat2.out" - args := []string{"--spartan", "--logLevel", "error"} + args := []string{"--spartan", "--logLevel", "error", "--cfg", "none"} // Cat file 100 times in one session. for i := 0; i < 100; i++ { @@ -70,7 +70,7 @@ func TestDCatColors(t *testing.T) { expectedFile := "dcatcolors.expected" _, err := runCommand(context.TODO(), t, stdoutFile, - "../dcat", "--logLevel", "error", testdataFile) + "../dcat", "--logLevel", "error", "--cfg", "none", testdataFile) if err != nil { t.Error(err) diff --git a/integrationtests/dgrep_test.go b/integrationtests/dgrep_test.go index 8fe0a49..26abc2f 100644 --- a/integrationtests/dgrep_test.go +++ b/integrationtests/dgrep_test.go @@ -18,7 +18,11 @@ func TestDGrep(t *testing.T) { expectedStdoutFile := "dgrep.txt.expected" _, err := runCommand(context.TODO(), t, stdoutFile, - "../dgrep", "--spartan", "--grep", "20211002-071947", inFile) + "../dgrep", + "--spartan", + "--cfg", "none", + "--grep", "20211002-071947", + inFile) if err != nil { t.Error(err) @@ -43,7 +47,12 @@ func TestDGrep2(t *testing.T) { expectedStdoutFile := "dgrep2.txt.expected" _, err := runCommand(context.TODO(), t, stdoutFile, - "../dgrep", "-spartan", "--grep", "20211002-071947", "--invert", inFile) + "../dgrep", + "--spartan", + "--cfg", "none", + "--grep", "20211002-071947", + "--invert", + inFile) if err != nil { t.Error(err) @@ -68,8 +77,12 @@ func TestDGrepContext(t *testing.T) { expectedStdoutFile := "dgrepcontext.txt.expected" _, err := runCommand(context.TODO(), t, stdoutFile, - "../dgrep", "--spartan", "--grep", "20211002-071947", - "-after", "3", "-before", "3", inFile) + "../dgrep", + "--spartan", + "--cfg", "none", + "--grep", "20211002-071947", + "--after", "3", + "--before", "3", inFile) if err != nil { t.Error(err) @@ -94,7 +107,12 @@ func TestDGrepContext2(t *testing.T) { expectedStdoutFile := "dgrepcontext2.txt.expected" _, err := runCommand(context.TODO(), t, stdoutFile, - "../dgrep", "--spartan", "--grep", "20211002", "-max", "3", inFile) + "../dgrep", + "--spartan", + "--cfg", "none", + "--grep", "20211002", + "--max", "3", + inFile) if err != nil { t.Error(err) diff --git a/integrationtests/dmap_test.go b/integrationtests/dmap_test.go index 2de679b..53b8574 100644 --- a/integrationtests/dmap_test.go +++ b/integrationtests/dmap_test.go @@ -28,6 +28,7 @@ func TestDMap(t *testing.T) { defer cancel() stdoutCh, stderrCh, cmdErrCh, err := startCommand(ctx, t, "../dmap", + "--cfg", "none", "--query", query, "--logger", "stdout", "--logLevel", "error", @@ -71,7 +72,7 @@ func TestDMap2(t *testing.T) { "outfile %s", csvFile) _, err := runCommand(context.TODO(), t, stdoutFile, - "../dmap", "--query", query, inFile) + "../dmap", "--query", query, "--cfg", "none", inFile) if err != nil { t.Error(err) return @@ -112,6 +113,7 @@ func TestDMap3(t *testing.T) { stdoutCh, stderrCh, cmdErrCh, err := startCommand(ctx, t, "../dmap", "--query", query, + "--cfg", "none", "--logger", "stdout", "--logLevel", "info", "--noColor", diff --git a/integrationtests/dtail_test.go b/integrationtests/dtail_test.go index 56008df..6814c42 100644 --- a/integrationtests/dtail_test.go +++ b/integrationtests/dtail_test.go @@ -34,8 +34,9 @@ func TestDTailWithServer(t *testing.T) { serverCh, _, _, err := startCommand(ctx, t, "../dserver", + "--cfg", "none", "--logger", "stdout", - "--logLevel", "trace", + "--logLevel", "info", "--bindAddress", "localhost", "--port", "4243", "--relaxedAuth", @@ -48,8 +49,9 @@ func TestDTailWithServer(t *testing.T) { // MAYBETODO: In testmode, never read a config file (use none for all commands) clientCh, _, _, err := startCommand(ctx, t, "../dtail", + "--cfg", "none", "--logger", "stdout", - "--logLevel", "trace", + "--logLevel", "info", "--servers", "localhost:4243", "--files", followFile, "--grep", "Hello", diff --git a/integrationtests/dtailhealth_test.go b/integrationtests/dtailhealth_test.go index 8c0918f..0dc177c 100644 --- a/integrationtests/dtailhealth_test.go +++ b/integrationtests/dtailhealth_test.go @@ -69,6 +69,7 @@ func TestDTailHealthCheck3(t *testing.T) { _, _, _, err := startCommand(ctx, t, "../dserver", + "--cfg", "none", "--logger", "stdout", "--logLevel", "trace", "--bindAddress", "localhost", @@ -79,6 +80,7 @@ func TestDTailHealthCheck3(t *testing.T) { return } + // TODO: Get unique test port number. _, err = runCommandRetry(ctx, t, 10, stdoutFile, "../dtailhealth", "--server", "localhost:4242") if err != nil { |
