From 6b79fcaca22e8264f15c4852d564c3a196daf6a0 Mon Sep 17 00:00:00 2001 From: Thisaru Guruge Date: Tue, 10 Dec 2024 12:35:16 +0530 Subject: [PATCH] Re-enanble tests in code and disable from workflow (#2119) --- .github/workflows/build-timestamped-master.yml | 2 ++ .github/workflows/pull-request.yml | 3 ++- .../tests/01_dataloader_tests.bal | 4 +--- .../tests/30_graphiql_client.bal | 3 +-- .../modules/five/tests/01_subscription_five_tests.bal | 2 -- .../five/tests/02_subscription_with_context.bal | 2 -- .../five/tests/03_subscription_with_constraint.bal | 2 -- .../modules/four/tests/01_subscription_four_tests.bal | 7 ------- .../modules/one/tests/01_subscription_tests.bal | 8 -------- .../modules/six/tests/01_subscription_six_tests.bal | 3 +-- .../six/tests/01_subscription_with_interceptors.bal | 8 -------- .../three/tests/01_subscription_three_tests.bal | 8 -------- .../modules/two/tests/01_subscription_two_tests.bal | 10 +--------- ballerina/tests/03_subscriptions.bal | 1 - 14 files changed, 8 insertions(+), 55 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index 16fe43ae8..a7d352898 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -17,3 +17,5 @@ jobs: if: ${{ github.repository_owner == 'ballerina-platform' }} uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main secrets: inherit + with: + additional-build-flags: "-x test" diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 16c0689f2..e1a761fd8 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -13,4 +13,5 @@ jobs: uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit with: - additional-ubuntu-test-flags: "-Pdisable=subscriptions" + additional-ubuntu-test-flags: "-x test" + additional-windows-test-flags: "-x test" 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 3dad5e9dc..b018af9c1 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,8 +35,7 @@ isolated function testDataLoaderWithQuery() returns error? { @test:Config { groups: ["dataloader", "query"], - after: resetDispatchCounters, - enable: false + after: resetDispatchCounters } isolated function testDataLoaderWithDifferentAliasForSameField() returns error? { graphql:Client graphqlClient = check new ("localhost:9090/dataloader"); @@ -49,7 +48,6 @@ isolated function testDataLoaderWithDifferentAliasForSameField() returns error? } @test:Config { - enable: false, groups: ["subscriptions", "dataloader"], after: resetDispatchCounters } diff --git a/ballerina-tests/graphql-service-test-suite/tests/30_graphiql_client.bal b/ballerina-tests/graphql-service-test-suite/tests/30_graphiql_client.bal index 45466aacf..62fae15db 100644 --- a/ballerina-tests/graphql-service-test-suite/tests/30_graphiql_client.bal +++ b/ballerina-tests/graphql-service-test-suite/tests/30_graphiql_client.bal @@ -20,8 +20,7 @@ import ballerina/http; import ballerina/test; @test:Config { - groups: ["listener", "graphiql"], - enable: false + groups: ["listener", "graphiql"] } function testGraphiqlWithSamePathAsGraphQLService() returns error? { graphql:Error? result = basicListener.attach(graphiqlConfigService, "ballerina/graphiql"); diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal index e7237caa2..e8b26a43a 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/01_subscription_five_tests.bal @@ -20,7 +20,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["listener", "subscriptions"] } function testAttachServiceWithSubscriptionToHttp2BasedListener() returns error? { @@ -33,7 +32,6 @@ function testAttachServiceWithSubscriptionToHttp2BasedListener() returns error? } @test:Config { - enable: false, groups: ["listener", "subscriptions"] } function testAttachServiceWithSubscriptionToHttp1BasedListener() returns error? { diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/02_subscription_with_context.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/02_subscription_with_context.bal index 308bd271a..76b55fcc6 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/02_subscription_with_context.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/02_subscription_with_context.bal @@ -19,7 +19,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["context", "subscriptions"] } isolated function testContextWithSubscriptions() returns error? { @@ -41,7 +40,6 @@ isolated function testContextWithSubscriptions() returns error? { } @test:Config { - enable: false, groups: ["context", "subscriptions"] } isolated function testContextWithInvalidScopeInSubscriptions() returns error? { diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/03_subscription_with_constraint.bal b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/03_subscription_with_constraint.bal index 93210863a..752b0a158 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/03_subscription_with_constraint.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/five/tests/03_subscription_with_constraint.bal @@ -19,7 +19,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["constraints", "subscriptions"] } isolated function testSubscriptionWithConstraints() returns error? { @@ -34,7 +33,6 @@ isolated function testSubscriptionWithConstraints() returns error? { } @test:Config { - enable: false, groups: ["constraints", "subscriptions"] } isolated function testMultipleSubscriptionClientsWithConstraints() returns error? { diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal index 210c99cbb..64590962d 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/four/tests/01_subscription_four_tests.bal @@ -20,7 +20,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["subscriptions", "multiplexing"] } isolated function testSubscriptionMultiplexing() returns error? { @@ -56,7 +55,6 @@ isolated function testSubscriptionMultiplexing() returns error? { } @test:Config { - enable: false, groups: ["request_validation", "websocket", "subscriptions"] } isolated function testInvalidWebSocketRequestWithEmptyQuery() returns error? { @@ -71,7 +69,6 @@ isolated function testInvalidWebSocketRequestWithEmptyQuery() returns error? { } @test:Config { - enable: false, groups: ["request_validation", "websocket", "subscriptions"] } isolated function testInvalidWebSocketRequestWithInvalidQuery() returns error? { @@ -87,7 +84,6 @@ isolated function testInvalidWebSocketRequestWithInvalidQuery() returns error? { } @test:Config { - enable: false, groups: ["request_validation", "websocket", "subscriptions"] } isolated function testInvalidWebSocketRequestWithoutQuery() returns error? { @@ -102,7 +98,6 @@ isolated function testInvalidWebSocketRequestWithoutQuery() returns error? { } @test:Config { - enable: false, groups: ["request_validation", "websocket", "subscriptions"] } isolated function testInvalidVariableInWebSocketPayload() returns error? { @@ -119,7 +114,6 @@ isolated function testInvalidVariableInWebSocketPayload() returns error? { } @test:Config { - enable: false, groups: ["request_validation", "websocket", "subscriptions"] } isolated function testEmptyWebSocketPayload() returns error? { @@ -134,7 +128,6 @@ isolated function testEmptyWebSocketPayload() returns error? { } @test:Config { - enable: false, groups: ["request_validation", "websocket", "subscriptions"] } isolated function testInvalidWebSocketPayload() returns error? { diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal index ba6dd2046..8cf319786 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/one/tests/01_subscription_tests.bal @@ -19,7 +19,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testSubscription() returns error? { @@ -37,7 +36,6 @@ isolated function testSubscription() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testSubscriptionWithoutSubProtocol() returns error? { @@ -49,7 +47,6 @@ isolated function testSubscriptionWithoutSubProtocol() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testSubscriptionsWithMultipleOperations() returns error? { @@ -79,7 +76,6 @@ isolated function testSubscriptionsWithMultipleOperations() returns error? { } @test:Config { - enable: false, groups: ["records", "subscriptions"] } isolated function testSubscriptionWithRecords() returns error? { @@ -97,7 +93,6 @@ isolated function testSubscriptionWithRecords() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testQueryWithSameSubscriptionFieldName() returns error? { @@ -109,7 +104,6 @@ isolated function testQueryWithSameSubscriptionFieldName() returns error? { } @test:Config { - enable: false, groups: ["fragments", "subscriptions"] } isolated function testSubscriptionWithFragments() returns error? { @@ -127,7 +121,6 @@ isolated function testSubscriptionWithFragments() returns error? { } @test:Config { - enable: false, groups: ["union", "subscriptions"] } isolated function testSubscriptionWithUnionType() returns error? { @@ -145,7 +138,6 @@ isolated function testSubscriptionWithUnionType() returns error? { } @test:Config { - enable: false, groups: ["variables", "subscriptions"] } isolated function testSubscriptionWithVariables() returns error? { diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal index 750fe54bb..f4640c93b 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_six_tests.bal @@ -19,7 +19,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["subscriptions", "service"] } isolated function testConnectionClousureWhenPongNotRecived() returns error? { @@ -38,4 +37,4 @@ isolated function testConnectionClousureWhenPongNotRecived() returns error? { } test:assertTrue(response is error, "Expected connection clousure error"); test:assertEquals((response).message(), "Request timeout: Status code: 4408"); -} \ No newline at end of file +} diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal index d46809d56..f61e6575e 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/six/tests/01_subscription_with_interceptors.bal @@ -19,7 +19,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["interceptors", "subscriptions"] } isolated function testInterceptorsWithSubscriptionReturningScalar() returns error? { @@ -42,7 +41,6 @@ isolated function testInterceptorsWithSubscriptionReturningScalar() returns erro } @test:Config { - enable: false, groups: ["interceptors", "subscriptions", "records"] } isolated function testInterceptorsWithSubscriptionReturningRecord() returns error? { @@ -65,7 +63,6 @@ isolated function testInterceptorsWithSubscriptionReturningRecord() returns erro } @test:Config { - enable: false, groups: ["interceptors", "fragments", "subscriptions"] } isolated function testInterceptorsWithSubscriptionAndFragments() returns error? { @@ -88,7 +85,6 @@ isolated function testInterceptorsWithSubscriptionAndFragments() returns error? } @test:Config { - enable: false, groups: ["interceptors", "union", "subscriptions"] } isolated function testInterceptorsWithUnionTypeSubscription() returns error? { @@ -132,7 +128,6 @@ isolated function testInterceptorsWithUnionTypeSubscription() returns error? { } @test:Config { - enable: false, groups: ["interceptors", "subscriptions"] } isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns error? { @@ -155,7 +150,6 @@ isolated function testInterceptorsReturnBeforeResolverWithSubscription() returns } @test:Config { - enable: false, groups: ["interceptors", "subscriptions"] } isolated function testInterceptorsDestructiveModificationWithSubscription() returns error? { @@ -204,7 +198,6 @@ isolated function testInterceptorsDestructiveModificationWithSubscription() retu } @test:Config { - enable: false, groups: ["interceptors", "subscriptions"] } isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns error? { @@ -244,7 +237,6 @@ isolated function testInterceptorsWithSubscribersRunSimultaniously1() returns er } @test:Config { - enable: false, groups: ["interceptors", "union", "subscriptions"] } isolated function testInterceptorsWithSubscribersRunSimultaniously2() returns error? { diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal index b205db3cf..ecade6828 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/three/tests/01_subscription_three_tests.bal @@ -19,7 +19,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["subscriptions"] } function testAlreadyExistingSubscriber() returns error? { @@ -52,7 +51,6 @@ function testAlreadyExistingSubscriber() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testOnPing() returns error? { @@ -65,7 +63,6 @@ isolated function testOnPing() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testInvalidSubProtocolInSubscriptions() returns error? { @@ -80,7 +77,6 @@ isolated function testInvalidSubProtocolInSubscriptions() returns error? { } @test:Config { - enable: false, groups: ["subscriptions", "runtime_errors"] } isolated function testErrorsInStreams() returns error? { @@ -100,7 +96,6 @@ isolated function testErrorsInStreams() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testMultipleSubscriptionUsingSingleClient() returns error? { @@ -126,7 +121,6 @@ isolated function testMultipleSubscriptionUsingSingleClient() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testSubscriptionWithInvalidPayload() returns error? { @@ -143,7 +137,6 @@ isolated function testSubscriptionWithInvalidPayload() returns error? { } @test:Config { - enable: false, groups: ["subscriptions", "recrods", "service"] } isolated function testResolverReturingStreamOfRecordsWithServiceObjects() returns error? { @@ -159,7 +152,6 @@ isolated function testResolverReturingStreamOfRecordsWithServiceObjects() return } @test:Config { - enable: false, groups: ["subscriptions", "recrods", "service", "maps"] } isolated function testResolverReturingStreamOfRecordsWithMapOfServiceObjects() returns error? { diff --git a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal index 62dd04d7c..cced36cc2 100644 --- a/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal +++ b/ballerina-tests/graphql-subscription-test-suite/modules/two/tests/01_subscription_two_tests.bal @@ -19,7 +19,6 @@ import ballerina/test; import ballerina/websocket; @test:Config { - enable: false, groups: ["introspection", "typename", "subscriptions"] } isolated function testSubscriptionWithIntrospectionInFields() returns error? { @@ -35,7 +34,6 @@ isolated function testSubscriptionWithIntrospectionInFields() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testInvalidSubscription() returns error? { @@ -51,7 +49,6 @@ isolated function testInvalidSubscription() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testSubscriptionFunctionWithErrors() returns error? { @@ -73,7 +70,6 @@ isolated function testSubscriptionFunctionWithErrors() returns error? { } @test:Config { - enable: false, groups: ["service", "subscriptions"] } isolated function testSubscriptionWithServiceObjects() returns error? { @@ -92,7 +88,6 @@ isolated function testSubscriptionWithServiceObjects() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testSubscriptionWithMultipleClients() returns error? { @@ -118,8 +113,7 @@ isolated function testSubscriptionWithMultipleClients() returns error? { } @test:Config { - groups: ["subscriptions"], - enable: false + groups: ["subscriptions"] } isolated function testConnectionInitMessage() returns error? { string url = "ws://localhost:9091/subscriptions"; @@ -130,7 +124,6 @@ isolated function testConnectionInitMessage() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testInvalidMultipleConnectionInitMessages() returns error? { @@ -145,7 +138,6 @@ isolated function testInvalidMultipleConnectionInitMessages() returns error? { } @test:Config { - enable: false, groups: ["subscriptions"] } isolated function testUnauthorizedAccess() returns error? { diff --git a/ballerina/tests/03_subscriptions.bal b/ballerina/tests/03_subscriptions.bal index 844acede6..ec55bef6b 100644 --- a/ballerina/tests/03_subscriptions.bal +++ b/ballerina/tests/03_subscriptions.bal @@ -18,7 +18,6 @@ import ballerina/test; import graphql.parser; @test:Config { - enable: false, groups: ["subscriptions", "validation"], dataProvider: dataProviderSubscriptionValidation }