junit listTest syntax

irae
Messages : 1
Inscription : mar. août 27, 2019 5:37 am

junit listTest syntax

Message par irae »

Can't seem to find the proper syntax for running a junit job using the listTest property.
Job runs fine with "**.*"

If I run the job with operation of list and listTest is set to "**/*"
the testTree produces
{"timestamp":"2019-08-27T04:08:19.167+0000","name":"tests","contents":[{"name":"maven.main.bundle:tests.LoginTest","contents":[{"name":"runTest()","contents":null}]}]}

but If I run with operation of run and set listTest to "maven.main.bundle:tests.LoginTest" the job generates warnings.

[WARN] Illformated test specification maven.main.bundle:tests.LoginTest . Execution may be hazardous...
[WARN] Adding individual test specification maven.main.bundle:tests.LoginTest was impossible. Discarding it.

It seems to build the project but does not execute the junit test.
The project currently only has one junit test but will eventually have many more.
I would like to limit a job to a subset of tests in the future.

Thanks
Eli
dreni
Messages : 1
Inscription : ven. juin 23, 2023 5:50 pm

Re: junit listTest syntax

Message par dreni »

Did you fixed territorial ioit?
kasia_klepacka
Messages : 14
Inscription : lun. août 21, 2023 12:05 pm

Re: junit listTest syntax

Message par kasia_klepacka »

Hello,

We no longer maintain Squash TF. We strongly recommend using Squash Autom with Orchestrator for your automated testing needs, as support for Squash TF is no longer available. You will find the relevant information here: https://autom-devops-fr.doc.squashtest. ... index.html and https://opentestfactory.org/impl/index.html.

Best regards,

Kasia
llamawilling
Messages : 1
Inscription : lun. sept. 16, 2024 3:34 am

Re: junit listTest syntax

Message par llamawilling »

The listTest property expects a properly formatted test class and method name. Typically, the correct format for specifying a test class in JUnit is:
package.name:TestClassName
Or, to specify a particular test method within the class:
package.name:TestClassName#methodName
In your case, if you are targeting the LoginTest class, the syntax should be:
maven.main.bundle.tests:LoginTest
Alternatively, if you want to specify a method from the LoginTest class, for example runTest, the correct syntax would be:
maven.main.bundle.tests:LoginTest#runTest
Check if the package name is correctly specified. Based on your testTree, it looks like the package is maven.main.bundle.tests, so ensure that this matches the actual package structure in your project.
If you're using a command-line interface or a build tool like Maven or Gradle, ensure that the : and # characters are properly escaped, especially if you're running the job through a shell or script that might interpret these characters differently.
If you're trying to run all tests in the tests package, you could try using a wildcard for the test class, such as:
maven.main.bundle.tests:*
Or to run all test methods in the LoginTest class:
maven.main.bundle.tests:LoginTest#*
Répondre

Revenir à « Questions générales / General questions »