From f201abc198a0ac66d77578617fd91b354a8f0f08 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Mon, 9 Dec 2024 13:18:03 +0530 Subject: [PATCH 1/3] Revert "Add print statements in dataloader tests" This reverts commit 76840e5fea9112ca564f3cca2d74fe385800c3bc. --- .../tests/01_dataloader_tests.bal | 13 ------------- .../tests/02_dataloader_with_server_cache.bal | 9 ++------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal index bf8f6cf60..59ac7b763 100644 --- a/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal @@ -18,14 +18,12 @@ import ballerina/graphql; import ballerina/graphql_test_common as common; import ballerina/test; import ballerina/websocket; -import ballerina/io; @test:Config { groups: ["dataloader", "query"], after: resetDispatchCounters } isolated function testDataLoaderWithQuery() returns error? { - io:println("start testDataLoaderWithQuery"); graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); string document = check common:getGraphqlDocumentFromFile("dataloader_with_query"); json response = check graphqlClient->execute(document); @@ -33,7 +31,6 @@ isolated function testDataLoaderWithQuery() returns error? { common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(1); - io:println("end testDataLoaderWithQuery"); } @test:Config { @@ -41,7 +38,6 @@ isolated function testDataLoaderWithQuery() returns error? { after: resetDispatchCounters } isolated function testDataLoaderWithDifferentAliasForSameField() returns error? { - io:println("start testDataLoaderWithDifferentAliasForSameField"); graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); string document = check common:getGraphqlDocumentFromFile("dataloader_with_different_alias_for_same_field"); json response = check graphqlClient->execute(document); @@ -49,7 +45,6 @@ isolated function testDataLoaderWithDifferentAliasForSameField() returns error? common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(1); - io:println("end testDataLoaderWithDifferentAliasForSameField"); } @test:Config { @@ -80,7 +75,6 @@ isolated function testDataLoaderWithSubscription() returns error? { after: resetDispatchCounters } isolated function testDataLoaderWithMutation() returns error? { - io:println("start testDataLoaderWithMutation"); graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); string document = check common:getGraphqlDocumentFromFile("dataloader_with_mutation"); json response = check graphqlClient->execute(document); @@ -88,7 +82,6 @@ isolated function testDataLoaderWithMutation() returns error? { common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForUpdateAuthorLoader(1); assertDispatchCountForBookLoader(1); - io:println("end testDataLoaderWithMutation"); } @test:Config { @@ -96,7 +89,6 @@ isolated function testDataLoaderWithMutation() returns error? { after: resetDispatchCounters } isolated function testDataLoaderWithInterceptors() returns error? { - io:println("start testDataLoaderWithInterceptors"); graphql:Client graphqlClient = check new ("localhost:9090/dataloader_with_interceptor"); string document = check common:getGraphqlDocumentFromFile("dataloader_with_interceptor"); json response = check graphqlClient->execute(document); @@ -104,7 +96,6 @@ isolated function testDataLoaderWithInterceptors() returns error? { common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(1); - io:println("end testDataLoaderWithInterceptors"); } @test:Config { @@ -112,7 +103,6 @@ isolated function testDataLoaderWithInterceptors() returns error? { after: resetDispatchCounters } isolated function testBatchFunctionReturningErrors() returns error? { - io:println("start testBatchFunctionReturningErrors"); graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); string document = check common:getGraphqlDocumentFromFile("batch_function_returing_errors"); json response = check graphqlClient->execute(document); @@ -120,7 +110,6 @@ isolated function testBatchFunctionReturningErrors() returns error? { common:assertJsonValuesWithOrder(response, expectedPayload); assertDispatchCountForAuthorLoader(1); assertDispatchCountForBookLoader(0); - io:println("end testBatchFunctionReturningErrors"); } @test:Config { @@ -128,11 +117,9 @@ isolated function testBatchFunctionReturningErrors() returns error? { after: resetDispatchCounters } isolated function testBatchFunctionReturingNonMatchingNumberOfResults() returns error? { - io:println("start testBatchFunctionReturingNonMatchingNumberOfResults"); graphql:Client graphqlClient = check new ("localhost:9090/dataloader_with_faulty_batch_function"); string document = check common:getGraphqlDocumentFromFile("batch_function_returning_non_matcing_number_of_results"); json response = check graphqlClient->execute(document); json expectedPayload = check common:getJsonContentFromFile("batch_function_returning_non_matcing_number_of_results"); common:assertJsonValuesWithOrder(response, expectedPayload); - io:println("end testBatchFunctionReturingNonMatchingNumberOfResults"); } diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal index bf6c16591..be29b3698 100644 --- a/ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/02_dataloader_with_server_cache.bal @@ -16,14 +16,12 @@ import ballerina/graphql_test_common as common; import ballerina/test; -import ballerina/io; @test:Config { - groups: ["server_cache", "dataloader"], + groups: ["server_cache", "data_loader"], dataProvider: dataProviderServerCacheWithDataloader } isolated function testServerSideCacheWithDataLoader(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - io:println("start testServerSideCacheWithDataLoader"); string url = "http://localhost:9090/caching_with_dataloader"; string document = check common:getGraphqlDocumentFromFile(documentFile); foreach int i in 0 ..< resourceFileNames.length() { @@ -32,7 +30,6 @@ isolated function testServerSideCacheWithDataLoader(string documentFile, string[ common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } resetDispatchCounters(); - io:println("end testServerSideCacheWithDataLoader"); } function dataProviderServerCacheWithDataloader() returns map<[string, string[], json, string[]]> { @@ -44,11 +41,10 @@ function dataProviderServerCacheWithDataloader() returns map<[string, string[], } @test:Config { - groups: ["server_cache", "dataloader"], + groups: ["server_cache", "data_loader"], dataProvider: dataProviderServerCacheWithDataloaderInOperationalLevel } isolated function testServerSideCacheWithDataLoaderInOperationalLevel(string documentFile, string[] resourceFileNames, json variables = (), string[] operationNames = []) returns error? { - io:println("start testServerSideCacheWithDataLoaderInOperationalLevel"); string url = "http://localhost:9090/caching_with_dataloader_operational"; string document = check common:getGraphqlDocumentFromFile(documentFile); foreach int i in 0 ..< resourceFileNames.length() { @@ -57,7 +53,6 @@ isolated function testServerSideCacheWithDataLoaderInOperationalLevel(string doc common:assertJsonValuesWithOrder(actualPayload, expectedPayload); } resetDispatchCounters(); - io:println("end testServerSideCacheWithDataLoaderInOperationalLevel"); } function dataProviderServerCacheWithDataloaderInOperationalLevel() returns map<[string, string[], json, string[]]> { From 39adcc88645df4c1fa960b30ee39620a5220a891 Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Mon, 9 Dec 2024 13:19:13 +0530 Subject: [PATCH 2/3] Disable test testDataLoaderWithDifferentAliasForSameField --- .../tests/01_dataloader_tests.bal | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal index 59ac7b763..3dad5e9dc 100644 --- a/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal +++ b/ballerina-tests/graphql-dataloader-test-suite/tests/01_dataloader_tests.bal @@ -35,7 +35,8 @@ isolated function testDataLoaderWithQuery() returns error? { @test:Config { groups: ["dataloader", "query"], - after: resetDispatchCounters + after: resetDispatchCounters, + enable: false } isolated function testDataLoaderWithDifferentAliasForSameField() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); From 0a1d283551c9fba598ffca4d70bab01b1cdcfcdb Mon Sep 17 00:00:00 2001 From: MohamedSabthar Date: Mon, 9 Dec 2024 13:21:06 +0530 Subject: [PATCH 3/3] [Automated] Update the native jar versions --- .../graphql-dataloader-test-suite/Dependencies.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml b/ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml index 93f511fb8..905272c38 100644 --- a/ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml +++ b/ballerina-tests/graphql-dataloader-test-suite/Dependencies.toml @@ -114,7 +114,6 @@ dependencies = [ {org = "ballerina", name = "graphql"}, {org = "ballerina", name = "graphql_test_common"}, {org = "ballerina", name = "http"}, - {org = "ballerina", name = "io"}, {org = "ballerina", name = "test"}, {org = "ballerina", name = "websocket"} ] @@ -182,9 +181,6 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} ] -modules = [ - {org = "ballerina", packageName = "io", moduleName = "io"} -] [[package]] org = "ballerina"