Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GitHub connector test failure #310

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions ballerina/tests/test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ 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 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
}
function testCreateUserProject() returns error? {
User_projects_body body = {
name: "Test Project Created by Ballerina GitHub Connector",
Expand All @@ -162,7 +167,7 @@ function testCreateUserProject() returns error? {
}

@test:Config {
dependsOn: [testGetMilestone, testCreateUserProject]
dependsOn: [testGetMilestone]
}
function testCreateIssue() returns error? {
Repo_issues_body body = {
Expand Down Expand Up @@ -462,17 +467,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 {
Expand All @@ -497,6 +498,7 @@ function testUpdateProject() returns error? {
}

@test:Config {
enable: false,
dependsOn: [testUpdateProject, testCreateIssue]
}
function testDeleteProject() returns error? {
Expand Down
Loading