diff options
| author | Paul Buetow <pbuetow@mimecast.com> | 2021-10-19 19:01:12 +0300 |
|---|---|---|
| committer | Paul Buetow <pbuetow@mimecast.com> | 2021-10-19 19:03:03 +0300 |
| commit | 860c41441b3bcf542b5701ae2257812879ce47b4 (patch) | |
| tree | 9940e557b86e346cc3989c45e4f512f58dab850b /integrationtests | |
| parent | 10314cef906fd9b73e003be69c2f6b7b3d66570c (diff) | |
Set DTAIL_RUN_INTEGRATIONT_TEST to yes for integration tests
Diffstat (limited to 'integrationtests')
| -rw-r--r-- | integrationtests/dcat_test.go | 12 | ||||
| -rw-r--r-- | integrationtests/dgrep_test.go | 18 | ||||
| -rw-r--r-- | integrationtests/dmap_test.go | 14 | ||||
| -rw-r--r-- | integrationtests/dtail_test.go | 10 | ||||
| -rw-r--r-- | integrationtests/dtailhealth_test.go | 14 |
5 files changed, 68 insertions, 0 deletions
diff --git a/integrationtests/dcat_test.go b/integrationtests/dcat_test.go index afcb94c..2516867 100644 --- a/integrationtests/dcat_test.go +++ b/integrationtests/dcat_test.go @@ -4,9 +4,15 @@ import ( "context" "os" "testing" + + "github.com/mimecast/dtail/internal/config" ) func TestDCat(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } testdataFile := "dcat.txt" stdoutFile := "dcat.out" @@ -27,6 +33,9 @@ func TestDCat(t *testing.T) { } func TestDCat2(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + return + } testdataFile := "dcat2.txt" expectedFile := "dcat2.txt.expected" stdoutFile := "dcat2.out" @@ -55,6 +64,9 @@ func TestDCat2(t *testing.T) { // TODO: The test currently fails as there is a hostname in the output. What needs // to be done is to ignore the hostnames in the output (which is field 2 of the output) func TestDCatColors(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + return + } testdataFile := "dcatcolors.txt" stdoutFile := "dcatcolors.out" expectedFile := "dcatcolors.expected" diff --git a/integrationtests/dgrep_test.go b/integrationtests/dgrep_test.go index b63ac45..8fe0a49 100644 --- a/integrationtests/dgrep_test.go +++ b/integrationtests/dgrep_test.go @@ -4,9 +4,15 @@ import ( "context" "os" "testing" + + "github.com/mimecast/dtail/internal/config" ) func TestDGrep(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } inFile := "mapr_testdata.log" stdoutFile := "dgrep.stdout.tmp" expectedStdoutFile := "dgrep.txt.expected" @@ -28,6 +34,10 @@ func TestDGrep(t *testing.T) { } func TestDGrep2(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } inFile := "mapr_testdata.log" stdoutFile := "dgrep2.stdout.tmp" expectedStdoutFile := "dgrep2.txt.expected" @@ -49,6 +59,10 @@ func TestDGrep2(t *testing.T) { } func TestDGrepContext(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } inFile := "mapr_testdata.log" stdoutFile := "dgrepcontext.stdout.tmp" expectedStdoutFile := "dgrepcontext.txt.expected" @@ -71,6 +85,10 @@ func TestDGrepContext(t *testing.T) { } func TestDGrepContext2(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } inFile := "mapr_testdata.log" stdoutFile := "dgrepcontext2.stdout.tmp" expectedStdoutFile := "dgrepcontext2.txt.expected" diff --git a/integrationtests/dmap_test.go b/integrationtests/dmap_test.go index a112456..b3c048a 100644 --- a/integrationtests/dmap_test.go +++ b/integrationtests/dmap_test.go @@ -5,9 +5,15 @@ import ( "fmt" "os" "testing" + + "github.com/mimecast/dtail/internal/config" ) func TestDMap(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } inFile := "mapr_testdata.log" stdoutFile := "dmap.stdout.tmp" csvFile := "dmap.csv.tmp" @@ -42,6 +48,10 @@ func TestDMap(t *testing.T) { } func TestDMap2(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } inFile := "mapr_testdata.log" stdoutFile := "dmap2.stdout.tmp" csvFile := "dmap2.csv.tmp" @@ -75,6 +85,10 @@ func TestDMap2(t *testing.T) { } func TestDMap3(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } inFile := "mapr_testdata.log" stdoutFile := "dmap3.stdout.tmp" csvFile := "dmap3.csv.tmp" diff --git a/integrationtests/dtail_test.go b/integrationtests/dtail_test.go index 4af7401..c6d0107 100644 --- a/integrationtests/dtail_test.go +++ b/integrationtests/dtail_test.go @@ -7,9 +7,15 @@ import ( "strings" "testing" "time" + + "github.com/mimecast/dtail/internal/config" ) func TestDTailWithServer(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } followFile := "dtail.follow.tmp" greetings := []string{"world!", "sol-system!", "milky-way!", "universe!", "multiverse!"} @@ -122,6 +128,10 @@ func TestDTailWithServer(t *testing.T) { } func TestDTailColorTable(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } stdoutFile := "dtailcolortable.stdout.tmp" expectedStdoutFile := "dtailcolortable.expected" diff --git a/integrationtests/dtailhealth_test.go b/integrationtests/dtailhealth_test.go index 87ed648..8c0918f 100644 --- a/integrationtests/dtailhealth_test.go +++ b/integrationtests/dtailhealth_test.go @@ -5,9 +5,15 @@ import ( "fmt" "os" "testing" + + "github.com/mimecast/dtail/internal/config" ) func TestDTailHealthCheck(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } stdoutFile := "dtailhealth.stdout.tmp" expectedStdoutFile := "dtailhealth.expected" @@ -26,6 +32,10 @@ func TestDTailHealthCheck(t *testing.T) { } func TestDTailHealthCheck2(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } stdoutFile := "dtailhealth2.stdout.tmp" expectedStdoutFile := "dtailhealth2.expected" @@ -47,6 +57,10 @@ func TestDTailHealthCheck2(t *testing.T) { } func TestDTailHealthCheck3(t *testing.T) { + if !config.Env("DTAIL_RUN_INTEGRATION_TESTS") { + t.Log("Skipping") + return + } stdoutFile := "dtailhealth3.stdout.tmp" expectedStdoutFile := "dtailhealth3.expected" |
