From dd4ac0ea912a3682d691254716b9c5263774d93b Mon Sep 17 00:00:00 2001 From: Azeem Muzammil Date: Mon, 26 Aug 2024 12:18:59 +0530 Subject: [PATCH 1/2] Fix GitHub connector test failure --- ballerina/tests/test.bal | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 4675a2a..6b4ff94 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -151,7 +151,11 @@ function testGetMilestones() returns error? { // Instead an already created project will be updated and deleted. // The reason is Github seems to be adding project async mannger. // Sometimes immediate call does not return the project when we try to get the created project. -@test:Config {} +// TODO: Re-enable `testCreateUserProject` and `testDeleteProject` if and when the user changes as for this user +// we can no loger create projects as it is disabled. +@test:Config { + enable: false +} function testCreateUserProject() returns error? { User_projects_body body = { name: "Test Project Created by Ballerina GitHub Connector", @@ -162,7 +166,7 @@ function testCreateUserProject() returns error? { } @test:Config { - dependsOn: [testGetMilestone, testCreateUserProject] + dependsOn: [testGetMilestone] } function testCreateIssue() returns error? { Repo_issues_body body = { @@ -462,17 +466,13 @@ function testDeletePullRequestReview() returns error? { test:assertTrue(response.id == createdPullRequestReviewIdWithPendingState); } -@test:Config { - dependsOn: [testCreateUserProject] -} +@test:Config {} function testGetOrgProjectList() returns error? { Project[] response = check github->/orgs/["wso2-enterprise"]/projects(); test:assertTrue(response[0] is Project); } -@test:Config { - dependsOn: [testCreateUserProject] -} +@test:Config {} function testGetLatestUserProject() returns error? { Project[] response = check github->/users/[testUsername]/projects(); if response.length() > 0 { @@ -497,6 +497,7 @@ function testUpdateProject() returns error? { } @test:Config { + enable: false, dependsOn: [testUpdateProject, testCreateIssue] } function testDeleteProject() returns error? { From ab823becce8cff6e6a932c9f84a411ae058b9537 Mon Sep 17 00:00:00 2001 From: Azeem Muzammil Date: Mon, 26 Aug 2024 13:06:28 +0530 Subject: [PATCH 2/2] Address review comments --- ballerina/tests/test.bal | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ballerina/tests/test.bal b/ballerina/tests/test.bal index 6b4ff94..01a2a82 100644 --- a/ballerina/tests/test.bal +++ b/ballerina/tests/test.bal @@ -151,8 +151,9 @@ function testGetMilestones() returns error? { // Instead an already created project will be updated and deleted. // The reason is Github seems to be adding project async mannger. // Sometimes immediate call does not return the project when we try to get the created project. -// TODO: Re-enable `testCreateUserProject` and `testDeleteProject` if and when the user changes as for this user -// we can no loger create projects as it is disabled. +// TODO: Re-enable `testCreateUserProject` and `testDeleteProject` if and when the test-user is changed as for this user +// project creation is disabled due to rate limit. +// An issue is created to track this: https://github.com/ballerina-platform/ballerina-library/issues/6917 @test:Config { enable: false }