You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Herve Boutemy (Jira)" <ji...@apache.org> on 2019/12/31 07:00:02 UTC

[jira] [Comment Edited] (MSHADE-342) Many integration tests fail when run in isolation

    [ https://issues.apache.org/jira/browse/MSHADE-342?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17005955#comment-17005955 ] 

Herve Boutemy edited comment on MSHADE-342 at 12/31/19 6:59 AM:
----------------------------------------------------------------

what do you want to fix "here so other plugins can benefit from it as well"? There is a default value for setup ITs [https://maven.apache.org/plugins/maven-invoker-plugin/integration-test-mojo.html#setupIncludes] , it just has to be followed

notice that in the current case, where it is a basic parent pom, relativePath seems to be less invasive (and if the pom.xml goes in src/it, it's very visible)


was (Author: hboutemy):
what do you want to fix? There is a default value for setup ITs [https://maven.apache.org/plugins/maven-invoker-plugin/integration-test-mojo.html#setupIncludes] , it just has to be followed

notice that in the current case, where it is a basic parent pom, relativePath seems to be less invasive (and if the pom.xml goes in src/it, it's very visible)

> Many integration tests fail when run in isolation
> -------------------------------------------------
>
>                 Key: MSHADE-342
>                 URL: https://issues.apache.org/jira/browse/MSHADE-342
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 3.2.2
>            Reporter: Peter De Maeyer
>            Priority: Minor
>
> Maven invoker plugin supports running ITs in isolation, but many ITs fail when run in isolation.
> One example (there are many others):
> {code:bash}
> mvn -Prun-its clean verify -Dinvoker.test=MSHADE-258_module_relocation
> {code}
> They fail because of a missing {{target/it/setup-parent/pom.xml}}.
> The failure is logged in {{target/it/setup-parent/build.log}}.
> The reason is that there is a missing parent dependency, which is apparently required for _any_ IT in this project.
> When you run all the ITs together, it works by accident because the missing directory is created by some other test in the beginning of the IT test run, and then all subsequent tests work as well.
> h3. Potential solution
> A fix is to identify the broken ITs by running all of them in isolation and add the following to all of the broken ones:
> {code:xml}
>     <parent>
>         <groupId>org.apache.maven.plugins.shade.its</groupId>
>         <artifactId>shade-parent</artifactId>
>         <version>1.0</version>
>         <relativePath>../setup-parent</relativePath>
>     </parent>
> {code}
> It should be documented somewhere (maybe it is but I overlooked it?) that, when writing an IT, this _must_ be the parent.
> The acceptance criteria for the fix should be:
> # {{mvn -Run-its clean verify -Dinvoker.test=<any-IT>}} must run the IT in isolation.
> # Optional, but nice if it works: after running the IT (or all ITs) once, it must be possible to debug the Maven project by doing {{cd target/it/<any-IT>; mvnDebug install}}.
> (+) It satisfies both acceptance criteria.
> (-) Every individual IT's {{pom.xml}} needs to be updated with a parent dependency it has no business with.
> (-) It excludes writing an IT for a root project (that has no parent).
> Maybe we can find a solution that doesn't involve updating all IT projects.
> I'll need to investigate a bit more, first I'll need to figure out where the {{setup-parent}} project comes from.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)