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

initializationError #42

Open
lapplislazuli opened this issue Jun 4, 2021 · 3 comments
Open

initializationError #42

lapplislazuli opened this issue Jun 4, 2021 · 3 comments

Comments

@lapplislazuli
Copy link

lapplislazuli commented Jun 4, 2021

Context

Hi,

i was trying Gzoltar on a few new projects, and when running listMethods I get a file filled with lines such as the following

JUNIT,org.apache.commons.lang3.ValidateTest$NotEmpty$WithCollection$WithMessage#initializationError

See all of them here apache-lang-tests.txt.
Gzoltar later fails due to the invalid test.txt.

This is (for me) a project-specific error - there are some projects that are working fine in the same setup.

Steps to Reproduce

I checked out apache commons lang 3.12, unzipped it and ran mvn test. This runs the tests as expected of which some are failing for me.

I have the gzoltar library & dependencies as jars.

I then run

java -cp ~/commons-lang3-3.12.0-src/:$path_to_gzoltaragent:$path_to_gzoltarcli:$path_to_gzoltar_junit.jar com.gzoltar.cli.Main listTestMethods ~/commons-lang3-3.12.0-src/

The gzoltar cli prints it's normal output, but the nearby tests.txt is faulty.

Expected behaviour

I would either

  • have a good test.txt
  • an error with suggestions why it did not success in running the tests

Environment:

  • MacOS Big Sur 11.2.3 (20D91)
  • Java 15
  • gzoltar v1.7.3-SNAPSHOT.202104160650

The error also occurs within an Ubuntu 18 + Java 11 Docker Container.

Further Comments

So, for me the maven tests fail, but that could be due to MacOS / my Java.
But ... Gzoltar can be run upon a completely succeeding project, right? It just has no faults to localize.

@jose
Copy link
Member

jose commented Jun 5, 2021

Hi @lapplislazuli,

To me, this looks like a miss configuration of the project under test. What's the output of

find ~/commons-lang3-3.12.0-src/ -type f

--
Best,
Jose

@lapplislazuli
Copy link
Author

Thanks for the Quick Response :)
Here is the output:
find.log

Looks quite normal to me - a lot of java files and the structure seems like normal maven too.

@jose
Copy link
Member

jose commented Jun 7, 2021

I've just confirmed the issue you reported.

It does seem to be due to the JUnit version used in Apache Commons Lang v3.12.0. At the moment, GZoltar is able to find and run JUnit test cases written in JUnit <= 4 but not in JUnit 5, which is the version used in the Apache Commons Lang v3.12.0 project. I've trying to port some of GZoltar's code (in particular the code to find and run unit test cases) to JUnit 5 (#25) but haven't found the time to do it.

--
Best,
Jose

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants