Hi,

let me conclude some of the things together:

The decision which I have made against Spock was based on several
reasons:

 * People often tend to write Java code (which is valid), cause
   they don't know Groovy or don't want to learn a new language
   just to write tests.
   This means in the end: Why Groovy? Just use Java.

 * It's much easier for new contributors/devs to get into the
   project if you only need to know Java to write plugins, unit
   tests(also using JUnit5) and integration tests. So removing
   a supplemental hurdle will help.

 * Support for most recent Java versions which is a complete
   blocker for the Apache Maven project, cause we are running builds
   in a very early stage which would block us (see our builds).
   Currently spock is not yet tested/build against JDK11+ ?
   So having a Testing framework which might not work on most
   recent versions is a complete blocker.

 * In earlier days I would have argued to use Spock based
   on the language features but since JDK8 I don't see any advantage
   in using Groovy over Java anymore.

 * Spock does not support parallelizing of tests (full blocker for me)

 * Good IDE Support for Groovy is only given at the moment in
   IDEA IntelliJ and DSL support for Spock also.

   That would block many people. This blocker based on the usage
   of a particular IDE is not acceptable for an open source project
   like the Apache Maven Project and with my PMC hat on I would never
   do that.

The command line for executing the tests is at the moment here:
https://github.com/khmarbaise/maven-it-extension/blob/c0823c2afa56b29df1c09f38fe5d73ebcbe4eec3/src/main/java/org/apache/maven/jupiter/extension/ApplicationExecutor.java#L64

which is called from here:
https://github.com/khmarbaise/maven-it-extension/blob/c0823c2afa56b29df1c09f38fe5d73ebcbe4eec3/src/main/java/org/apache/maven/jupiter/extension/MavenITExtension.java#L179


Kind regards
Karl Heinz Marbaise

On 30.10.19 16:15, Tibor Digana wrote:
Karl, where you define CLI command in each test?
Regarding the f/w you have selected. If I had to decide between JUnit5 or
Groovy/Spock, I would decide for Spock.

On Tue, Oct 29, 2019 at 9:47 PM Karl Heinz Marbaise <[email protected]>
wrote:

Hi to all,

I've invested some time to get a thing working in a different way which
nags me for a long time.

Integration tests for maven plugins and for maven core...

So created a prototype based on a JUnit Jupiter extension.

The following is the JUnit Jupiter extension (currently very hacky code;
not intended to win a competition for good code!)

https://github.com/khmarbaise/maven-it-extension

which contains some documentation which is of course not ready yet...
but the implementation and usage (see maven-ear-plugin) gives me at the
moment already a very good impression how easy it can be to write
integration tests for a maven plugin etc.

Example from the docs(not 100% working like that yet):

@MavenIT
class FirstMavenIT {

    @MavenTest
    void the_first_test_case(MavenProjectResult result) {
      assertThat(result)
        .build()
          .isSuccessful()
        .and()
        .project()
          .hasTarget()
            .withEarFile()
              .containsOnlyOnce("META-INF/MANIFEST.MF")
          .log()
            .info().contains("Writing data to file")
        .cache()
            .withEarFile("G:A:V")
            .withPomFile("G:A:V")
            .withMetadata().contains("xxx");
    }
}


I created a branch "maven-it-extension" on Maven EAR Plugin which shows
that it can be used in combination with maven-invoker-plugin:install
goal and using maven-failsafe-plugin to run the tests for
maven-ear-plugin (some of them at the moment. Not migrated all of them
yet).

Example which already works:

https://github.com/apache/maven-ear-plugin/blob/maven-it-extension/src/test/java/org/apache/maven/plugins/ear/it/EARIT.java


WDYT ?

Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]




---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to