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

[Bug]: Issue with running new tests in ballerina-cli #42339

Open
RadCod3 opened this issue Mar 19, 2024 · 1 comment
Open

[Bug]: Issue with running new tests in ballerina-cli #42339

RadCod3 opened this issue Mar 19, 2024 · 1 comment
Labels
Area/CLI-BuildTools Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug

Comments

@RadCod3
Copy link

RadCod3 commented Mar 19, 2024

Description

As part of the first task of #42124, I added tests for my additions to ballerina-cli #42236. However, those tests do not seem to run on the github actions and when I tried running ./gradlew :ballerina-cli:test locally that too doesn't run them. Whats even more interesting is that they do indeed run when I comment out certain tests in the testng.xml file in ballerina-cli.

  1. Adding my tests after the existing ones like below,
<suite name="commands-test-suite">
    <test name="command-tests" preserve-order="true">
        <classes>
            <class name="io.ballerina.cli.cmd.AddCommandTest" />
            <class name="io.ballerina.cli.cmd.BaseCommandTest" />
            <class name="io.ballerina.cli.cmd.BuildCommandTest" />
                                      :
                                      :
            <class name="io.ballerina.cli.cmd.ToolCommandTest"/>
            <class name="io.ballerina.cli.diagnostics.AnnotateDiagnosticsTest" />
            <class name="io.ballerina.cli.diagnostics.DiagnosticAnnotationTest" />
        </classes>
    </test>
</suite>

Does not run them
image
https://scans.gradle.com/s/ph23glwnw5v4k/tests/overview?collapse-all&toggled=WyI6YmFsbGVyaW5hLWNsaTp0ZXN0LTAiXQ
Commenting out TestCommandTest in the testng.xml file runs my tests but they fail and so do some other tests.
image
https://scans.gradle.com/s/jghd5wnt3ykc2/tests/overview?collapse-all&toggled=WyI6YmFsbGVyaW5hLWNsaTp0ZXN0LTAiXQ
2. Adding my tests in a serparate test tag doesn't run them either,

<suite name="commands-test-suite">
    <test name="command-tests" preserve-order="true">
        <classes>
            <class name="io.ballerina.cli.cmd.AddCommandTest" />
                                      :
                                      :
            <class name="io.ballerina.cli.cmd.ToolCommandTest"/>
        </classes>
    </test>
    <test name="diagnostics-tests" preserve-order="true">
    <classes>
        <class name="io.ballerina.cli.diagnostics.AnnotateDiagnosticsTest" />
        <class name="io.ballerina.cli.diagnostics.DiagnosticAnnotationTest" />
    </classes>
    </test>
</suite>

Here too when you comment out TestCommandTest, it runs the tests I need but they fail.

Sometimes when I repeat ./gradlew clean :ballerina-cli:test --scan it doesn't run any of the tests as well.

In both of the above scenarios however, running the tests I wrote by specifying them using ./gradlew clean :ballerina-cli:test --scan --tests "io.ballerina.cli.diagnostics.AnnotateDiagnosticsTest" runs them successfully.
https://scans.gradle.com/s/fhcamynpswjou/tests/overview

Steps to Reproduce

No response

Affected Version(s)

No response

OS, DB, other environment details and versions

No response

Related area

-> Other Area

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

@RadCod3 RadCod3 added Type/Bug Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Area/CLI-BuildTools labels Mar 19, 2024
@RadCod3
Copy link
Author

RadCod3 commented Mar 22, 2024

Found a workaround for this by including the newly added tests before the old tests like so,

<suite name="commands-test-suite">
    <test name="diagnostics-tests" preserve-order="true">
        <packages>
            <package name="io.ballerina.cli.diagnostics"/>
        </packages>
    </test>
    <test name="command-tests" preserve-order="true">
        <classes>
            <class name="io.ballerina.cli.cmd.AddCommandTest" />
                                      :
                                      :
            <class name="io.ballerina.cli.cmd.RunBuildToolsTaskTest"/>
        </classes>
    </test>
</suite>

Which runs the tests I added AnnotateDiagnosticsTest and DiagnosticAnnotationTest
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area/CLI-BuildTools Team/DevTools Ballerina Developer Tooling ( CLI, Test FW, Package Management, OpenAPI, APIDocs ) Type/Bug
Projects
None yet
Development

No branches or pull requests

1 participant