From 9a3a005c916479faef417f8e9437f2bf1b38ecdd Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 8 Dec 2021 10:19:42 +0000 Subject: add where clause integration test to dmap1, all mapreduce token fields are lower case --- integrationtests/dmap1b.csv.query.expected | 1 + integrationtests/dmap_test.go | 31 ++++++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 integrationtests/dmap1b.csv.query.expected (limited to 'integrationtests') 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 + } } } -- cgit v1.2.3