diff options
| author | Paul Buetow <paul@buetow.org> | 2021-11-02 09:15:43 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2021-11-02 09:15:43 +0200 |
| commit | 479a1c1bff839f40d980fdbedcab80e2e73aeb58 (patch) | |
| tree | b3f92443b1e2641b807a5976504e9d49f8d2850e /integrationtests/dgrep_test.go | |
| parent | efeba5233c99a88dc1a49e44673ae56709814624 (diff) | |
Refactor integration tests. Also fix the dmap1 PIPE test
Diffstat (limited to 'integrationtests/dgrep_test.go')
| -rw-r--r-- | integrationtests/dgrep_test.go | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/integrationtests/dgrep_test.go b/integrationtests/dgrep_test.go index 5d68ca9..ab91dd6 100644 --- a/integrationtests/dgrep_test.go +++ b/integrationtests/dgrep_test.go @@ -8,16 +8,16 @@ import ( "github.com/mimecast/dtail/internal/config" ) -func TestDGrep(t *testing.T) { +func TestDGrep1(t *testing.T) { if !config.Env("DTAIL_INTEGRATION_TEST_RUN_MODE") { t.Log("Skipping") return } inFile := "mapr_testdata.log" - stdoutFile := "dgrep.stdout.tmp" - expectedStdoutFile := "dgrep.txt.expected" + outFile := "dgrep.stdout.tmp" + expectedOutFile := "dgrep1.txt.expected" - _, err := runCommand(context.TODO(), t, stdoutFile, + _, err := runCommand(context.TODO(), t, outFile, "../dgrep", "--plain", "--cfg", "none", @@ -29,12 +29,12 @@ func TestDGrep(t *testing.T) { return } - if err := compareFiles(t, stdoutFile, expectedStdoutFile); err != nil { + if err := compareFiles(t, outFile, expectedOutFile); err != nil { t.Error(err) return } - os.Remove(stdoutFile) + os.Remove(outFile) } func TestDGrep2(t *testing.T) { @@ -43,10 +43,10 @@ func TestDGrep2(t *testing.T) { return } inFile := "mapr_testdata.log" - stdoutFile := "dgrep2.stdout.tmp" - expectedStdoutFile := "dgrep2.txt.expected" + outFile := "dgrep2.stdout.tmp" + expectedOutFile := "dgrep2.txt.expected" - _, err := runCommand(context.TODO(), t, stdoutFile, + _, err := runCommand(context.TODO(), t, outFile, "../dgrep", "--plain", "--cfg", "none", @@ -59,24 +59,24 @@ func TestDGrep2(t *testing.T) { return } - if err := compareFiles(t, stdoutFile, expectedStdoutFile); err != nil { + if err := compareFiles(t, outFile, expectedOutFile); err != nil { t.Error(err) return } - os.Remove(stdoutFile) + os.Remove(outFile) } -func TestDGrepContext(t *testing.T) { +func TestDGrepContext1(t *testing.T) { if !config.Env("DTAIL_INTEGRATION_TEST_RUN_MODE") { t.Log("Skipping") return } inFile := "mapr_testdata.log" - stdoutFile := "dgrepcontext.stdout.tmp" - expectedStdoutFile := "dgrepcontext.txt.expected" + outFile := "dgrepcontext1.stdout.tmp" + expectedOutFile := "dgrepcontext1.txt.expected" - _, err := runCommand(context.TODO(), t, stdoutFile, + _, err := runCommand(context.TODO(), t, outFile, "../dgrep", "--plain", "--cfg", "none", @@ -89,12 +89,12 @@ func TestDGrepContext(t *testing.T) { return } - if err := compareFiles(t, stdoutFile, expectedStdoutFile); err != nil { + if err := compareFiles(t, outFile, expectedOutFile); err != nil { t.Error(err) return } - os.Remove(stdoutFile) + os.Remove(outFile) } func TestDGrepContext2(t *testing.T) { @@ -103,10 +103,10 @@ func TestDGrepContext2(t *testing.T) { return } inFile := "mapr_testdata.log" - stdoutFile := "dgrepcontext2.stdout.tmp" - expectedStdoutFile := "dgrepcontext2.txt.expected" + outFile := "dgrepcontext2.stdout.tmp" + expectedOutFile := "dgrepcontext2.txt.expected" - _, err := runCommand(context.TODO(), t, stdoutFile, + _, err := runCommand(context.TODO(), t, outFile, "../dgrep", "--plain", "--cfg", "none", @@ -119,10 +119,10 @@ func TestDGrepContext2(t *testing.T) { return } - if err := compareFiles(t, stdoutFile, expectedStdoutFile); err != nil { + if err := compareFiles(t, outFile, expectedOutFile); err != nil { t.Error(err) return } - os.Remove(stdoutFile) + os.Remove(outFile) } |
