summaryrefslogtreecommitdiff
path: root/integrationtests/channelless_test.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-18 09:10:52 +0300
committerPaul Buetow <paul@buetow.org>2025-06-18 09:10:52 +0300
commit67a6b9d8e8e8dc83d5ea3e5859e631a0dfa9dabe (patch)
treee93c3e80959e78655f8ae18a97c9fa0d081b81fb /integrationtests/channelless_test.go
parent29a5d827019d839344f5a2c85358b9f00abb27ca (diff)
Complete channelless migration for DTail operations
- Implement channelless MapReduce with streaming aggregation - Add channelless tail with proper file following capability - Fix TestDTailWithServer by implementing ServerHandlerWriter for client-server mode - Add proper serverless mode detection for standalone operations - Remove temporary benchmark scripts - All integration tests now pass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'integrationtests/channelless_test.go')
-rw-r--r--integrationtests/channelless_test.go104
1 files changed, 104 insertions, 0 deletions
diff --git a/integrationtests/channelless_test.go b/integrationtests/channelless_test.go
new file mode 100644
index 0000000..41845df
--- /dev/null
+++ b/integrationtests/channelless_test.go
@@ -0,0 +1,104 @@
+package integrationtests
+
+import (
+ "context"
+ "os"
+ "testing"
+
+ "github.com/mimecast/dtail/internal/config"
+)
+
+func TestDGrepChannelless(t *testing.T) {
+ if !config.Env("DTAIL_INTEGRATION_TEST_RUN_MODE") {
+ t.Log("Skipping")
+ return
+ }
+
+ // Test dgrep with channelless mode (now the default)
+ inFile := "mapr_testdata.log"
+ outFile := "dgrepchannelless.stdout.tmp"
+ expectedOutFile := "dgrepcontext1.txt.expected"
+
+ _, err := runCommand(context.TODO(), t, outFile,
+ "../dgrep",
+ "--plain",
+ "--cfg", "none",
+ "--grep", "1002-071947",
+ "--after", "3",
+ "--before", "3",
+ inFile)
+
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ if err := compareFiles(t, outFile, expectedOutFile); err != nil {
+ t.Error(err)
+ return
+ }
+
+ os.Remove(outFile)
+}
+
+func TestDCatChannelless(t *testing.T) {
+ if !config.Env("DTAIL_INTEGRATION_TEST_RUN_MODE") {
+ t.Log("Skipping")
+ return
+ }
+
+ // Test dcat with channelless mode (now the default)
+ inFile := "dcat1a.txt"
+ outFile := "dcatchannelless.stdout.tmp"
+
+ _, err := runCommand(context.TODO(), t, outFile,
+ "../dcat",
+ "--plain",
+ "--cfg", "none",
+ inFile)
+
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ if err := compareFiles(t, outFile, inFile); err != nil {
+ t.Error(err)
+ return
+ }
+
+ os.Remove(outFile)
+}
+
+func TestChannellessMode(t *testing.T) {
+ if !config.Env("DTAIL_INTEGRATION_TEST_RUN_MODE") {
+ t.Log("Skipping")
+ return
+ }
+
+ // Test that channelless mode (now default) works correctly
+
+ // Test grep
+ inFile := "mapr_testdata.log"
+ outFile := "grep_channelless.tmp"
+ expectedOutFile := "dgrep1.txt.expected"
+
+ _, err := runCommand(context.TODO(), t, outFile,
+ "../dgrep",
+ "--plain",
+ "--cfg", "none",
+ "--grep", "1002-071947",
+ inFile)
+
+ if err != nil {
+ t.Error(err)
+ return
+ }
+
+ if err := compareFiles(t, outFile, expectedOutFile); err != nil {
+ t.Error(err)
+ return
+ }
+
+ os.Remove(outFile)
+} \ No newline at end of file