Implement the new test-runner's API usage#35
Implement the new test-runner's API usage#35martinezmatias merged 9 commits intoASSERT-KTH:masterfrom
Conversation
|
Another important issue is that the test suite is failing (at least locally) when the tests are run all together due to:
It's really weird, specially because Have you ever come across an issue like this? (maybe @danglotb?) |
Does it mean it should the necessary to remove this if condition on |
In this case, we would add a new option to |
An option would be fine, which by default does not compute coverage of constructor. Otherwise the change will break the test-runner. |
Alright. I suggest we do it separately from STAMP-project/test-runner#95, so it doesn't get bigger than it already is. |
Fine. |
|
Hello, I remember to have already the mentioned issue: Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/platform/launcher/TestExecutionListenerAFAIR, the classpath was missing a dependency like <dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.3.2</version>
</dependency>This happens when you run the test suite of |
Hi @danglotb
It happens when I run the whole test suite, and sometimes when I run test methods individually. For example: # set up test projects
./.github/install_examples.sh
# this works
mvn -Dtest="CoverageRunnerTest#testExampleFL1" clean test
# this results in several failures, including the test that passed above
mvn clean testIn CI the behavior seems to be the same. Also, I tried adding that dependency but didn't do anything. |
|
Hi @andre15silva, It seems that here you gather the required jars from the folder However, one of them, i.e. On my side, The actions that could be taken are:
Hope it can help! :) |
|
Hi @danglotb , Thank you for your time. You are right, when I added the remaining jar files to the classpath some of the tests started working. I implemented a way of having default classpaths and configurable ones. I think for now it works, but integrating it in In other news, I spend way too much time debugging Anyway, that should now be fixed and this PR is now ready for review (@martinezmatias ?) |
Signed-off-by: André Silva <andre15andre@hotmail.com>
Constructors are no longer considered in the computation of coverage, so we remove them from tests. Cover tests option is not yet supported through test-runner's EntryPoint, so we make it unsupported temporarily. Signed-off-by: André Silva <andre15andre@hotmail.com>
Signed-off-by: André Silva <andre15andre@hotmail.com>
Signed-off-by: André Silva <andre15andre@hotmail.com>
Signed-off-by: André Silva <andre15andre@hotmail.com>
I literally spent 5 or 6 hours debugging this and test-runner, just to in the end realize it was simply running the wrong test framework. Signed-off-by: André Silva <andre15andre@hotmail.com>
Signed-off-by: André Silva <andre15andre@hotmail.com>
Signed-off-by: André Silva <andre15andre@hotmail.com>
1f82b17 to
06e6aa6
Compare
|
Rebased and ready for review. |
| public class FlacocoMain implements Callable<Integer> { | ||
| static boolean log = true; | ||
|
|
||
| @Option(names = { "-w", "--workspace"}, description = "Path to the workspace directory of flacoco.", defaultValue = "./") |
There was a problem hiding this comment.
I wonder how it would work when we use Flacoco with a Jar: it will not be a workspace
There was a problem hiding this comment.
I'm not sure I understood. I just ran the jar with that option and it works fine.
That option, for now, is only passed to test-runner, which will then save and load serialized files inside of it.
How could running it through the packaged jar result in different behavior?
There was a problem hiding this comment.
Ok, perfect. I misunderstood. Sorry :)
Signed-off-by: André Silva <andre15andre@hotmail.com>
This PR implements the usage of the new
test-runner's API.On important aspect is that the
CoverageCollectorDetailedtransformer doesn't consider constructor coverage (See https://github.com/STAMP-project/test-runner/blob/5b84d1a940564a1c1ee0b22b695503fab4600d97/src/main/java/eu/stamp_project/testrunner/listener/impl/CoverageCollectorDetailed.java#L45-L52), so I have modified the existing tests to follow that.Also,
test-runnerdoesn't support test coverage by default, so to support that we need to implement it inEntryPointas an option too.I'm not entirely sure this is what we want to do tho, as some constructors may have bugs and the coverage there will be important. WDYT?