[Discuss] Some problem Unit test

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discuss] Some problem Unit test

Jinkui Shi
Hi, all

Surefire plugin default execute `default-test` when mvn test. There two execution in Flink’s surefire plugin configure, default-test and integration-tests.

I have three problem about unit test:
1. As default-test and integration-tests are mutual exclusion, when I local execute “mvn clean test -f flink-libraries/flink-table/pom.xml -U”, it will not execute all the unit test of ITCase.*, such as org.apache.flink.table.api.scala.stream.sql.SqlITCase will not be executed. I think it’s a bug.
   Where is integration-tests used?
2. *Test.* also will be not executed, there lots of *Test.* unit test, do they need be test?
3. Suite.* use in scala generally, flink-ml use scalatest-maven-plugin instead of surefire plugin

I think we should do something on unit test:
1. Choose one unit test plugin: surefire or scalatest-maven-plugin
2. Include given unit test wildcard class, such as **/*ITCase.*,   **/*Test.*,  **/*Suite.*, **/*Test.*
   All such unit test should be executed. Clean the non unit test class with name end of “Test”.


After I try to modify the configure of surefire plugin, lots of error occur

<execution>
        <id>default-test</id>
        <phase>test</phase>
        <goals>
                <goal>test</goal>
        </goals>
        <configuration>
                <skip>${skip.default.test}</skip>
                <includes>
                        <include>**/*ITCase.*</include>
                        <include>**/*Suite.*</include>
                        <include>**/*Test.*</include>
                        <!--<include>**/*ITSuite.*</include>-->
                </includes>
        </configuration>
</execution>

 

cc Stephan Ewen


Best regards
-Jinkui Shi


Reply | Threaded
Open this post in threaded view
|

Re: [Discuss] Some problem Unit test

Jinkui Shi
[1] Maven Surefire: multiple executions and debugging https://blog-rmannibucau.rhcloud.com/#/post/maven-surefire-debugging-execution <https://blog-rmannibucau.rhcloud.com/#/post/maven-surefire-debugging-execution>

> On Jan 23, 2017, at 17:17, sjk <[hidden email]> wrote:
>
> Hi, all
>
> Surefire plugin default execute `default-test` when mvn test. There two execution in Flink’s surefire plugin configure, default-test and integration-tests.
>
> I have three problem about unit test:
> 1. As default-test and integration-tests are mutual exclusion, when I local execute “mvn clean test -f flink-libraries/flink-table/pom.xml -U”, it will not execute all the unit test of ITCase.*, such as org.apache.flink.table.api.scala.stream.sql.SqlITCase will not be executed. I think it’s a bug.
>   Where is integration-tests used?
> 2. *Test.* also will be not executed, there lots of *Test.* unit test, do they need be test?
> 3. Suite.* use in scala generally, flink-ml use scalatest-maven-plugin instead of surefire plugin
>
> I think we should do something on unit test:
> 1. Choose one unit test plugin: surefire or scalatest-maven-plugin
> 2. Include given unit test wildcard class, such as **/*ITCase.*,   **/*Test.*,  **/*Suite.*, **/*Test.*
>   All such unit test should be executed. Clean the non unit test class with name end of “Test”.
>
>
> After I try to modify the configure of surefire plugin, lots of error occur
>
> <execution>
> <id>default-test</id>
> <phase>test</phase>
> <goals>
> <goal>test</goal>
> </goals>
> <configuration>
> <skip>${skip.default.test}</skip>
> <includes>
> <include>**/*ITCase.*</include>
> <include>**/*Suite.*</include>
> <include>**/*Test.*</include>
> <!--<include>**/*ITSuite.*</include>-->
> </includes>
> </configuration>
> </execution>
>
>
>
> cc Stephan Ewen
>
>
> Best regards
> -Jinkui Shi
>
>