ASSERT-KTH / flacoco

FLACOCO: Fault Localization for Java based on Industry-grade Coverage http://arxiv.org/pdf/2111.12513
MIT License
29 stars 15 forks source link

How to run Flacoco #87

Closed danglotb closed 3 years ago

danglotb commented 3 years ago

Hello,

I would like to integrate Flacoco into one of my projects. I started slowing by trying the API with the following code:

public static void run(String classpath, String rootPathDirectory) {
        Flacoco flacoco = new Flacoco();
        FlacocoConfig config = FlacocoConfig.getInstance();
        config.setTestRunnerVerbose(true);

        config.setProjectPath(rootPathDirectory);
        config.setClasspath(classpath);
        config.setFamily(FlacocoConfig.FaultLocalizationFamily.SPECTRUM_BASED);
        config.setSpectrumFormula(SpectrumFormula.OCHIAI);

        final Map<String, Suspiciousness> susp = flacoco.runDefault();
        for (String s : susp.keySet()) {
            System.out.println(s + " " + susp.get(s));
        }
    }

    public static void main(String[] args) {
        EntryPoint.verbose = true;
        run(
                CLASSPATH,
                ABSOLUTE_PATH
        );
    }

    private static final String ABSOLUTE_PATH = "/home/benjamin/workspace/my-project/"

    private static final String CLASSPATH = // Obtained with mvn dependency:build-classpath -Dmdep.outputFile=classpath

When running this code, I have the following issue raised:

Exception in thread "main" java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org.apache.maven.plugin.surefire.util.DirectoryScanner
    at fr.spoonlabs.flacoco.core.test.strategies.classloader.ClassloaderStrategy.findTests(ClassloaderStrategy.java:42)
    at fr.spoonlabs.flacoco.core.test.TestDetector.findTests(TestDetector.java:77)
    at fr.spoonlabs.flacoco.core.test.TestDetector.getTests(TestDetector.java:39)
    at fr.spoonlabs.flacoco.localization.spectrum.SpectrumRunner.computeCoverageMatrix(SpectrumRunner.java:33)
    at fr.spoonlabs.flacoco.localization.spectrum.SpectrumRunner.run(SpectrumRunner.java:22)
    at fr.spoonlabs.flacoco.api.Flacoco.runDefault(Flacoco.java:32)
    at fr.davidson.diff.jjoules.suspect.FlacocoRunner.run(FlacocoRunner.java:28)
    at fr.davidson.diff.jjoules.suspect.FlacocoRunner.main(FlacocoRunner.java:36)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org.apache.maven.plugin.surefire.util.DirectoryScanner
    at java.util.concurrent.FutureTask.report(FutureTask.java:122)
    at java.util.concurrent.FutureTask.get(FutureTask.java:192)
    at fr.spoonlabs.flacoco.core.test.strategies.classloader.ClassloaderStrategy.findTests(ClassloaderStrategy.java:40)
    ... 7 more
Caused by: java.lang.NoClassDefFoundError: org.apache.maven.plugin.surefire.util.DirectoryScanner
    at fr.spoonlabs.flacoco.core.test.strategies.classloader.finder.classes.impl.SourceFolderFinder.getClassesLoc(SourceFolderFinder.java:25)
    at fr.spoonlabs.flacoco.core.test.strategies.classloader.finder.classes.impl.ClassloaderFinder.getClasses(ClassloaderFinder.java:23)
    at fr.spoonlabs.flacoco.core.test.strategies.classloader.finder.Processor.process(Processor.java:32)
    at fr.spoonlabs.flacoco.core.test.strategies.classloader.finder.TestFinderRunner.call(TestFinderRunner.java:33)
    at fr.spoonlabs.flacoco.core.test.strategies.classloader.finder.TestFinderRunner.call(TestFinderRunner.java:18)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:823)
Caused by: java.lang.ClassNotFoundException: org.apache.maven.plugin.surefire.util.DirectoryScanner
    at java.net.URLClassLoader.findClass(URLClassLoader.java:591)
    at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:953)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:898)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:881)
    ... 9 more

Would you mind to tell if I am doing something wrong? I'm running this inside Intellij.

Thank you very much! :smile:

andre15silva commented 3 years ago

Hi @danglotb ,

That class comes from the dependency:

        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>maven-surefire-common</artifactId>
            <version>3.0.0-M5</version>
        </dependency>

Is it possible that you have a conflicting dependency (or maybe just a different version) in your project?

danglotb commented 3 years ago

Hi, thank you for your answer.

The only reference in my classpath to maven-surefire-common comes from flacoco:

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ diff-jjoules ---
[INFO] fr.davidson:diff-jjoules:maven-plugin:0.0.1-SNAPSHOT
[INFO] +- eu.stamp-project:dspot-diff-test-selection:jar:3.1.1-SNAPSHOT:compile
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.25:compile
[INFO] |  +- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] |  +- org.apache.maven.shared:maven-invoker:jar:3.0.0:compile
[INFO] |  +- org.openclover:clover:jar:4.2.1:compile
[INFO] |  +- fr.inria.gforge.spoon.labs:gumtree-spoon-ast-diff:jar:1.9:compile
[INFO] |  |  \- com.github.gumtreediff:core:jar:2.1.0:compile
[INFO] |  |     +- com.github.mpkorstanje:simmetrics-core:jar:3.2.3:compile
[INFO] |  |     +- net.sf.trove4j:trove4j:jar:3.0.3:compile
[INFO] |  |     \- org.jgrapht:jgrapht-core:jar:1.0.1:compile
[INFO] |  \- io.github.java-diff-utils:java-diff-utils:jar:4.0:compile
[INFO] |     \- org.eclipse.jgit:org.eclipse.jgit:jar:4.4.1.201607150455-r:compile
[INFO] +- fr.inria.gforge.spoon:spoon-core:jar:9.1.0-beta-7:compile
[INFO] |  +- org.eclipse.jdt:org.eclipse.jdt.core:jar:3.25.0:compile
[INFO] |  +- com.martiansoftware:jsap:jar:2.1:compile
[INFO] |  +- commons-io:commons-io:jar:2.8.0:compile
[INFO] |  +- org.apache.maven:maven-model:jar:3.8.1:compile
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.12.0:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.12.3:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.12.3:compile
[INFO] |  |  \- com.fasterxml.jackson.core:jackson-core:jar:2.12.3:compile
[INFO] |  \- org.apache.commons:commons-compress:jar:1.20:compile
[INFO] +- org.apache.maven:maven-plugin-api:jar:3.5.4:compile
[INFO] |  +- org.apache.maven:maven-artifact:jar:3.5.4:compile
[INFO] |  +- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.3:compile
[INFO] |  |  \- javax.enterprise:cdi-api:jar:1.0:compile
[INFO] |  |     \- javax.annotation:jsr250-api:jar:1.0:compile
[INFO] |  +- org.codehaus.plexus:plexus-utils:jar:3.1.0:compile
[INFO] |  \- org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[INFO] +- org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.5:provided
[INFO] +- org.apache.maven:maven-core:jar:3.5.4:compile
[INFO] |  +- org.apache.maven:maven-settings:jar:3.5.4:compile
[INFO] |  +- org.apache.maven:maven-settings-builder:jar:3.5.4:compile
[INFO] |  |  +- org.codehaus.plexus:plexus-interpolation:jar:1.24:compile
[INFO] |  |  \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:compile
[INFO] |  |     \- org.sonatype.plexus:plexus-cipher:jar:1.4:compile
[INFO] |  +- org.apache.maven:maven-builder-support:jar:3.5.4:compile
[INFO] |  +- org.apache.maven:maven-repository-metadata:jar:3.5.4:compile
[INFO] |  +- org.apache.maven:maven-model-builder:jar:3.5.4:compile
[INFO] |  +- org.apache.maven:maven-resolver-provider:jar:3.5.4:compile
[INFO] |  +- org.apache.maven.resolver:maven-resolver-impl:jar:1.1.1:compile
[INFO] |  +- org.apache.maven.resolver:maven-resolver-api:jar:1.1.1:compile
[INFO] |  +- org.apache.maven.resolver:maven-resolver-spi:jar:1.1.1:compile
[INFO] |  +- org.apache.maven.resolver:maven-resolver-util:jar:1.1.1:compile
[INFO] |  +- org.apache.maven.shared:maven-shared-utils:jar:3.2.1:compile
[INFO] |  +- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.3:compile
[INFO] |  +- com.google.inject:guice:jar:no_aop:4.2.0:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- com.google.guava:guava:jar:20.0:compile
[INFO] |  +- javax.inject:javax.inject:jar:1:compile
[INFO] |  \- org.codehaus.plexus:plexus-component-annotations:jar:1.7.1:compile
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.5.2:compile
[INFO] |  +- org.apiguardian:apiguardian-api:jar:1.1.0:compile
[INFO] |  +- org.opentest4j:opentest4j:jar:1.2.0:compile
[INFO] |  \- org.junit.platform:junit-platform-commons:jar:1.5.2:compile
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.5.2:compile
[INFO] |  \- org.junit.platform:junit-platform-engine:jar:1.5.2:compile
[INFO] +- org.junit.platform:junit-platform-runner:jar:1.3.2:compile
[INFO] |  +- org.junit.platform:junit-platform-launcher:jar:1.3.2:compile
[INFO] |  +- org.junit.platform:junit-platform-suite-api:jar:1.3.2:compile
[INFO] |  \- junit:junit:jar:4.12:compile
[INFO] |     \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO] +- org.powerapi.jjoules:junit-jjoules:jar:1.0-SNAPSHOT:test
[INFO] |  +- org.powerapi.jjoules:j-joules:jar:1.0-SNAPSHOT:test
[INFO] |  \- org.apache.maven:maven-project:jar:2.2.1:test
[INFO] |     +- org.apache.maven:maven-profile:jar:2.2.1:test
[INFO] |     +- org.apache.maven:maven-artifact-manager:jar:2.2.1:test
[INFO] |     |  +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-6:test
[INFO] |     |  \- backport-util-concurrent:backport-util-concurrent:jar:3.1:test
[INFO] |     +- org.apache.maven:maven-plugin-registry:jar:2.2.1:test
[INFO] |     \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:test
[INFO] |        \- classworlds:classworlds:jar:1.1-alpha-2:test
[INFO] +- com.google.code.gson:gson:jar:2.8.6:compile
[INFO] +- eu.stamp-project:test-runner:jar:2.3.1-SNAPSHOT:compile
[INFO] |  +- eu.stamp-project:descartes:jar:1.2.4:compile
[INFO] |  +- org.pitest:pitest-entry:jar:1.4.7:compile
[INFO] |  +- org.pitest:pitest:jar:1.4.7:compile
[INFO] |  +- org.jacoco:org.jacoco.core:jar:0.8.3:compile
[INFO] |  |  +- org.ow2.asm:asm:jar:7.0:compile
[INFO] |  |  +- org.ow2.asm:asm-commons:jar:7.0:compile
[INFO] |  |  |  \- org.ow2.asm:asm-analysis:jar:7.0:compile
[INFO] |  |  \- org.ow2.asm:asm-tree:jar:7.0:compile
[INFO] |  +- org.junit.jupiter:junit-jupiter-params:jar:5.3.2:compile
[INFO] |  \- org.pitest:pitest-junit5-plugin:jar:0.8:compile
[INFO] \- com.github.spoonlabs:flacoco:jar:0.0.1-SNAPSHOT:compile
[INFO]    +- log4j:log4j:jar:1.2.17:compile
[INFO]    +- org.apache.logging.log4j:log4j-jcl:jar:2.14.1:compile
[INFO]    |  +- commons-logging:commons-logging:jar:1.2:compile
[INFO]    |  \- org.apache.logging.log4j:log4j-api:jar:2.14.1:compile
[INFO]    +- info.picocli:picocli:jar:4.6.1:compile
[INFO]    +- net.sf.supercsv:super-csv:jar:2.4.0:compile
[INFO]    \- org.apache.maven.surefire:maven-surefire-common:jar:3.0.0-M5:compile
[INFO]       +- org.apache.maven.surefire:surefire-api:jar:3.0.0-M5:compile
[INFO]       |  \- org.apache.maven.surefire:surefire-logger-api:jar:3.0.0-M5:compile
[INFO]       +- org.apache.maven.surefire:surefire-extensions-api:jar:3.0.0-M5:compile
[INFO]       +- org.apache.maven.surefire:surefire-booter:jar:3.0.0-M5:compile
[INFO]       |  \- org.apache.maven.surefire:surefire-extensions-spi:jar:3.0.0-M5:compile
[INFO]       +- org.apache.maven:maven-toolchain:jar:3.0-alpha-2:compile
[INFO]       +- org.apache.maven.shared:maven-artifact-transfer:jar:0.11.0:compile
[INFO]       |  +- org.apache.maven.shared:maven-common-artifact-filters:jar:3.0.1:compile
[INFO]       |  |  \- org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2:compile
[INFO]       |  |     \- org.sonatype.sisu:sisu-inject-bean:jar:1.4.2:compile
[INFO]       |  |        \- org.sonatype.sisu:sisu-guice:jar:noaop:2.1.7:compile
[INFO]       |  \- commons-codec:commons-codec:jar:1.11:compile
[INFO]       +- org.codehaus.plexus:plexus-java:jar:1.0.5:compile
[INFO]       |  \- com.thoughtworks.qdox:qdox:jar:2.0-M9:compile
[INFO]       \- org.apache.maven.surefire:surefire-shared-utils:jar:3.0.0-M4:compile
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ diff-jjoules-demo ---
[INFO] fr.davidson:diff-jjoules-demo:jar:0.0.1-SNAPSHOT
[INFO] +- org.junit.jupiter:junit-jupiter-api:jar:5.3.2:compile
[INFO] |  +- org.apiguardian:apiguardian-api:jar:1.0.0:compile
[INFO] |  +- org.opentest4j:opentest4j:jar:1.1.1:compile
[INFO] |  \- org.junit.platform:junit-platform-commons:jar:1.3.2:compile
[INFO] +- org.junit.jupiter:junit-jupiter-engine:jar:5.3.2:compile
[INFO] +- org.junit.platform:junit-platform-engine:jar:1.3.2:compile
[INFO] +- org.junit.platform:junit-platform-launcher:jar:1.3.2:compile
[INFO] \- org.powerapi.jjoules:junit-jjoules:jar:1.0-SNAPSHOT:compile
[INFO]    +- junit:junit:jar:4.13:compile
[INFO]    |  \- org.hamcrest:hamcrest-core:jar:1.3:compile
[INFO]    +- org.powerapi.jjoules:j-joules:jar:1.0-SNAPSHOT:compile
[INFO]    +- org.apache.maven:maven-plugin-api:jar:3.3.9:compile
[INFO]    |  +- org.apache.maven:maven-model:jar:3.3.9:compile
[INFO]    |  |  \- org.apache.commons:commons-lang3:jar:3.4:compile
[INFO]    |  +- org.apache.maven:maven-artifact:jar:3.3.9:compile
[INFO]    |  \- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.2:compile
[INFO]    |     +- javax.enterprise:cdi-api:jar:1.0:compile
[INFO]    |     |  +- javax.annotation:jsr250-api:jar:1.0:compile
[INFO]    |     |  \- javax.inject:javax.inject:jar:1:compile
[INFO]    |     +- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.2:compile
[INFO]    |     +- org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[INFO]    |     \- org.codehaus.plexus:plexus-classworlds:jar:2.5.2:compile
[INFO]    +- org.apache.maven.plugin-tools:maven-plugin-annotations:jar:3.6.0:compile
[INFO]    +- org.apache.maven:maven-project:jar:2.2.1:compile
[INFO]    |  +- org.apache.maven:maven-settings:jar:2.2.1:compile
[INFO]    |  +- org.apache.maven:maven-profile:jar:2.2.1:compile
[INFO]    |  +- org.apache.maven:maven-artifact-manager:jar:2.2.1:compile
[INFO]    |  |  +- org.apache.maven:maven-repository-metadata:jar:2.2.1:compile
[INFO]    |  |  +- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-6:compile
[INFO]    |  |  \- backport-util-concurrent:backport-util-concurrent:jar:3.1:compile
[INFO]    |  +- org.apache.maven:maven-plugin-registry:jar:2.2.1:compile
[INFO]    |  +- org.codehaus.plexus:plexus-interpolation:jar:1.11:compile
[INFO]    |  +- org.codehaus.plexus:plexus-utils:jar:1.5.15:compile
[INFO]    |  \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[INFO]    |     \- classworlds:classworlds:jar:1.1-alpha-2:compile
[INFO]    \- com.google.code.gson:gson:jar:2.8.5:compile

If you need anything else, please do not hesitate to tell me. Thank you very much!

andre15silva commented 3 years ago

The issue might be with the classpath of the project you are inspecting, since the test detection actually occurs in a new thread with the project classes and dependencies loaded in a new classloader.

Is there any way I could reproduce the issue locally? It could also be an error in constructing the new thread (see https://github.com/SpoonLabs/flacoco/blob/master/src/main/java/fr/spoonlabs/flacoco/core/test/strategies/classloader/ClassloaderStrategy.java), and in that case I'd like to try to fix it.

danglotb commented 3 years ago

Hi @andre15silva

I'm preparing a minimalist project to reproduce. Thank you very much :smile:

danglotb commented 3 years ago

You can clone the following project: diff-jjoules-demo and use the dedicated branch flacoco. On this branch, I remove dependencies that might be difficult to get/install. I checked that the problem is still there even without these dependencies. The snippet provided in my initial message can be used to run flacoco and in this project, you will have to set up the constants ABSOLUTE_PATH and CLASSPATH.

Is ok like this? Or do you want me to do something more?

danglotb commented 3 years ago

Hello again,

Find out a workaroud:

In my pom.xml, I applied the following patch:

<dependency>
    <groupId>com.github.spoonlabs</groupId>
    <artifactId>flacoco</artifactId>
    <version>0.0.1-SNAPSHOT</version>
+    <classifier>jar-with-dependencies</classifier>
</dependency>

However, It results in another issue:

[0] INFO EntryPoint - Path to runner Classes: /home/benjamin/.m2/repository/eu/stamp-project/test-runner/2.3.1-SNAPSHOT/test-runner-2.3.1-SNAPSHOT.jar
[15] INFO EntryPoint - /home/benjamin/.m2/repository/org/jacoco/org.jacoco.core/0.8.3/org.jacoco.core-0.8.3.jar
[15] INFO EntryPoint - /home/benjamin/.m2/repository/commons-io/commons-io/2.8.0/commons-io-2.8.0.jar
[15] INFO EntryPoint - /home/benjamin/.m2/repository/org/pitest/pitest-entry/1.4.7/pitest-entry-1.4.7.jar
[22] INFO EntryPoint - /home/benjamin/.m2/repository/org/pitest/pitest/1.4.7/pitest-1.4.7.jar
[22] INFO EntryPoint - /home/benjamin/.m2/repository/org/pitest/pitest/1.4.7/pitest-1.4.7.jar
[22] INFO EntryPoint - /home/benjamin/.m2/repository/org/pitest/pitest-entry/1.4.7/pitest-entry-1.4.7.jar
[22] INFO EntryPoint - /home/benjamin/.m2/repository/eu/stamp-project/descartes/1.2.4/descartes-1.2.4.jar
[22] INFO EntryPoint - /home/benjamin/.m2/repository/org/pitest/pitest-junit5-plugin/0.8/pitest-junit5-plugin-0.8.jar
[23] INFO EntryPoint - /home/benjamin/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.5.2/junit-jupiter-api-5.5.2.jar
[23] INFO EntryPoint - /home/benjamin/.m2/repository/org/opentest4j/opentest4j/1.2.0/opentest4j-1.2.0.jar
[29] INFO Flacoco - Running Flacoco...
FlacocoConfig{workspace='/home/benjamin/workspace/diff-jjoules/.', projectPath='/home/benjamin/workspace/diff-jjoules-demo', srcJavaDir=[/home/benjamin/workspace/diff-jjoules-demo/src/main/java], srcTestDir=[/home/benjamin/workspace/diff-jjoules-demo/src/test], binJavaDir=[/home/benjamin/workspace/diff-jjoules-demo/target/classes], binTestDir=[/home/benjamin/workspace/diff-jjoules-demo/target/test-classes], classpath='/home/benjamin/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.3.2/junit-jupiter-api-5.3.2.jar:/home/benjamin/.m2/repository/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar:/home/benjamin/.m2/repository/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-commons/1.3.2/junit-platform-commons-1.3.2.jar:/home/benjamin/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.3.2/junit-jupiter-engine-5.3.2.jar:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-engine/1.3.2/junit-platform-engine-1.3.2.jar:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-launcher/1.3.2/junit-platform-launcher-1.3.2.jar', customJUnitClasspath='null', customJacocoClasspath='null', mavenHome='/home/benjamin/.m2/repository/', coverTests=false, testRunnerVerbose=true, testRunnerTimeoutInMs=1000000, testRunnerJVMArgs='null', threshold=0.0, includeZeros=false, complianceLevel=8, testDetectionStrategy=CLASSLOADER, ignoredTests=[], jUnit4Tests=[], jUnit5Tests=[], family=SPECTRUM_BASED, spectrumFormula=OCHIAI}
[file:/home/benjamin/workspace/diff-jjoules-demo/target/classes/, file:/home/benjamin/workspace/diff-jjoules-demo/target/test-classes/, file:/home/benjamin/.m2/repository/org/junit/jupiter/junit-jupiter-api/5.3.2/junit-jupiter-api-5.3.2.jar, file:/home/benjamin/.m2/repository/org/apiguardian/apiguardian-api/1.0.0/apiguardian-api-1.0.0.jar, file:/home/benjamin/.m2/repository/org/opentest4j/opentest4j/1.1.1/opentest4j-1.1.1.jar, file:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-commons/1.3.2/junit-platform-commons-1.3.2.jar, file:/home/benjamin/.m2/repository/org/junit/jupiter/junit-jupiter-engine/5.3.2/junit-jupiter-engine-5.3.2.jar, file:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-engine/1.3.2/junit-platform-engine-1.3.2.jar, file:/home/benjamin/.m2/repository/org/junit/platform/junit-platform-launcher/1.3.2/junit-platform-launcher-1.3.2.jar]
[70] INFO CoverageRunner - Tests found: 0
[70] INFO CoverageRunner - Tests executed: 0

Should I manually add some test methods with the API config.setjUnit5Tests(Set<String> jUnit5Tests)? If yes, what is the format of this String? I tried to add something like full.qualified.TestClassName#testMethodName, but it was crashing.

I thought that letting these would result in the execution of all the tests.

Thank you for your assistance :)

andre15silva commented 3 years ago

Hi,

Hello again,

Find out a workaroud:

In my pom.xml, I applied the following patch:

<dependency>
    <groupId>com.github.spoonlabs</groupId>
    <artifactId>flacoco</artifactId>
    <version>0.0.1-SNAPSHOT</version>
+    <classifier>jar-with-dependencies</classifier>
</dependency>

Nice!

Should I manually add some test methods with the API config.setjUnit5Tests(Set<String> jUnit5Tests)? For now, I thought that letting these would result in the execution of all the tests.

If you add them manually, test detection will be bypassed and only the ones manually specified will be skipped.

It's weird that no tests are being detected. I will try to debug it later today. It's the same repo right?

danglotb commented 3 years ago

Hi there,

My bad, I was running with an old version of the test-runner.

However, on one hand, the test detection is not working either when updated the test-runner version. On the other hand, when I specify manually the test to run using config.setjUnit5Tests(Set<String> jUnit5Tests) and the format full.qualified.TestClassName#testMethodName it works.

I guess that this issue can be closed, and you might want to open a new one for the automatic test detection. Thank you very much for your time!