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

Introduce bal tool distribution tests #5159

Merged

Conversation

gayaldassanayake
Copy link
Contributor

@gayaldassanayake gayaldassanayake commented Jan 5, 2024

Purpose

$subject

The tests are passing in daily build - https://github.com/ballerina-platform/ballerina-distribution/actions/runs/7417999496
Gradle scan report - https://scans.gradle.com/s/tmwu2bun326n6/tests/task/:project-api-tests:test/details/org.ballerina.projectapi.BalToolTest?top-execution=1

Goals

Describe the solutions that this feature/fix will introduce to resolve the problems described above

Approach

Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here.

User stories

Summary of user stories addressed by this change>

Release note

Brief description of the new feature or bug fix as it will appear in the release notes

Documentation

Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact

Training

Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable

Certification

Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why.

Marketing

Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable

Automation tests

  • Unit tests

    Code coverage information

  • Integration tests

    Details about the test cases and coverage

Security checks

Samples

Provide high-level details about the samples related to this feature

Related PRs

List any other related PRs

Migrations (if applicable)

Describe migration steps and platforms on which migration has been tested

Test environment

List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested

Learning

Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem.

}

@Test(description = "Search a tool with tool id", groups = {"list"})
public void testSearchAToolWithId() throws IOException, InterruptedException {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a test case to verify the output when an invalid pattern is given to the search command. e.g disttest-0.1.0, disttest/0.1.0, disttest 0.1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are allowing any text other than tool id as well for bal tool search similar to bal search. Therefore we are passing the outputs that are not tool-ids to the central as well. Central checks if the text matches any orgs, names, keywords etc as well.

Assert.assertEquals(outputs.getRight(), readExpectedCmdOutsAsString("tool-execute-specific-help-1.0.0.txt"));
}

@Test(description = "Pull tool again with a specific version",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we pulling again?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we pull a specific version for the first time, it gets pulled and the version is set as the active version. When we pull the same version again, it simply notifies the user that this is already pulled and is the current version. I have added two tests to test this difference in behaviour.

@gayaldassanayake
Copy link
Contributor Author

gayaldassanayake commented Feb 2, 2024

Triggered the workflow https://github.com/ballerina-platform/ballerina-distribution/actions/runs/7753500599 to check on bal tool test status.

Copy link

sonarcloud bot commented Feb 2, 2024

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

20 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@azinneera azinneera added this pull request to the merge queue Feb 2, 2024
Merged via the queue into ballerina-platform:master with commit bc94105 Feb 2, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants