diff options
Diffstat (limited to 'integrationtests/dcat_test.go')
| -rw-r--r-- | integrationtests/dcat_test.go | 53 |
1 files changed, 25 insertions, 28 deletions
diff --git a/integrationtests/dcat_test.go b/integrationtests/dcat_test.go index 1966dc3..8477b0e 100644 --- a/integrationtests/dcat_test.go +++ b/integrationtests/dcat_test.go @@ -15,32 +15,24 @@ func TestDCat1(t *testing.T) { } inFiles := []string{"dcat1a.txt", "dcat1b.txt", "dcat1c.txt", "dcat1d.txt"} - + // Test both serverless and server modes modes := []struct { - name string + name string useServer bool }{ {"Serverless", false}, {"WithServer", true}, } - + for _, mode := range modes { t.Run(mode.name, func(t *testing.T) { - if mode.useServer { - // For server mode, just test once with small_test.txt - if err := testDCat1(t, "small_test.txt", mode.useServer); err != nil { + // Test all files in both modes now that channel buffer issue is fixed + for _, inFile := range inFiles { + if err := testDCat1(t, inFile, mode.useServer); err != nil { t.Error(err) return } - } else { - // For serverless mode, test all files - for _, inFile := range inFiles { - if err := testDCat1(t, inFile, mode.useServer); err != nil { - t.Error(err) - return - } - } } }) } @@ -48,11 +40,10 @@ func TestDCat1(t *testing.T) { func testDCat1(t *testing.T, inFile string, useServer bool) error { outFile := "dcat1.out" - + if useServer { - // Use small_test.txt for server testing to avoid channel overflow with large files - // The server has a hardcoded 100-line buffer limit that causes issues with larger files - return testDCatWithServer(t, []string{"--plain", "--cfg", "none", "small_test.txt"}, outFile, "small_test.txt") + // Now that channel buffer issue is fixed, use the actual test file + return testDCatWithServer(t, []string{"--plain", "--cfg", "none", inFile}, outFile, inFile) } else { _, err := runCommand(context.TODO(), t, outFile, "../dcat", "--plain", "--cfg", "none", inFile) @@ -85,18 +76,21 @@ func TestDCat2(t *testing.T) { // Test both serverless and server modes modes := []struct { - name string + name string useServer bool }{ {"Serverless", false}, {"WithServer", true}, } - + for _, mode := range modes { t.Run(mode.name, func(t *testing.T) { if mode.useServer { - // Skip server mode for TestDCat2 as it tests 100 file cats which exceeds channel buffer - t.Skip("Server mode skipped for TestDCat2 due to channel buffer limitations") + // Now that channel buffer issue is fixed, enable server mode for TestDCat2 + if err := testDCatWithServer(t, args, outFile, expectedFile); err != nil { + t.Error(err) + return + } } else { _, err := runCommand(context.TODO(), t, outFile, "../dcat", args...) if err != nil { @@ -127,13 +121,13 @@ func TestDCat3(t *testing.T) { // Test both serverless and server modes modes := []struct { - name string + name string useServer bool }{ {"Serverless", false}, {"WithServer", true}, } - + for _, mode := range modes { t.Run(mode.name, func(t *testing.T) { if mode.useServer { @@ -172,18 +166,21 @@ func TestDCatColors(t *testing.T) { // Test both serverless and server modes modes := []struct { - name string + name string useServer bool }{ {"Serverless", false}, {"WithServer", true}, } - + for _, mode := range modes { t.Run(mode.name, func(t *testing.T) { if mode.useServer { - // Skip server mode for TestDCatColors as it has 2754 lines which exceeds channel buffer - t.Skip("Server mode skipped for TestDCatColors due to channel buffer limitations (2754 lines > 100 buffer)") + // Now that channel buffer issue is fixed, enable server mode for TestDCatColors + if err := testDCatWithServer(t, args, outFile, expectedFile); err != nil { + t.Error(err) + return + } } else { _, err := runCommand(context.TODO(), t, outFile, "../dcat", args...) |
