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

why compiled tests are deleted? #551

Closed
spookyvale opened this issue Sep 21, 2018 · 1 comment
Closed

why compiled tests are deleted? #551

spookyvale opened this issue Sep 21, 2018 · 1 comment
Labels
misuse Problem due to misusage question

Comments

@spookyvale
Copy link
Contributor

spookyvale commented Sep 21, 2018

I am facing a strange issue while using DSpot when I run the amplification on several test classes using DSpot.amplifyAllTests().
I am using dhell as a test project.

After the amplification is performed on the first test class, the binary of the class is deleted.
(see Dspot.amplifyTest:201).
The point is that during the amplification of the subsequent class I get an error because the coverage is run against all classes. The whole command line is:

java -classpath C:\windows\system32\config\systemprofile\.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\windows\system32\config\systemprofile\.m2\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\PROGRAMS\Jenkins\workspace\dhell-compile\target\classes\;D:\PROGRAMS\Jenkins\workspace\dhell-compile\target\test-classes\;D:\PROGRAMS\Jenkins\plugins\dspot-jenkins-plugin\WEB-INF\lib\test-runner-1.1.2-SNAPSHOT.jar;D:\PROGRAMS\Jenkins\plugins\dspot-jenkins-plugin\WEB-INF\lib\org.jacoco.core-0.7.9.jar;D:\PROGRAMS\Jenkins\plugins\dspot-jenkins-plugin\WEB-INF\lib\asm-debug-all-5.2.jar;D:\PROGRAMS\Jenkins\war\WEB-INF\lib\commons-io-2.4.jar eu.stamp_project.testrunner.runner.coverage.JacocoRunner D:\PROGRAMS\Jenkins\workspace\dhell-compile\target\classes\;D:\PROGRAMS\Jenkins\workspace\dhell-compile\target\test-classes\ eu.stamp_project.examples.dhell.HelloAppTest;eu.stamp_project.examples.dhell.MyStorageTest

as you can see there are both HelloAppTest and MyStorageTest but when JacocoTestRunner tries to find the binary of the first one it fails, so the whole process fails.

I do not know if somehow the generated command line is wrong or the binary should not be deleted in the first place,
Strangely enough, I cannot reproduce the issue with the existing tests.
I am trying to write one that captures the issue.

@spookyvale spookyvale added question misuse Problem due to misusage labels Sep 21, 2018
@danglotb
Copy link
Member

danglotb commented Sep 21, 2018

Hi @spookyvale

Thank you for reporting this issue.

The deletion of the amplified binary is done on purpose since we do not want that the previous amplification impact next ones.

However, it might introduce a problem as you point it out.

I was able to reproduce the problem by modifying the example in the Main class by replacing:

dSpot.amplifyTest("example.TestSuiteExample");

by

dSpot.amplifyAllTests();

and

new JacocoCoverageSelector()

by

new CloverCoverageSelector()

You can launch with the following option: --example when you execute the Main.

I'll build a dedicated test method and debug it.

Thank you very much!

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

No branches or pull requests

2 participants