You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Peter De Maeyer <pe...@gmail.com> on 2019/07/25 12:50:02 UTC

[shade plugin] How to add/run/debug a new IT?

Hi,

I'm trying to contribute to the Maven Shade Plugin by fixing 
https://issues.apache.org/jira/browse/MSHADE-284, but I'm stuck trying 
to create/run/debug an integration test (IT).

I have added a couple of skeleton test projects to a new dir 
*src/it/MSHADE-284_shadeTestJar*, but I don't understand how it hooks 
into the testing framework... How do I run my IT and write assertions?

I notice that other similar ITs seem to define assertions in a 
*verify.groovy* file, but I don't know how that works...

  * Is there a way I can run my IT from within IntelliJ, just like I run
    UTs?
  * Alternatively, is there a way I can run my IT from the CLI, similar
    to *mvn surefire:test -Dtest=MyTest*?
  * I found somewhere that I can run ITs with *mvn clean test
    -Prun-its*, but that doesn't seem to run a lot of ITs, e.g. I don't
    find any of the ITs *src/it/MSHADE-** in the test output.

Can someone please provide me a link to get started?

I am a very familiar with Maven, Java development and writing unit 
tests, but I'm new to contributing to Maven itself.

Thanks,


Re: [shade plugin] How to add/run/debug a new IT?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Peter

Did you run this command to launch them:

    mvn verify -Prun-its

?

It is based on the invoker plugin:
https://maven.apache.org/plugins/maven-invoker-plugin/. At the end of the
page there is a link about the verify script and the contextual variables
available to check, post build, the result of the build.

The other trick is that once ran the project is in target/it and can be
open in any IDE to dzbug kt with mvnDebug. Alternatuvely you can pass the
famous -agentlib:... arg to the jvm through invoker options to configure
mvn fork, up to you.


Le mar. 30 juil. 2019 à 01:00, Peter De Maeyer <pe...@gmail.com>
a écrit :

> Hi,
>
> I'm trying to contribute to the Maven Shade Plugin by fixing
> https://issues.apache.org/jira/browse/MSHADE-284, but I'm stuck trying
> to create/run/debug an integration test (IT).
>
> I have added a couple of skeleton test projects to a new dir
> *src/it/MSHADE-284_shadeTestJar*, but I don't understand how it hooks
> into the testing framework... How do I run my IT and write assertions?
>
> I notice that other similar ITs seem to define assertions in a
> *verify.groovy* file, but I don't know how that works...
>
>   * Is there a way I can run my IT from within IntelliJ, just like I run
>     UTs?
>   * Alternatively, is there a way I can run my IT from the CLI, similar
>     to *mvn surefire:test -Dtest=MyTest*?
>   * I found somewhere that I can run ITs with *mvn clean test
>     -Prun-its*, but that doesn't seem to run a lot of ITs, e.g. I don't
>     find any of the ITs *src/it/MSHADE-** in the test output.
>
> Can someone please provide me a link to get started?
>
> I am a very familiar with Maven, Java development and writing unit
> tests, but I'm new to contributing to Maven itself.
>
> Thanks,
>
>