-
Notifications
You must be signed in to change notification settings - Fork 190
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
Introduce bal tool distribution tests #5159
Conversation
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Show resolved
Hide resolved
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Show resolved
Hide resolved
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Outdated
Show resolved
Hide resolved
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
@Test(description = "Search a tool with tool id", groups = {"list"}) | ||
public void testSearchAToolWithId() throws IOException, InterruptedException { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
b125563
to
0b92fd9
Compare
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Outdated
Show resolved
Hide resolved
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Outdated
Show resolved
Hide resolved
...-api-tests/src/test/resources/bal-tool/cmd-outputs/tool-list-with-multiple-tool-versions.txt
Outdated
Show resolved
Hide resolved
Assert.assertEquals(outputs.getRight(), readExpectedCmdOutsAsString("tool-execute-specific-help-1.0.0.txt")); | ||
} | ||
|
||
@Test(description = "Pull tool again with a specific version", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Show resolved
Hide resolved
project-api-tests/src/test/java/org/ballerina/projectapi/BalToolTest.java
Outdated
Show resolved
Hide resolved
Triggered the workflow https://github.com/ballerina-platform/ballerina-distribution/actions/runs/7753500599 to check on bal tool test status. |
4655a12
to
1f8fd34
Compare
1f8fd34
to
4224a9e
Compare
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 20 New issues |
bc94105
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
Approach
User stories
Release note
Documentation
Training
Certification
Marketing
Automation tests
Security checks
Samples
Related PRs
Migrations (if applicable)
Test environment
Learning