y-scope / clp-ffi-java

Apache License 2.0
10 stars 3 forks source link

JUnit not marked as test-scope dependency #11

Closed kirkrodrigues closed 1 year ago

kirkrodrigues commented 1 year ago

Bug

JUnit is not marked as a test-scope dependency in the POM. When clp-ffi is included as a dependency, this can cause strange issues like tests that use other testing frameworks are not run.

clp-ffi version

0.1

Environment

Java 11

Reproduction steps

  1. Create a project with the following dependencies and plugins:
    <dependencies>
        <dependency>
            <groupId>com.yscope.clp</groupId>
            <artifactId>clp-ffi</artifactId>
            <version>0.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven.surefire</groupId>
            <artifactId>surefire-testng</artifactId>
            <version>3.0.0-M7</version>
        </dependency>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.6.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>3.0.0-M7</version>
            </plugin>
        </plugins>
    </build>
  1. Create a basic TestNG test:
import org.testng.annotations.Test;

import static org.testng.Assert.*;

public class TestClass {
  @Test
  void testMethod() {
    assertTrue(true);
  }
}
  1. Run mvn test and you should see that the test will not be run.