summaryrefslogtreecommitdiff
path: root/integrationtests
diff options
context:
space:
mode:
authorPaul Buetow <pbuetow@mimecast.com>2021-12-08 10:19:42 +0000
committerPaul Buetow <pbuetow@mimecast.com>2021-12-08 10:19:42 +0000
commit9a3a005c916479faef417f8e9437f2bf1b38ecdd (patch)
treeba6463e4c44eb623552bc8adfe011b78a291da6b /integrationtests
parente70adfe0d309d511ae7598683003c92795192fe1 (diff)
add where clause integration test to dmap1, all mapreduce token fields are lower case
Diffstat (limited to 'integrationtests')
-rw-r--r--integrationtests/dmap1b.csv.query.expected1
-rw-r--r--integrationtests/dmap_test.go31
2 files changed, 20 insertions, 12 deletions
diff --git a/integrationtests/dmap1b.csv.query.expected b/integrationtests/dmap1b.csv.query.expected
new file mode 100644
index 0000000..f6b2d8b
--- /dev/null
+++ b/integrationtests/dmap1b.csv.query.expected
@@ -0,0 +1 @@
+from STATS select count($line),last($time),avg($goroutines),min(concurrentConnections),max(lifetimeConnections) group by $hostname where lifetimeConnections >= 3 outfile dmap1b.csv.tmp \ No newline at end of file
diff --git a/integrationtests/dmap_test.go b/integrationtests/dmap_test.go
index ec14cfb..e408b74 100644
--- a/integrationtests/dmap_test.go
+++ b/integrationtests/dmap_test.go
@@ -15,19 +15,26 @@ func TestDMap1(t *testing.T) {
return
}
- query := fmt.Sprintf("from STATS select count($line),last($time)," +
- "avg($goroutines),min(concurrentConnections),max(lifetimeConnections) " +
- "group by $hostname")
-
- t.Log("Testing dmap with input file")
- if err := testDmap1(t, query, "a", false); err != nil {
- t.Error(err)
- return
+ testTable := map[string]string{
+ "a": "from STATS select count($line),last($time)," +
+ "avg($goroutines),min(concurrentConnections),max(lifetimeConnections) " +
+ "group by $hostname",
+ "b": "from STATS select count($line),last($time)," +
+ "avg($goroutines),min(concurrentConnections),max(lifetimeConnections) " +
+ "group by $hostname where lifetimeConnections >= 3",
}
- t.Log("Testing dmap with stdin input pipe")
- if err := testDmap1(t, query, "a", true); err != nil {
- t.Error(err)
- return
+
+ for subtestName, query := range testTable {
+ t.Log("Testing dmap with input file")
+ if err := testDmap1(t, query, subtestName, false); err != nil {
+ t.Error(err)
+ return
+ }
+ t.Log("Testing dmap with stdin input pipe")
+ if err := testDmap1(t, query, subtestName, true); err != nil {
+ t.Error(err)
+ return
+ }
}
}