You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Alexander Kriegisch <al...@kriegisch.name> on 2022/02/05 04:27:21 UTC

Run all tests (also in dependent modules), fail build at end

I know that this probably is a classic question, because there suggested
answers on Stack Overflow (and maybe also somewhere here in this mailing
list), but I did not found anything satisfying the following criteria:

  1. Run all Surefire tests, if compilation succeeds, also those of
     dependent modules, even if there are tests with failurer or errors.
     (We leave Failsafe out of the picture for now for simplicity's
     sake, but basically the same would apply to Failsafe tests for
     modules which can be compiled and packaged, despite failing
     Surefire tests.)

  2. Fail the multi-module build in the end for all modules with failing
     tests.

I know there is '-fae', but it skips modules depending on ones with test
failures.

I know there is '-fn', but it falsely makes the whole build pass.

I know that the Maven build lifecycle is based on module dependencies
and that dependent modules usually should not be built, if a dependency
fails to build. But OTOH, the same build would pass with '-DskipTests',
and the requirement that artifacts be compiled and packaged and
dependent modules built, because those artifacts can in fact be compiled
and packaged, makes practical sense. Basically, the user wants test
failures reported correctly, but still make sure that as many tests as
possible are being run.

Is there any way to achieve that?
-- 
Alexander Kriegisch
https://scrum-master.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Alexander Kriegisch <al...@kriegisch.name>.
Hi Tibor,

I assume that what you said in your previous messages is correct and I
simply do not understand it. E.g., I think I did not ask for Surefire to
be executed in a later phase. That even feels wrong to me. My
requirement is about whether failing tests make the build abort
immediately or fail at the end in order to ensure that all tests in
modules which compile successfully are executed.

So, lacking basic understtanding of what you described, I also do not
feel comfortable simply quoting you and asking on another mailing list,
because I do not intend to develop a Surefire or general Maven
extension. I can only reiterate that I can describe **what** I want the
build to do, not **how** it should be done. I think I described that in
enough detail already. The "how" is up to you or whoever extends
Surefire. That would be you or one of the other experienced committers
or contributors.
-- 
Alexander Kriegisch
https://scrum-master.de


Tibor Digana schrieb am 15.02.2022 17:08 (GMT +07:00):

> I have realized that we can move straight ahead with the following.
> Basically your expectations are to shift the concrete phase execution of
> the build lifecycle to the end of the build.
> 
> I can imagine a "generic" Extension and you would configure the Extension
> so that the "test" phase or the "verify" phase to the end of the build.
> 
> If you rephrase the question of this email and send it to the
> dev@maven.apache.org, you
> may receive an answer with an existing solution.
> 
> I guess you are not the first person who has this requirement.
> 
> 
>> On Tue, Feb 15, 2022 at 5:12 AM Alexander Kriegisch
>> <alexander@kriegisch.name
>> <ma...@kriegisch.name> > wrote:
>> 
>>> I waited for a week in order to see other developers want to contribute
>>> to the general discussion you asked to have before making any design
>>> decisions the Surefire team might regret later. Did you get the input
>>> your were looking for from somewhere off-list, or have you had enough
>>> time to decide how you want to handle this? I am not sure I can
>>> contribute more than I already have by explaining the potential
>>> user/business value in other parts of this thread.
>>> 
>>> 
>>> Tibor Digana schrieb am 07.02.2022 23:16 (GMT +07:00):
>>> 
>>> > I can imaging to utilize afterSessionEnd()
>>> >
>>> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/AbstractMavenLifecycleParticipant.html
>>> > Maybe this is the way to do it in a clear way via Maven Extensions,
>>> see
>>> >
>>> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/eventspy/AbstractEventSpy.html
>>> > https://maven.apache.org/studies/extension-demo/
>>> >
>>> > and execute the Project's Mojo as if the Mojo was executed in a
>>> traditional
>>> > way.
>>> >
>>> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch
>>> <alexander@kriegisch.name
>>> <ma...@kriegisch.name> >
>>> > wrote:
>>> >
>>> >> I know that this probably is a classic question, because there
>>> suggested
>>> >> answers on Stack Overflow (and maybe also somewhere here in this
>>> mailing
>>> >> list), but I did not found anything satisfying the following
>>> criteria:
>>> >>
>>> >> 1. Run all Surefire tests, if compilation succeeds, also those of
>>> >> dependent modules, even if there are tests with failurer or errors.
>>> >> (We leave Failsafe out of the picture for now for simplicity's
>>> >> sake, but basically the same would apply to Failsafe tests for
>>> >> modules which can be compiled and packaged, despite failing
>>> >> Surefire tests.)
>>> >>
>>> >> 2. Fail the multi-module build in the end for all modules with
>>> failing
>>> >> tests.
>>> >>
>>> >> I know there is '-fae', but it skips modules depending on ones with
>>> test
>>> >> failures.
>>> >>
>>> >> I know there is '-fn', but it falsely makes the whole build pass.
>>> >>
>>> >> I know that the Maven build lifecycle is based on module dependencies
>>> >> and that dependent modules usually should not be built, if a
>>> dependency
>>> >> fails to build. But OTOH, the same build would pass with
>>> '-DskipTests',
>>> >> and the requirement that artifacts be compiled and packaged and
>>> >> dependent modules built, because those artifacts can in fact be
>>> compiled
>>> >> and packaged, makes practical sense. Basically, the user wants test
>>> >> failures reported correctly, but still make sure that as many tests
>>> as
>>> >> possible are being run.
>>> >>
>>> >> Is there any way to achieve that?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
(FIXED TYPO)
Hi Alexander,

I have realized that we can move straight ahead with the following.
Basically your expectations are to shift the concrete phase execution of
the build lifecycle to the end of the build.
I can imagine a "generic" Extension and you would configure the Extension
so that the "test" phase *or* the "verify" phase to the end of the build.

If you rephrase the question of this email and send it to the
dev@maven.apache.org, you may receive an answer with an existing solution.
I guess you are not the first person who has this requirement.

Cheers
Tibor



On Tue, Feb 15, 2022 at 11:06 AM Tibor Digana <ti...@apache.org>
wrote:

> Hi Alexander,
>
> I have realized that we can move straight ahead with the following.
> Basically your expectations are to shift the concrete phase execution of
> the build lifecycle to the end of the build.
> I can imagine a "generic" Extension and you would configure the Extension
> so that the "test" phase of the "verify" phase to the end of the build.
>
> If you rephrase the question of this email and send it to the
> dev@maven.apache.org, you may receive an answer with an existing solution.
> I guess you are not the first person who has this requirement.
>
> Cheers
> Tibor
>
>
> On Tue, Feb 15, 2022 at 5:12 AM Alexander Kriegisch <
> alexander@kriegisch.name> wrote:
>
>> Hi Tibor.
>>
>> I waited for a week in order to see other developers want to contribute
>> to the general discussion you asked to have before making any design
>> decisions the Surefire team might regret later. Did you get the input
>> your were looking for from somewhere off-list, or have you had enough
>> time to decide how you want to handle this? I am not sure I can
>> contribute more than I already have by explaining the potential
>> user/business value in other parts of this thread.
>>
>> Kind regards
>> --
>> Alexander Kriegisch
>> https://scrum-master.de
>>
>>
>> Tibor Digana schrieb am 07.02.2022 23:16 (GMT +07:00):
>>
>> > I can imaging to utilize afterSessionEnd()
>> >
>> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/AbstractMavenLifecycleParticipant.html
>> > Maybe this is the way to do it in a clear way via Maven Extensions, see
>> >
>> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/eventspy/AbstractEventSpy.html
>> > https://maven.apache.org/studies/extension-demo/
>> >
>> > and execute the Project's Mojo as if the Mojo was executed in a
>> traditional
>> > way.
>> >
>> > T
>> >
>> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
>> alexander@kriegisch.name>
>> > wrote:
>> >
>> >> I know that this probably is a classic question, because there
>> suggested
>> >> answers on Stack Overflow (and maybe also somewhere here in this
>> mailing
>> >> list), but I did not found anything satisfying the following criteria:
>> >>
>> >>   1. Run all Surefire tests, if compilation succeeds, also those of
>> >>      dependent modules, even if there are tests with failurer or
>> errors.
>> >>      (We leave Failsafe out of the picture for now for simplicity's
>> >>      sake, but basically the same would apply to Failsafe tests for
>> >>      modules which can be compiled and packaged, despite failing
>> >>      Surefire tests.)
>> >>
>> >>   2. Fail the multi-module build in the end for all modules with
>> failing
>> >>      tests.
>> >>
>> >> I know there is '-fae', but it skips modules depending on ones with
>> test
>> >> failures.
>> >>
>> >> I know there is '-fn', but it falsely makes the whole build pass.
>> >>
>> >> I know that the Maven build lifecycle is based on module dependencies
>> >> and that dependent modules usually should not be built, if a dependency
>> >> fails to build. But OTOH, the same build would pass with '-DskipTests',
>> >> and the requirement that artifacts be compiled and packaged and
>> >> dependent modules built, because those artifacts can in fact be
>> compiled
>> >> and packaged, makes practical sense. Basically, the user wants test
>> >> failures reported correctly, but still make sure that as many tests as
>> >> possible are being run.
>> >>
>> >> Is there any way to achieve that?
>> >> --
>> >> Alexander Kriegisch
>> >> https://scrum-master.de
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
Hi Alexander,

I have realized that we can move straight ahead with the following.
Basically your expectations are to shift the concrete phase execution of
the build lifecycle to the end of the build.
I can imagine a "generic" Extension and you would configure the Extension
so that the "test" phase of the "verify" phase to the end of the build.

If you rephrase the question of this email and send it to the
dev@maven.apache.org, you may receive an answer with an existing solution.
I guess you are not the first person who has this requirement.

Cheers
Tibor


On Tue, Feb 15, 2022 at 5:12 AM Alexander Kriegisch <
alexander@kriegisch.name> wrote:

> Hi Tibor.
>
> I waited for a week in order to see other developers want to contribute
> to the general discussion you asked to have before making any design
> decisions the Surefire team might regret later. Did you get the input
> your were looking for from somewhere off-list, or have you had enough
> time to decide how you want to handle this? I am not sure I can
> contribute more than I already have by explaining the potential
> user/business value in other parts of this thread.
>
> Kind regards
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Tibor Digana schrieb am 07.02.2022 23:16 (GMT +07:00):
>
> > I can imaging to utilize afterSessionEnd()
> >
> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/AbstractMavenLifecycleParticipant.html
> > Maybe this is the way to do it in a clear way via Maven Extensions, see
> >
> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/eventspy/AbstractEventSpy.html
> > https://maven.apache.org/studies/extension-demo/
> >
> > and execute the Project's Mojo as if the Mojo was executed in a
> traditional
> > way.
> >
> > T
> >
> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
> alexander@kriegisch.name>
> > wrote:
> >
> >> I know that this probably is a classic question, because there suggested
> >> answers on Stack Overflow (and maybe also somewhere here in this mailing
> >> list), but I did not found anything satisfying the following criteria:
> >>
> >>   1. Run all Surefire tests, if compilation succeeds, also those of
> >>      dependent modules, even if there are tests with failurer or errors.
> >>      (We leave Failsafe out of the picture for now for simplicity's
> >>      sake, but basically the same would apply to Failsafe tests for
> >>      modules which can be compiled and packaged, despite failing
> >>      Surefire tests.)
> >>
> >>   2. Fail the multi-module build in the end for all modules with failing
> >>      tests.
> >>
> >> I know there is '-fae', but it skips modules depending on ones with test
> >> failures.
> >>
> >> I know there is '-fn', but it falsely makes the whole build pass.
> >>
> >> I know that the Maven build lifecycle is based on module dependencies
> >> and that dependent modules usually should not be built, if a dependency
> >> fails to build. But OTOH, the same build would pass with '-DskipTests',
> >> and the requirement that artifacts be compiled and packaged and
> >> dependent modules built, because those artifacts can in fact be compiled
> >> and packaged, makes practical sense. Basically, the user wants test
> >> failures reported correctly, but still make sure that as many tests as
> >> possible are being run.
> >>
> >> Is there any way to achieve that?
> >> --
> >> Alexander Kriegisch
> >> https://scrum-master.de
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
Hi Alexander,

Unfortunately nobody has replied to me, either in the ML.
I guess the Extension API may really solve your issue.

We need to have some prototype which can be developed apart of the Surefire
project.
I guess the prototype should confirm the whole idea.
After we are fine with the result, we can contribute to Surefire.
We can do the same in Surefire directly in a PR.

Currently I am trying to catch up with the promises in the roadmap of M6
and so I am not idle.

The way would be to ask individual contributors and committers to
participate.

Cheers
Tibor17




On Tue, Feb 15, 2022 at 5:12 AM Alexander Kriegisch <
alexander@kriegisch.name> wrote:

> Hi Tibor.
>
> I waited for a week in order to see other developers want to contribute
> to the general discussion you asked to have before making any design
> decisions the Surefire team might regret later. Did you get the input
> your were looking for from somewhere off-list, or have you had enough
> time to decide how you want to handle this? I am not sure I can
> contribute more than I already have by explaining the potential
> user/business value in other parts of this thread.
>
> Kind regards
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Tibor Digana schrieb am 07.02.2022 23:16 (GMT +07:00):
>
> > I can imaging to utilize afterSessionEnd()
> >
> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/AbstractMavenLifecycleParticipant.html
> > Maybe this is the way to do it in a clear way via Maven Extensions, see
> >
> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/eventspy/AbstractEventSpy.html
> > https://maven.apache.org/studies/extension-demo/
> >
> > and execute the Project's Mojo as if the Mojo was executed in a
> traditional
> > way.
> >
> > T
> >
> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
> alexander@kriegisch.name>
> > wrote:
> >
> >> I know that this probably is a classic question, because there suggested
> >> answers on Stack Overflow (and maybe also somewhere here in this mailing
> >> list), but I did not found anything satisfying the following criteria:
> >>
> >>   1. Run all Surefire tests, if compilation succeeds, also those of
> >>      dependent modules, even if there are tests with failurer or errors.
> >>      (We leave Failsafe out of the picture for now for simplicity's
> >>      sake, but basically the same would apply to Failsafe tests for
> >>      modules which can be compiled and packaged, despite failing
> >>      Surefire tests.)
> >>
> >>   2. Fail the multi-module build in the end for all modules with failing
> >>      tests.
> >>
> >> I know there is '-fae', but it skips modules depending on ones with test
> >> failures.
> >>
> >> I know there is '-fn', but it falsely makes the whole build pass.
> >>
> >> I know that the Maven build lifecycle is based on module dependencies
> >> and that dependent modules usually should not be built, if a dependency
> >> fails to build. But OTOH, the same build would pass with '-DskipTests',
> >> and the requirement that artifacts be compiled and packaged and
> >> dependent modules built, because those artifacts can in fact be compiled
> >> and packaged, makes practical sense. Basically, the user wants test
> >> failures reported correctly, but still make sure that as many tests as
> >> possible are being run.
> >>
> >> Is there any way to achieve that?
> >> --
> >> Alexander Kriegisch
> >> https://scrum-master.de
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Alexander Kriegisch <al...@kriegisch.name>.
Hi Tibor.

I waited for a week in order to see other developers want to contribute
to the general discussion you asked to have before making any design
decisions the Surefire team might regret later. Did you get the input
your were looking for from somewhere off-list, or have you had enough
time to decide how you want to handle this? I am not sure I can
contribute more than I already have by explaining the potential
user/business value in other parts of this thread.

Kind regards
-- 
Alexander Kriegisch
https://scrum-master.de


Tibor Digana schrieb am 07.02.2022 23:16 (GMT +07:00):

> I can imaging to utilize afterSessionEnd()
> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/AbstractMavenLifecycleParticipant.html
> Maybe this is the way to do it in a clear way via Maven Extensions, see
> https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/eventspy/AbstractEventSpy.html
> https://maven.apache.org/studies/extension-demo/
> 
> and execute the Project's Mojo as if the Mojo was executed in a traditional
> way.
> 
> T
> 
> On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <al...@kriegisch.name>
> wrote:
> 
>> I know that this probably is a classic question, because there suggested
>> answers on Stack Overflow (and maybe also somewhere here in this mailing
>> list), but I did not found anything satisfying the following criteria:
>>
>>   1. Run all Surefire tests, if compilation succeeds, also those of
>>      dependent modules, even if there are tests with failurer or errors.
>>      (We leave Failsafe out of the picture for now for simplicity's
>>      sake, but basically the same would apply to Failsafe tests for
>>      modules which can be compiled and packaged, despite failing
>>      Surefire tests.)
>>
>>   2. Fail the multi-module build in the end for all modules with failing
>>      tests.
>>
>> I know there is '-fae', but it skips modules depending on ones with test
>> failures.
>>
>> I know there is '-fn', but it falsely makes the whole build pass.
>>
>> I know that the Maven build lifecycle is based on module dependencies
>> and that dependent modules usually should not be built, if a dependency
>> fails to build. But OTOH, the same build would pass with '-DskipTests',
>> and the requirement that artifacts be compiled and packaged and
>> dependent modules built, because those artifacts can in fact be compiled
>> and packaged, makes practical sense. Basically, the user wants test
>> failures reported correctly, but still make sure that as many tests as
>> possible are being run.
>>
>> Is there any way to achieve that?
>> --
>> Alexander Kriegisch
>> https://scrum-master.de
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
I can imaging to utilize afterSessionEnd()
https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/AbstractMavenLifecycleParticipant.html
Maybe this is the way to do it in a clear way via Maven Extensions, see
https://maven.apache.org/ref/3.8.4/maven-core/apidocs/index.html?org/apache/maven/eventspy/AbstractEventSpy.html
https://maven.apache.org/studies/extension-demo/

and execute the Project's Mojo as if the Mojo was executed in a traditional
way.

T

On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <al...@kriegisch.name>
wrote:

> I know that this probably is a classic question, because there suggested
> answers on Stack Overflow (and maybe also somewhere here in this mailing
> list), but I did not found anything satisfying the following criteria:
>
>   1. Run all Surefire tests, if compilation succeeds, also those of
>      dependent modules, even if there are tests with failurer or errors.
>      (We leave Failsafe out of the picture for now for simplicity's
>      sake, but basically the same would apply to Failsafe tests for
>      modules which can be compiled and packaged, despite failing
>      Surefire tests.)
>
>   2. Fail the multi-module build in the end for all modules with failing
>      tests.
>
> I know there is '-fae', but it skips modules depending on ones with test
> failures.
>
> I know there is '-fn', but it falsely makes the whole build pass.
>
> I know that the Maven build lifecycle is based on module dependencies
> and that dependent modules usually should not be built, if a dependency
> fails to build. But OTOH, the same build would pass with '-DskipTests',
> and the requirement that artifacts be compiled and packaged and
> dependent modules built, because those artifacts can in fact be compiled
> and packaged, makes practical sense. Basically, the user wants test
> failures reported correctly, but still make sure that as many tests as
> possible are being run.
>
> Is there any way to achieve that?
> --
> Alexander Kriegisch
> https://scrum-master.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by John Patrick <nh...@gmail.com>.
So yes, using -Dmaven.test.failure.ignore=true changes the exit code from 1
to 0. So if your linking commands you might not spot a previous command
actually silently errored.
As I want jenkins to fail at that step, and not progress to subsequent
steps. Not point wasting computing resources once all compile issues are
know and all tests issues for tests that could be execute are known.
I could probably configure another plugin to parse the output and detect
that no tests have failed, but decided not to investigate that.
John

On Sat, 26 Feb 2022 at 11:41, Falko Modler <f....@gmx.net> wrote:

> John, is there a reason why you don't use
> -Dmaven.test.failure.ignore=true? This has been my Jenkins setup for
> years and with that I don't need two mvn runs.
>
> Apart from that I can relate to Alexander's use case in that locally you
> simply don't have those Jenkins reporting tools, telling you which tests
> failed overall.
> This can be rather annoying, especially when building in parallel, as
> test result will be all over the place.
>
> I'm not convinced though that this should be a general mvn flag.
> Ideally, surefire chould provide something for that (e.g. an extension).
> Next best thing is a separate extension, which I think was discussed
> here before.
>
> Cheers,
>
> Falko
>
> Am 26.02.2022 um 12:18 schrieb John Patrick:
> > So I understand the option, but for the average developer understanding
> the
> > intermixed output might be a nightmare. If someone is building the code
> > they can just do -SkipTests and -fae, fix those, then go back to run the
> > tests.
> >
> > I do a similar setup on Jenkins, with this kind of Jenkinsfile structure;
> >
> > try {
> >    withEnv(...)
> >      configFileProvider(...)
> >        try {
> >          ./mvnw clean install -DskipTests -fae
> >        } finally {
> >          ./mvnw verify -fae
> >        }
> >      }
> >    }
> > } finally {
> >    recordIssues enabledForFailure: true, tools: [mavenConsole()]
> >    recordIssues aggregatingResults: true, enabledForFailure: true, tools:
> > [java(pattern: '**/src/main/java/**')]
> >    recordIssues aggregatingResults: true, enabledForFailure: true, tools:
> > [junitParser(pattern:
> > '**/target/failsafe-reports/*.xml,**/target/surefire-reports/*.xml')]
> >     publishCoverage adapters:
> > [jacocoAdapter('**/target/site/jacoco/jacoco.xml')]
> > }
> >
> > - Every compile error is captured assuming it's dependencies compile
> > - Every test is execute where the module builds
> > - Report issues and coverage for everything that executed
> >
> > John
> >
> >
> > On Sat, 26 Feb 2022 at 10:37, Delany <de...@gmail.com> wrote:
> >
> >> I understand your use case Alex, just not your process. As this is the
> >> users list Im not about to solve the issue of a missing
> --fail-all-at-end
> >> switch, but I could try to think of workarounds.
> >> Delany
> >>
> >>
> >> On Sat, 26 Feb 2022 at 09:32, Alexander Kriegisch <
> >> alexander@kriegisch.name>
> >> wrote:
> >>
> >>> Delany,
> >>>
> >>> you are completely misunderstanding my use case. I am building with
> >>> every push, that is the pain, because I have a choice to
> >>>
> >>>    -- either see all test results with '-fn' but get a wrong build
> result
> >>>       (passed)
> >>>
> >>>    -- or fewer test results with '-fae' and a correct build result
> >>>       (failed).
> >>>
> >>> I do *not* wish to run tests in a later phase. I have no idea where you
> >>> got that idea from. I simply want the build to continue for modules
> >>> dependent on ones with failing tests, so I can find out if they build
> >>> successfully and whether or not they also have failing tests. Then in
> >>> the end, after all modules have been built and all tests run (for those
> >>> modules which could actually be built without compile errors, of
> >>> course), I want to see an overall test result and a properly failed
> >>> build. In plain English: I want what '-fae' always should have done to
> >>> begin with. I really don't know what is so difficult to understand
> about
> >>> this simple requirement: build as much as possible, test as much as
> >>> possible, then report the correct result at the end. I want failed
> tests
> >>> to fail the build in the end, but I do not want them to keep dependent
> >>> modules from being built and tested.
> >>>
> >>> --
> >>> Alexander Kriegisch
> >>> https://scrum-master.de
> >>>
> >>>
> >>> Delany schrieb am 26.02.2022 14:17 (GMT +07:00):
> >>>
> >>>> Oh its not, im just being thorough.
> >>>> It just seems like your build iteration isn't frequent enough. If
> >> you're
> >>>> not building on every MR/PR or with every push, maybe you need a
> >> separate
> >>>> test build. Or maybe your reactor is too large and you need to split
> it
> >>>> into separate projects. You could also leave the reactor but build via
> >> a
> >>>> script that looks for pom files and tests them one at a time. Ugly,
> but
> >>>> effective.
> >>>> Bottom line is that install and deploy phases don't create
> dependencies
> >>>> within a reactor, so its no biggy that they delay their execution
> until
> >>>> after. Anything that happens before then does, and its not
> unreasonable
> >>> to
> >>>> expect development to work within that constraint.
> >>>> Delany
> >>>>
> >>>>
> >>>> On Fri, 25 Feb 2022 at 19:40, Alexander Kriegisch <
> >>> alexander@kriegisch.name>
> >>>> wrote:
> >>>>
> >>>>> Thanks for digging, Delany. However, I am failing to see how this is
> >>>>> meant to solve my problem. Could you elaborate, please?
> >>>>> --
> >>>>> Alexander Kriegisch
> >>>>> https://scrum-master.de
> >>>>>
> >>>>>
> >>>>> Delany schrieb am 25.02.2022 18:05 (GMT +07:00):
> >>>>>
> >>>>>> Alexander, here it is: https://github.com/raydac/mvn-finisher
> >>>>>> Delany
> >>>>>>
> >>>>>> On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com>
> >>> wrote:
> >>>>>>> Someone already wrote an "at end maven plugin". I used it for a
> >> while
> >>>>> but
> >>>>>>> removed it. Can't for the life of me find it in
> >>>>>>> github/google/confluence/git log. Sorry!
> >>>>>>> Delany
> >>>>>>>
> >>>>>>>
> >>>>>>> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <
> >>>>> alexander@kriegisch.name>
> >>>>>>> wrote:
> >>>>>>>
> >>>>>>>>>> In case you are ready to make you own plugin, it is relatively
> >>> easy.
> >>>>>>>> I am not, Lasse. I also want this to work on the command line and
> >>> not
> >>>>>>>> depend on CI-system-specific workarounds. But thank you for your
> >>>>>>>> insightful ideas, I really appreciate them.
> >>>>>>>>
> >>>>>>>> Tibor, actually I wanted to avoid a potentially lengthy debate on
> >>> basic
> >>>>>>>> principles, but I agree on having one, if you feel it is
> >> necessary.
> >>> I
> >>>>>>>> owe you that much, because it tells me that you are not taking
> >>> design
> >>>>>>>> decisions lightly. So if I can contribute to your decision-making
> >>>>>>>> process, I shall humbly do so. Not being a Maven (plugin)
> >> developer
> >>>>>>>> myself, but rather a just user with a bit of background knowledge,
> >>> I in
> >>>>>>>> fact did previously in this thread comment on the two famous
> >>> '*AtEnd'
> >>>>>>>> precedence cases already:
> >>>>>>>>
> >>>>>>>>>>>> Install and Deploy plugins (...): 'installAtEnd' and
> >>> 'deployAtEnd'
> >>>>>>>>>>>> are blessings IMO, and they are cornerstones of my work,
> >>> because
> >>>>>>>>>>>> they help to avoid half-installed and - even worse -
> >>> half-deployed
> >>>>>>>>>>>> multi-module projects which would lead to inconsistencies in
> >>>>>>>>>>>> repositories and might be hard to rectify in remote
> >>> repositories,
> >>>>>>>>>>>> "burning" release numbers unnecessarily.
> >>>>>>>> The gist is: Those '*AtEnd' features have user value. If you say
> >>> that
> >>>>>>>> they might be difficult to maintain and shield against side
> >>> effects, I
> >>>>>>>> have to take your word for it. So we have a trade-off situation
> >>> here,
> >>>>>>>> chances vs risks. As the person requesting such a feature, of
> >>> course I
> >>>>>>>> have a chances bias. As a plugin maintainer, of course you take a
> >>> more
> >>>>>>>> conservative or defensive stance. I understand that. In the end,
> >> it
> >>> is
> >>>>>>>> your decision. Hopefully others here can contribute more
> >>> substantially
> >>>>>>>> to the discussion than I can.
> >>>>>>>>
> >>>>>>>> --
> >>>>>>>> Alexander Kriegisch
> >>>>>>>> https://scrum-master.de
> >>>>>>>>
> >>>>>>>>
> >>> ---------------------------------------------------------------------
> >>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>>>>
> >>>>>>>>
> >>>>> ---------------------------------------------------------------------
> >>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>>>> For additional commands, e-mail: users-help@maven.apache.org
> >>>>>
> >>>>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Falko Modler <f....@gmx.net>.
John, is there a reason why you don't use
-Dmaven.test.failure.ignore=true? This has been my Jenkins setup for
years and with that I don't need two mvn runs.

Apart from that I can relate to Alexander's use case in that locally you
simply don't have those Jenkins reporting tools, telling you which tests
failed overall.
This can be rather annoying, especially when building in parallel, as
test result will be all over the place.

I'm not convinced though that this should be a general mvn flag.
Ideally, surefire chould provide something for that (e.g. an extension).
Next best thing is a separate extension, which I think was discussed
here before.

Cheers,

Falko

Am 26.02.2022 um 12:18 schrieb John Patrick:
> So I understand the option, but for the average developer understanding the
> intermixed output might be a nightmare. If someone is building the code
> they can just do -SkipTests and -fae, fix those, then go back to run the
> tests.
>
> I do a similar setup on Jenkins, with this kind of Jenkinsfile structure;
>
> try {
>    withEnv(...)
>      configFileProvider(...)
>        try {
>          ./mvnw clean install -DskipTests -fae
>        } finally {
>          ./mvnw verify -fae
>        }
>      }
>    }
> } finally {
>    recordIssues enabledForFailure: true, tools: [mavenConsole()]
>    recordIssues aggregatingResults: true, enabledForFailure: true, tools:
> [java(pattern: '**/src/main/java/**')]
>    recordIssues aggregatingResults: true, enabledForFailure: true, tools:
> [junitParser(pattern:
> '**/target/failsafe-reports/*.xml,**/target/surefire-reports/*.xml')]
>     publishCoverage adapters:
> [jacocoAdapter('**/target/site/jacoco/jacoco.xml')]
> }
>
> - Every compile error is captured assuming it's dependencies compile
> - Every test is execute where the module builds
> - Report issues and coverage for everything that executed
>
> John
>
>
> On Sat, 26 Feb 2022 at 10:37, Delany <de...@gmail.com> wrote:
>
>> I understand your use case Alex, just not your process. As this is the
>> users list Im not about to solve the issue of a missing --fail-all-at-end
>> switch, but I could try to think of workarounds.
>> Delany
>>
>>
>> On Sat, 26 Feb 2022 at 09:32, Alexander Kriegisch <
>> alexander@kriegisch.name>
>> wrote:
>>
>>> Delany,
>>>
>>> you are completely misunderstanding my use case. I am building with
>>> every push, that is the pain, because I have a choice to
>>>
>>>    -- either see all test results with '-fn' but get a wrong build result
>>>       (passed)
>>>
>>>    -- or fewer test results with '-fae' and a correct build result
>>>       (failed).
>>>
>>> I do *not* wish to run tests in a later phase. I have no idea where you
>>> got that idea from. I simply want the build to continue for modules
>>> dependent on ones with failing tests, so I can find out if they build
>>> successfully and whether or not they also have failing tests. Then in
>>> the end, after all modules have been built and all tests run (for those
>>> modules which could actually be built without compile errors, of
>>> course), I want to see an overall test result and a properly failed
>>> build. In plain English: I want what '-fae' always should have done to
>>> begin with. I really don't know what is so difficult to understand about
>>> this simple requirement: build as much as possible, test as much as
>>> possible, then report the correct result at the end. I want failed tests
>>> to fail the build in the end, but I do not want them to keep dependent
>>> modules from being built and tested.
>>>
>>> --
>>> Alexander Kriegisch
>>> https://scrum-master.de
>>>
>>>
>>> Delany schrieb am 26.02.2022 14:17 (GMT +07:00):
>>>
>>>> Oh its not, im just being thorough.
>>>> It just seems like your build iteration isn't frequent enough. If
>> you're
>>>> not building on every MR/PR or with every push, maybe you need a
>> separate
>>>> test build. Or maybe your reactor is too large and you need to split it
>>>> into separate projects. You could also leave the reactor but build via
>> a
>>>> script that looks for pom files and tests them one at a time. Ugly, but
>>>> effective.
>>>> Bottom line is that install and deploy phases don't create dependencies
>>>> within a reactor, so its no biggy that they delay their execution until
>>>> after. Anything that happens before then does, and its not unreasonable
>>> to
>>>> expect development to work within that constraint.
>>>> Delany
>>>>
>>>>
>>>> On Fri, 25 Feb 2022 at 19:40, Alexander Kriegisch <
>>> alexander@kriegisch.name>
>>>> wrote:
>>>>
>>>>> Thanks for digging, Delany. However, I am failing to see how this is
>>>>> meant to solve my problem. Could you elaborate, please?
>>>>> --
>>>>> Alexander Kriegisch
>>>>> https://scrum-master.de
>>>>>
>>>>>
>>>>> Delany schrieb am 25.02.2022 18:05 (GMT +07:00):
>>>>>
>>>>>> Alexander, here it is: https://github.com/raydac/mvn-finisher
>>>>>> Delany
>>>>>>
>>>>>> On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com>
>>> wrote:
>>>>>>> Someone already wrote an "at end maven plugin". I used it for a
>> while
>>>>> but
>>>>>>> removed it. Can't for the life of me find it in
>>>>>>> github/google/confluence/git log. Sorry!
>>>>>>> Delany
>>>>>>>
>>>>>>>
>>>>>>> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <
>>>>> alexander@kriegisch.name>
>>>>>>> wrote:
>>>>>>>
>>>>>>>>>> In case you are ready to make you own plugin, it is relatively
>>> easy.
>>>>>>>> I am not, Lasse. I also want this to work on the command line and
>>> not
>>>>>>>> depend on CI-system-specific workarounds. But thank you for your
>>>>>>>> insightful ideas, I really appreciate them.
>>>>>>>>
>>>>>>>> Tibor, actually I wanted to avoid a potentially lengthy debate on
>>> basic
>>>>>>>> principles, but I agree on having one, if you feel it is
>> necessary.
>>> I
>>>>>>>> owe you that much, because it tells me that you are not taking
>>> design
>>>>>>>> decisions lightly. So if I can contribute to your decision-making
>>>>>>>> process, I shall humbly do so. Not being a Maven (plugin)
>> developer
>>>>>>>> myself, but rather a just user with a bit of background knowledge,
>>> I in
>>>>>>>> fact did previously in this thread comment on the two famous
>>> '*AtEnd'
>>>>>>>> precedence cases already:
>>>>>>>>
>>>>>>>>>>>> Install and Deploy plugins (...): 'installAtEnd' and
>>> 'deployAtEnd'
>>>>>>>>>>>> are blessings IMO, and they are cornerstones of my work,
>>> because
>>>>>>>>>>>> they help to avoid half-installed and - even worse -
>>> half-deployed
>>>>>>>>>>>> multi-module projects which would lead to inconsistencies in
>>>>>>>>>>>> repositories and might be hard to rectify in remote
>>> repositories,
>>>>>>>>>>>> "burning" release numbers unnecessarily.
>>>>>>>> The gist is: Those '*AtEnd' features have user value. If you say
>>> that
>>>>>>>> they might be difficult to maintain and shield against side
>>> effects, I
>>>>>>>> have to take your word for it. So we have a trade-off situation
>>> here,
>>>>>>>> chances vs risks. As the person requesting such a feature, of
>>> course I
>>>>>>>> have a chances bias. As a plugin maintainer, of course you take a
>>> more
>>>>>>>> conservative or defensive stance. I understand that. In the end,
>> it
>>> is
>>>>>>>> your decision. Hopefully others here can contribute more
>>> substantially
>>>>>>>> to the discussion than I can.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Alexander Kriegisch
>>>>>>>> https://scrum-master.de
>>>>>>>>
>>>>>>>>
>>> ---------------------------------------------------------------------
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>>>>
>>>>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>>
>>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by John Patrick <nh...@gmail.com>.
So I understand the option, but for the average developer understanding the
intermixed output might be a nightmare. If someone is building the code
they can just do -SkipTests and -fae, fix those, then go back to run the
tests.

I do a similar setup on Jenkins, with this kind of Jenkinsfile structure;

try {
  withEnv(...)
    configFileProvider(...)
      try {
        ./mvnw clean install -DskipTests -fae
      } finally {
        ./mvnw verify -fae
      }
    }
  }
} finally {
  recordIssues enabledForFailure: true, tools: [mavenConsole()]
  recordIssues aggregatingResults: true, enabledForFailure: true, tools:
[java(pattern: '**/src/main/java/**')]
  recordIssues aggregatingResults: true, enabledForFailure: true, tools:
[junitParser(pattern:
'**/target/failsafe-reports/*.xml,**/target/surefire-reports/*.xml')]
   publishCoverage adapters:
[jacocoAdapter('**/target/site/jacoco/jacoco.xml')]
}

- Every compile error is captured assuming it's dependencies compile
- Every test is execute where the module builds
- Report issues and coverage for everything that executed

John


On Sat, 26 Feb 2022 at 10:37, Delany <de...@gmail.com> wrote:

> I understand your use case Alex, just not your process. As this is the
> users list Im not about to solve the issue of a missing --fail-all-at-end
> switch, but I could try to think of workarounds.
> Delany
>
>
> On Sat, 26 Feb 2022 at 09:32, Alexander Kriegisch <
> alexander@kriegisch.name>
> wrote:
>
> > Delany,
> >
> > you are completely misunderstanding my use case. I am building with
> > every push, that is the pain, because I have a choice to
> >
> >   -- either see all test results with '-fn' but get a wrong build result
> >      (passed)
> >
> >   -- or fewer test results with '-fae' and a correct build result
> >      (failed).
> >
> > I do *not* wish to run tests in a later phase. I have no idea where you
> > got that idea from. I simply want the build to continue for modules
> > dependent on ones with failing tests, so I can find out if they build
> > successfully and whether or not they also have failing tests. Then in
> > the end, after all modules have been built and all tests run (for those
> > modules which could actually be built without compile errors, of
> > course), I want to see an overall test result and a properly failed
> > build. In plain English: I want what '-fae' always should have done to
> > begin with. I really don't know what is so difficult to understand about
> > this simple requirement: build as much as possible, test as much as
> > possible, then report the correct result at the end. I want failed tests
> > to fail the build in the end, but I do not want them to keep dependent
> > modules from being built and tested.
> >
> > --
> > Alexander Kriegisch
> > https://scrum-master.de
> >
> >
> > Delany schrieb am 26.02.2022 14:17 (GMT +07:00):
> >
> > > Oh its not, im just being thorough.
> > > It just seems like your build iteration isn't frequent enough. If
> you're
> > > not building on every MR/PR or with every push, maybe you need a
> separate
> > > test build. Or maybe your reactor is too large and you need to split it
> > > into separate projects. You could also leave the reactor but build via
> a
> > > script that looks for pom files and tests them one at a time. Ugly, but
> > > effective.
> > > Bottom line is that install and deploy phases don't create dependencies
> > > within a reactor, so its no biggy that they delay their execution until
> > > after. Anything that happens before then does, and its not unreasonable
> > to
> > > expect development to work within that constraint.
> > > Delany
> > >
> > >
> > > On Fri, 25 Feb 2022 at 19:40, Alexander Kriegisch <
> > alexander@kriegisch.name>
> > > wrote:
> > >
> > >> Thanks for digging, Delany. However, I am failing to see how this is
> > >> meant to solve my problem. Could you elaborate, please?
> > >> --
> > >> Alexander Kriegisch
> > >> https://scrum-master.de
> > >>
> > >>
> > >> Delany schrieb am 25.02.2022 18:05 (GMT +07:00):
> > >>
> > >> > Alexander, here it is: https://github.com/raydac/mvn-finisher
> > >> > Delany
> > >> >
> > >> > On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com>
> > wrote:
> > >> >
> > >> >> Someone already wrote an "at end maven plugin". I used it for a
> while
> > >> but
> > >> >> removed it. Can't for the life of me find it in
> > >> >> github/google/confluence/git log. Sorry!
> > >> >> Delany
> > >> >>
> > >> >>
> > >> >> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <
> > >> alexander@kriegisch.name>
> > >> >> wrote:
> > >> >>
> > >> >>> >> In case you are ready to make you own plugin, it is relatively
> > easy.
> > >> >>>
> > >> >>> I am not, Lasse. I also want this to work on the command line and
> > not
> > >> >>> depend on CI-system-specific workarounds. But thank you for your
> > >> >>> insightful ideas, I really appreciate them.
> > >> >>>
> > >> >>> Tibor, actually I wanted to avoid a potentially lengthy debate on
> > basic
> > >> >>> principles, but I agree on having one, if you feel it is
> necessary.
> > I
> > >> >>> owe you that much, because it tells me that you are not taking
> > design
> > >> >>> decisions lightly. So if I can contribute to your decision-making
> > >> >>> process, I shall humbly do so. Not being a Maven (plugin)
> developer
> > >> >>> myself, but rather a just user with a bit of background knowledge,
> > I in
> > >> >>> fact did previously in this thread comment on the two famous
> > '*AtEnd'
> > >> >>> precedence cases already:
> > >> >>>
> > >> >>> >>>> Install and Deploy plugins (...): 'installAtEnd' and
> > 'deployAtEnd'
> > >> >>> >>>> are blessings IMO, and they are cornerstones of my work,
> > because
> > >> >>> >>>> they help to avoid half-installed and - even worse -
> > half-deployed
> > >> >>> >>>> multi-module projects which would lead to inconsistencies in
> > >> >>> >>>> repositories and might be hard to rectify in remote
> > repositories,
> > >> >>> >>>> "burning" release numbers unnecessarily.
> > >> >>>
> > >> >>> The gist is: Those '*AtEnd' features have user value. If you say
> > that
> > >> >>> they might be difficult to maintain and shield against side
> > effects, I
> > >> >>> have to take your word for it. So we have a trade-off situation
> > here,
> > >> >>> chances vs risks. As the person requesting such a feature, of
> > course I
> > >> >>> have a chances bias. As a plugin maintainer, of course you take a
> > more
> > >> >>> conservative or defensive stance. I understand that. In the end,
> it
> > is
> > >> >>> your decision. Hopefully others here can contribute more
> > substantially
> > >> >>> to the discussion than I can.
> > >> >>>
> > >> >>> --
> > >> >>> Alexander Kriegisch
> > >> >>> https://scrum-master.de
> > >> >>>
> > >> >>>
> > ---------------------------------------------------------------------
> > >> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> >>> For additional commands, e-mail: users-help@maven.apache.org
> > >> >>>
> > >> >>>
> > >> >
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Delany <de...@gmail.com>.
I understand your use case Alex, just not your process. As this is the
users list Im not about to solve the issue of a missing --fail-all-at-end
switch, but I could try to think of workarounds.
Delany


On Sat, 26 Feb 2022 at 09:32, Alexander Kriegisch <al...@kriegisch.name>
wrote:

> Delany,
>
> you are completely misunderstanding my use case. I am building with
> every push, that is the pain, because I have a choice to
>
>   -- either see all test results with '-fn' but get a wrong build result
>      (passed)
>
>   -- or fewer test results with '-fae' and a correct build result
>      (failed).
>
> I do *not* wish to run tests in a later phase. I have no idea where you
> got that idea from. I simply want the build to continue for modules
> dependent on ones with failing tests, so I can find out if they build
> successfully and whether or not they also have failing tests. Then in
> the end, after all modules have been built and all tests run (for those
> modules which could actually be built without compile errors, of
> course), I want to see an overall test result and a properly failed
> build. In plain English: I want what '-fae' always should have done to
> begin with. I really don't know what is so difficult to understand about
> this simple requirement: build as much as possible, test as much as
> possible, then report the correct result at the end. I want failed tests
> to fail the build in the end, but I do not want them to keep dependent
> modules from being built and tested.
>
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Delany schrieb am 26.02.2022 14:17 (GMT +07:00):
>
> > Oh its not, im just being thorough.
> > It just seems like your build iteration isn't frequent enough. If you're
> > not building on every MR/PR or with every push, maybe you need a separate
> > test build. Or maybe your reactor is too large and you need to split it
> > into separate projects. You could also leave the reactor but build via a
> > script that looks for pom files and tests them one at a time. Ugly, but
> > effective.
> > Bottom line is that install and deploy phases don't create dependencies
> > within a reactor, so its no biggy that they delay their execution until
> > after. Anything that happens before then does, and its not unreasonable
> to
> > expect development to work within that constraint.
> > Delany
> >
> >
> > On Fri, 25 Feb 2022 at 19:40, Alexander Kriegisch <
> alexander@kriegisch.name>
> > wrote:
> >
> >> Thanks for digging, Delany. However, I am failing to see how this is
> >> meant to solve my problem. Could you elaborate, please?
> >> --
> >> Alexander Kriegisch
> >> https://scrum-master.de
> >>
> >>
> >> Delany schrieb am 25.02.2022 18:05 (GMT +07:00):
> >>
> >> > Alexander, here it is: https://github.com/raydac/mvn-finisher
> >> > Delany
> >> >
> >> > On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com>
> wrote:
> >> >
> >> >> Someone already wrote an "at end maven plugin". I used it for a while
> >> but
> >> >> removed it. Can't for the life of me find it in
> >> >> github/google/confluence/git log. Sorry!
> >> >> Delany
> >> >>
> >> >>
> >> >> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <
> >> alexander@kriegisch.name>
> >> >> wrote:
> >> >>
> >> >>> >> In case you are ready to make you own plugin, it is relatively
> easy.
> >> >>>
> >> >>> I am not, Lasse. I also want this to work on the command line and
> not
> >> >>> depend on CI-system-specific workarounds. But thank you for your
> >> >>> insightful ideas, I really appreciate them.
> >> >>>
> >> >>> Tibor, actually I wanted to avoid a potentially lengthy debate on
> basic
> >> >>> principles, but I agree on having one, if you feel it is necessary.
> I
> >> >>> owe you that much, because it tells me that you are not taking
> design
> >> >>> decisions lightly. So if I can contribute to your decision-making
> >> >>> process, I shall humbly do so. Not being a Maven (plugin) developer
> >> >>> myself, but rather a just user with a bit of background knowledge,
> I in
> >> >>> fact did previously in this thread comment on the two famous
> '*AtEnd'
> >> >>> precedence cases already:
> >> >>>
> >> >>> >>>> Install and Deploy plugins (...): 'installAtEnd' and
> 'deployAtEnd'
> >> >>> >>>> are blessings IMO, and they are cornerstones of my work,
> because
> >> >>> >>>> they help to avoid half-installed and - even worse -
> half-deployed
> >> >>> >>>> multi-module projects which would lead to inconsistencies in
> >> >>> >>>> repositories and might be hard to rectify in remote
> repositories,
> >> >>> >>>> "burning" release numbers unnecessarily.
> >> >>>
> >> >>> The gist is: Those '*AtEnd' features have user value. If you say
> that
> >> >>> they might be difficult to maintain and shield against side
> effects, I
> >> >>> have to take your word for it. So we have a trade-off situation
> here,
> >> >>> chances vs risks. As the person requesting such a feature, of
> course I
> >> >>> have a chances bias. As a plugin maintainer, of course you take a
> more
> >> >>> conservative or defensive stance. I understand that. In the end, it
> is
> >> >>> your decision. Hopefully others here can contribute more
> substantially
> >> >>> to the discussion than I can.
> >> >>>
> >> >>> --
> >> >>> Alexander Kriegisch
> >> >>> https://scrum-master.de
> >> >>>
> >> >>>
> ---------------------------------------------------------------------
> >> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >>> For additional commands, e-mail: users-help@maven.apache.org
> >> >>>
> >> >>>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Alexander Kriegisch <al...@kriegisch.name>.
Delany,

you are completely misunderstanding my use case. I am building with
every push, that is the pain, because I have a choice to

  -- either see all test results with '-fn' but get a wrong build result
     (passed)

  -- or fewer test results with '-fae' and a correct build result
     (failed).

I do *not* wish to run tests in a later phase. I have no idea where you
got that idea from. I simply want the build to continue for modules
dependent on ones with failing tests, so I can find out if they build
successfully and whether or not they also have failing tests. Then in
the end, after all modules have been built and all tests run (for those
modules which could actually be built without compile errors, of
course), I want to see an overall test result and a properly failed
build. In plain English: I want what '-fae' always should have done to
begin with. I really don't know what is so difficult to understand about
this simple requirement: build as much as possible, test as much as
possible, then report the correct result at the end. I want failed tests
to fail the build in the end, but I do not want them to keep dependent
modules from being built and tested.

-- 
Alexander Kriegisch
https://scrum-master.de


Delany schrieb am 26.02.2022 14:17 (GMT +07:00):

> Oh its not, im just being thorough.
> It just seems like your build iteration isn't frequent enough. If you're
> not building on every MR/PR or with every push, maybe you need a separate
> test build. Or maybe your reactor is too large and you need to split it
> into separate projects. You could also leave the reactor but build via a
> script that looks for pom files and tests them one at a time. Ugly, but
> effective.
> Bottom line is that install and deploy phases don't create dependencies
> within a reactor, so its no biggy that they delay their execution until
> after. Anything that happens before then does, and its not unreasonable to
> expect development to work within that constraint.
> Delany
> 
> 
> On Fri, 25 Feb 2022 at 19:40, Alexander Kriegisch <al...@kriegisch.name>
> wrote:
> 
>> Thanks for digging, Delany. However, I am failing to see how this is
>> meant to solve my problem. Could you elaborate, please?
>> --
>> Alexander Kriegisch
>> https://scrum-master.de
>>
>>
>> Delany schrieb am 25.02.2022 18:05 (GMT +07:00):
>>
>> > Alexander, here it is: https://github.com/raydac/mvn-finisher
>> > Delany
>> >
>> > On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com> wrote:
>> >
>> >> Someone already wrote an "at end maven plugin". I used it for a while
>> but
>> >> removed it. Can't for the life of me find it in
>> >> github/google/confluence/git log. Sorry!
>> >> Delany
>> >>
>> >>
>> >> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <
>> alexander@kriegisch.name>
>> >> wrote:
>> >>
>> >>> >> In case you are ready to make you own plugin, it is relatively easy.
>> >>>
>> >>> I am not, Lasse. I also want this to work on the command line and not
>> >>> depend on CI-system-specific workarounds. But thank you for your
>> >>> insightful ideas, I really appreciate them.
>> >>>
>> >>> Tibor, actually I wanted to avoid a potentially lengthy debate on basic
>> >>> principles, but I agree on having one, if you feel it is necessary. I
>> >>> owe you that much, because it tells me that you are not taking design
>> >>> decisions lightly. So if I can contribute to your decision-making
>> >>> process, I shall humbly do so. Not being a Maven (plugin) developer
>> >>> myself, but rather a just user with a bit of background knowledge, I in
>> >>> fact did previously in this thread comment on the two famous '*AtEnd'
>> >>> precedence cases already:
>> >>>
>> >>> >>>> Install and Deploy plugins (...): 'installAtEnd' and 'deployAtEnd'
>> >>> >>>> are blessings IMO, and they are cornerstones of my work, because
>> >>> >>>> they help to avoid half-installed and - even worse - half-deployed
>> >>> >>>> multi-module projects which would lead to inconsistencies in
>> >>> >>>> repositories and might be hard to rectify in remote repositories,
>> >>> >>>> "burning" release numbers unnecessarily.
>> >>>
>> >>> The gist is: Those '*AtEnd' features have user value. If you say that
>> >>> they might be difficult to maintain and shield against side effects, I
>> >>> have to take your word for it. So we have a trade-off situation here,
>> >>> chances vs risks. As the person requesting such a feature, of course I
>> >>> have a chances bias. As a plugin maintainer, of course you take a more
>> >>> conservative or defensive stance. I understand that. In the end, it is
>> >>> your decision. Hopefully others here can contribute more substantially
>> >>> to the discussion than I can.
>> >>>
>> >>> --
>> >>> Alexander Kriegisch
>> >>> https://scrum-master.de
>> >>>
>> >>> ---------------------------------------------------------------------
>> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >>> For additional commands, e-mail: users-help@maven.apache.org
>> >>>
>> >>>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Delany <de...@gmail.com>.
Oh its not, im just being thorough.
It just seems like your build iteration isn't frequent enough. If you're
not building on every MR/PR or with every push, maybe you need a separate
test build. Or maybe your reactor is too large and you need to split it
into separate projects. You could also leave the reactor but build via a
script that looks for pom files and tests them one at a time. Ugly, but
effective.
Bottom line is that install and deploy phases don't create dependencies
within a reactor, so its no biggy that they delay their execution until
after. Anything that happens before then does, and its not unreasonable to
expect development to work within that constraint.
Delany


On Fri, 25 Feb 2022 at 19:40, Alexander Kriegisch <al...@kriegisch.name>
wrote:

> Thanks for digging, Delany. However, I am failing to see how this is
> meant to solve my problem. Could you elaborate, please?
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Delany schrieb am 25.02.2022 18:05 (GMT +07:00):
>
> > Alexander, here it is: https://github.com/raydac/mvn-finisher
> > Delany
> >
> > On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com> wrote:
> >
> >> Someone already wrote an "at end maven plugin". I used it for a while
> but
> >> removed it. Can't for the life of me find it in
> >> github/google/confluence/git log. Sorry!
> >> Delany
> >>
> >>
> >> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <
> alexander@kriegisch.name>
> >> wrote:
> >>
> >>> >> In case you are ready to make you own plugin, it is relatively easy.
> >>>
> >>> I am not, Lasse. I also want this to work on the command line and not
> >>> depend on CI-system-specific workarounds. But thank you for your
> >>> insightful ideas, I really appreciate them.
> >>>
> >>> Tibor, actually I wanted to avoid a potentially lengthy debate on basic
> >>> principles, but I agree on having one, if you feel it is necessary. I
> >>> owe you that much, because it tells me that you are not taking design
> >>> decisions lightly. So if I can contribute to your decision-making
> >>> process, I shall humbly do so. Not being a Maven (plugin) developer
> >>> myself, but rather a just user with a bit of background knowledge, I in
> >>> fact did previously in this thread comment on the two famous '*AtEnd'
> >>> precedence cases already:
> >>>
> >>> >>>> Install and Deploy plugins (...): 'installAtEnd' and 'deployAtEnd'
> >>> >>>> are blessings IMO, and they are cornerstones of my work, because
> >>> >>>> they help to avoid half-installed and - even worse - half-deployed
> >>> >>>> multi-module projects which would lead to inconsistencies in
> >>> >>>> repositories and might be hard to rectify in remote repositories,
> >>> >>>> "burning" release numbers unnecessarily.
> >>>
> >>> The gist is: Those '*AtEnd' features have user value. If you say that
> >>> they might be difficult to maintain and shield against side effects, I
> >>> have to take your word for it. So we have a trade-off situation here,
> >>> chances vs risks. As the person requesting such a feature, of course I
> >>> have a chances bias. As a plugin maintainer, of course you take a more
> >>> conservative or defensive stance. I understand that. In the end, it is
> >>> your decision. Hopefully others here can contribute more substantially
> >>> to the discussion than I can.
> >>>
> >>> --
> >>> Alexander Kriegisch
> >>> https://scrum-master.de
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >>> For additional commands, e-mail: users-help@maven.apache.org
> >>>
> >>>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Alexander Kriegisch <al...@kriegisch.name>.
Thanks for digging, Delany. However, I am failing to see how this is
meant to solve my problem. Could you elaborate, please?
-- 
Alexander Kriegisch
https://scrum-master.de


Delany schrieb am 25.02.2022 18:05 (GMT +07:00):

> Alexander, here it is: https://github.com/raydac/mvn-finisher
> Delany
> 
> On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com> wrote:
> 
>> Someone already wrote an "at end maven plugin". I used it for a while but
>> removed it. Can't for the life of me find it in
>> github/google/confluence/git log. Sorry!
>> Delany
>>
>>
>> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <al...@kriegisch.name>
>> wrote:
>>
>>> >> In case you are ready to make you own plugin, it is relatively easy.
>>>
>>> I am not, Lasse. I also want this to work on the command line and not
>>> depend on CI-system-specific workarounds. But thank you for your
>>> insightful ideas, I really appreciate them.
>>>
>>> Tibor, actually I wanted to avoid a potentially lengthy debate on basic
>>> principles, but I agree on having one, if you feel it is necessary. I
>>> owe you that much, because it tells me that you are not taking design
>>> decisions lightly. So if I can contribute to your decision-making
>>> process, I shall humbly do so. Not being a Maven (plugin) developer
>>> myself, but rather a just user with a bit of background knowledge, I in
>>> fact did previously in this thread comment on the two famous '*AtEnd'
>>> precedence cases already:
>>>
>>> >>>> Install and Deploy plugins (...): 'installAtEnd' and 'deployAtEnd'
>>> >>>> are blessings IMO, and they are cornerstones of my work, because
>>> >>>> they help to avoid half-installed and - even worse - half-deployed
>>> >>>> multi-module projects which would lead to inconsistencies in
>>> >>>> repositories and might be hard to rectify in remote repositories,
>>> >>>> "burning" release numbers unnecessarily.
>>>
>>> The gist is: Those '*AtEnd' features have user value. If you say that
>>> they might be difficult to maintain and shield against side effects, I
>>> have to take your word for it. So we have a trade-off situation here,
>>> chances vs risks. As the person requesting such a feature, of course I
>>> have a chances bias. As a plugin maintainer, of course you take a more
>>> conservative or defensive stance. I understand that. In the end, it is
>>> your decision. Hopefully others here can contribute more substantially
>>> to the discussion than I can.
>>>
>>> --
>>> Alexander Kriegisch
>>> https://scrum-master.de
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Delany <de...@gmail.com>.
Alexander, here it is: https://github.com/raydac/mvn-finisher
Delany

On Mon, 7 Feb 2022 at 08:17, Delany <de...@gmail.com> wrote:

> Someone already wrote an "at end maven plugin". I used it for a while but
> removed it. Can't for the life of me find it in
> github/google/confluence/git log. Sorry!
> Delany
>
>
> On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <al...@kriegisch.name>
> wrote:
>
>> >> In case you are ready to make you own plugin, it is relatively easy.
>>
>> I am not, Lasse. I also want this to work on the command line and not
>> depend on CI-system-specific workarounds. But thank you for your
>> insightful ideas, I really appreciate them.
>>
>> Tibor, actually I wanted to avoid a potentially lengthy debate on basic
>> principles, but I agree on having one, if you feel it is necessary. I
>> owe you that much, because it tells me that you are not taking design
>> decisions lightly. So if I can contribute to your decision-making
>> process, I shall humbly do so. Not being a Maven (plugin) developer
>> myself, but rather a just user with a bit of background knowledge, I in
>> fact did previously in this thread comment on the two famous '*AtEnd'
>> precedence cases already:
>>
>> >>>> Install and Deploy plugins (...): 'installAtEnd' and 'deployAtEnd'
>> >>>> are blessings IMO, and they are cornerstones of my work, because
>> >>>> they help to avoid half-installed and - even worse - half-deployed
>> >>>> multi-module projects which would lead to inconsistencies in
>> >>>> repositories and might be hard to rectify in remote repositories,
>> >>>> "burning" release numbers unnecessarily.
>>
>> The gist is: Those '*AtEnd' features have user value. If you say that
>> they might be difficult to maintain and shield against side effects, I
>> have to take your word for it. So we have a trade-off situation here,
>> chances vs risks. As the person requesting such a feature, of course I
>> have a chances bias. As a plugin maintainer, of course you take a more
>> conservative or defensive stance. I understand that. In the end, it is
>> your decision. Hopefully others here can contribute more substantially
>> to the discussion than I can.
>>
>> --
>> Alexander Kriegisch
>> https://scrum-master.de
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Delany <de...@gmail.com>.
Someone already wrote an "at end maven plugin". I used it for a while but
removed it. Can't for the life of me find it in
github/google/confluence/git log. Sorry!
Delany


On Mon, 7 Feb 2022 at 04:38, Alexander Kriegisch <al...@kriegisch.name>
wrote:

> >> In case you are ready to make you own plugin, it is relatively easy.
>
> I am not, Lasse. I also want this to work on the command line and not
> depend on CI-system-specific workarounds. But thank you for your
> insightful ideas, I really appreciate them.
>
> Tibor, actually I wanted to avoid a potentially lengthy debate on basic
> principles, but I agree on having one, if you feel it is necessary. I
> owe you that much, because it tells me that you are not taking design
> decisions lightly. So if I can contribute to your decision-making
> process, I shall humbly do so. Not being a Maven (plugin) developer
> myself, but rather a just user with a bit of background knowledge, I in
> fact did previously in this thread comment on the two famous '*AtEnd'
> precedence cases already:
>
> >>>> Install and Deploy plugins (...): 'installAtEnd' and 'deployAtEnd'
> >>>> are blessings IMO, and they are cornerstones of my work, because
> >>>> they help to avoid half-installed and - even worse - half-deployed
> >>>> multi-module projects which would lead to inconsistencies in
> >>>> repositories and might be hard to rectify in remote repositories,
> >>>> "burning" release numbers unnecessarily.
>
> The gist is: Those '*AtEnd' features have user value. If you say that
> they might be difficult to maintain and shield against side effects, I
> have to take your word for it. So we have a trade-off situation here,
> chances vs risks. As the person requesting such a feature, of course I
> have a chances bias. As a plugin maintainer, of course you take a more
> conservative or defensive stance. I understand that. In the end, it is
> your decision. Hopefully others here can contribute more substantially
> to the discussion than I can.
>
> --
> Alexander Kriegisch
> https://scrum-master.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Alexander Kriegisch <al...@kriegisch.name>.
>> In case you are ready to make you own plugin, it is relatively easy.

I am not, Lasse. I also want this to work on the command line and not
depend on CI-system-specific workarounds. But thank you for your
insightful ideas, I really appreciate them.

Tibor, actually I wanted to avoid a potentially lengthy debate on basic
principles, but I agree on having one, if you feel it is necessary. I
owe you that much, because it tells me that you are not taking design
decisions lightly. So if I can contribute to your decision-making
process, I shall humbly do so. Not being a Maven (plugin) developer
myself, but rather a just user with a bit of background knowledge, I in
fact did previously in this thread comment on the two famous '*AtEnd'
precedence cases already:

>>>> Install and Deploy plugins (...): 'installAtEnd' and 'deployAtEnd'
>>>> are blessings IMO, and they are cornerstones of my work, because
>>>> they help to avoid half-installed and - even worse - half-deployed
>>>> multi-module projects which would lead to inconsistencies in
>>>> repositories and might be hard to rectify in remote repositories,
>>>> "burning" release numbers unnecessarily.

The gist is: Those '*AtEnd' features have user value. If you say that
they might be difficult to maintain and shield against side effects, I
have to take your word for it. So we have a trade-off situation here,
chances vs risks. As the person requesting such a feature, of course I
have a chances bias. As a plugin maintainer, of course you take a more
conservative or defensive stance. I understand that. In the end, it is
your decision. Hopefully others here can contribute more substantially
to the discussion than I can.

-- 
Alexander Kriegisch
https://scrum-master.de

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
The good way is to discuss the principle xxxAtEnd first and then implement
it properly. Implementing a hack would persist the hack forever and that is
the reality, the practice shows us that it is hapenning.

Dňa ne 6. 2. 2022, 20:02 Lasse Lindqvist <la...@gmail.com>
napísal(a):

> In case you are ready to make you own plugin, it is relatively easy.
>
>
> https://github.com/apache/maven-surefire/tree/master/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report
> contains the code on how the test report is parsed. I could not find proper
> XSD schema for the structure, maybe it does not exist, since I could not
> find any references to such a thing.
> The writing happens for example here
>
> https://github.com/apache/maven-surefire/blob/b9b2381a3dba6574bb69bd91d45fe0edea29c779/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java#L418
>
> So, you can just run the tests with -DtestFailureIgnore=true, and the make
> your plugin run at the end of the build, parse the result and fail the
> build if needed.
>
> Any test publishers in CI systems such as the Jenkins Junit plugin will
> find all the test reports generated and are able to publish them.
>
> Also in Jenkins you can also easily fail the build using the Junit plugin,
> see https://stackoverflow.com/a/57481054. In that case you don't even need
> a custom plugin. So be sure to check what kind of functions the CI system
> you use provides here.
>
>
> su 6. helmik. 2022 klo 14.08 Tibor Digana (tibordigana@apache.org)
> kirjoitti:
>
> > Alexander, all I wanted to say is to discuss the xxxAtEnd as a Maven
> > pattern.
> > Is it what we really want to have in Maven?
> > Last time we discussed it we said that it was a workaround.
> > It should not be a problem to implement in Surefire but it might be an
> > internal issue and we should avoid it. So let's discuss this pattern in
> > general on the ML apart of the target in a concrete plugin.
> >
> > On Sun, Feb 6, 2022 at 7:46 AM Alexander Kriegisch <
> > alexander@kriegisch.name>
> > wrote:
> >
> > > Actually, I am not sure I want to compare with Install and Deploy
> > > plugin, but because you were mentioning them: 'installAtEnd' and
> > > 'deployAtEnd' are blessings IMO, and they are cornerstones of my work,
> > > because they help to avoid half-installed and - even worse -
> > > half-deployed multi-module projects which would lead to inconsistencies
> > > in repositories and might be hard to rectify in remote repositories,
> > > "burning" release numbers unnecessarily.
> > >
> > > Back to the topic at hand: Having a way to run all tests for a
> > > multi-module project which would build and package perfectly fine when
> > > skipping tests, i.e. not either forcing testing to stop for dependent
> > > projects (skipping tests there) or making the build falsely report
> > > success in the end, is a perfectly valid use case. Who would not like
> to
> > > have that? Creating a report for all failing tests without cheating the
> > > build result to be successful would simply be useful.
> > >
> > > --
> > > Alexander Kriegisch
> > > https://scrum-master.de
> > >
> > >
> > > Tibor Digana schrieb am 06.02.2022 01:45 (GMT +07:00):
> > >
> > > > It is basically the same feature known in the maven-deploy-plugin
> > > >
> > >
> >
> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd
> > > >
> > > > Not sure if the command
> > > > mvn deploy -DdeployAtEnd
> > > > would fail to deploy dependent modules if the first module fails.
> > > >
> > > > We discussed this feature some time and we said that these features
> > > > xxxAtEnd are a hack.
> > > > The question is regarding Maven 4 and Maven 5.
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
> > > alexander@kriegisch.name>
> > > > wrote:
> > > >
> > > >> I know that this probably is a classic question, because there
> > suggested
> > > >> answers on Stack Overflow (and maybe also somewhere here in this
> > mailing
> > > >> list), but I did not found anything satisfying the following
> criteria:
> > > >>
> > > >>   1. Run all Surefire tests, if compilation succeeds, also those of
> > > >>      dependent modules, even if there are tests with failurer or
> > errors.
> > > >>      (We leave Failsafe out of the picture for now for simplicity's
> > > >>      sake, but basically the same would apply to Failsafe tests for
> > > >>      modules which can be compiled and packaged, despite failing
> > > >>      Surefire tests.)
> > > >>
> > > >>   2. Fail the multi-module build in the end for all modules with
> > failing
> > > >>      tests.
> > > >>
> > > >> I know there is '-fae', but it skips modules depending on ones with
> > test
> > > >> failures.
> > > >>
> > > >> I know there is '-fn', but it falsely makes the whole build pass.
> > > >>
> > > >> I know that the Maven build lifecycle is based on module
> dependencies
> > > >> and that dependent modules usually should not be built, if a
> > dependency
> > > >> fails to build. But OTOH, the same build would pass with
> > '-DskipTests',
> > > >> and the requirement that artifacts be compiled and packaged and
> > > >> dependent modules built, because those artifacts can in fact be
> > compiled
> > > >> and packaged, makes practical sense. Basically, the user wants test
> > > >> failures reported correctly, but still make sure that as many tests
> as
> > > >> possible are being run.
> > > >>
> > > >> Is there any way to achieve that?
> > > >> --
> > > >> Alexander Kriegisch
> > > >> https://scrum-master.de
> > > >>
> > > >>
> ---------------------------------------------------------------------
> > > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > >> For additional commands, e-mail: users-help@maven.apache.org
> > > >>
> > > >>
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Lasse Lindqvist <la...@gmail.com>.
In case you are ready to make you own plugin, it is relatively easy.

https://github.com/apache/maven-surefire/tree/master/surefire-report-parser/src/main/java/org/apache/maven/plugins/surefire/report
contains the code on how the test report is parsed. I could not find proper
XSD schema for the structure, maybe it does not exist, since I could not
find any references to such a thing.
The writing happens for example here
https://github.com/apache/maven-surefire/blob/b9b2381a3dba6574bb69bd91d45fe0edea29c779/maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporter.java#L418

So, you can just run the tests with -DtestFailureIgnore=true, and the make
your plugin run at the end of the build, parse the result and fail the
build if needed.

Any test publishers in CI systems such as the Jenkins Junit plugin will
find all the test reports generated and are able to publish them.

Also in Jenkins you can also easily fail the build using the Junit plugin,
see https://stackoverflow.com/a/57481054. In that case you don't even need
a custom plugin. So be sure to check what kind of functions the CI system
you use provides here.


su 6. helmik. 2022 klo 14.08 Tibor Digana (tibordigana@apache.org)
kirjoitti:

> Alexander, all I wanted to say is to discuss the xxxAtEnd as a Maven
> pattern.
> Is it what we really want to have in Maven?
> Last time we discussed it we said that it was a workaround.
> It should not be a problem to implement in Surefire but it might be an
> internal issue and we should avoid it. So let's discuss this pattern in
> general on the ML apart of the target in a concrete plugin.
>
> On Sun, Feb 6, 2022 at 7:46 AM Alexander Kriegisch <
> alexander@kriegisch.name>
> wrote:
>
> > Actually, I am not sure I want to compare with Install and Deploy
> > plugin, but because you were mentioning them: 'installAtEnd' and
> > 'deployAtEnd' are blessings IMO, and they are cornerstones of my work,
> > because they help to avoid half-installed and - even worse -
> > half-deployed multi-module projects which would lead to inconsistencies
> > in repositories and might be hard to rectify in remote repositories,
> > "burning" release numbers unnecessarily.
> >
> > Back to the topic at hand: Having a way to run all tests for a
> > multi-module project which would build and package perfectly fine when
> > skipping tests, i.e. not either forcing testing to stop for dependent
> > projects (skipping tests there) or making the build falsely report
> > success in the end, is a perfectly valid use case. Who would not like to
> > have that? Creating a report for all failing tests without cheating the
> > build result to be successful would simply be useful.
> >
> > --
> > Alexander Kriegisch
> > https://scrum-master.de
> >
> >
> > Tibor Digana schrieb am 06.02.2022 01:45 (GMT +07:00):
> >
> > > It is basically the same feature known in the maven-deploy-plugin
> > >
> >
> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd
> > >
> > > Not sure if the command
> > > mvn deploy -DdeployAtEnd
> > > would fail to deploy dependent modules if the first module fails.
> > >
> > > We discussed this feature some time and we said that these features
> > > xxxAtEnd are a hack.
> > > The question is regarding Maven 4 and Maven 5.
> > >
> > >
> > >
> > >
> > >
> > > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
> > alexander@kriegisch.name>
> > > wrote:
> > >
> > >> I know that this probably is a classic question, because there
> suggested
> > >> answers on Stack Overflow (and maybe also somewhere here in this
> mailing
> > >> list), but I did not found anything satisfying the following criteria:
> > >>
> > >>   1. Run all Surefire tests, if compilation succeeds, also those of
> > >>      dependent modules, even if there are tests with failurer or
> errors.
> > >>      (We leave Failsafe out of the picture for now for simplicity's
> > >>      sake, but basically the same would apply to Failsafe tests for
> > >>      modules which can be compiled and packaged, despite failing
> > >>      Surefire tests.)
> > >>
> > >>   2. Fail the multi-module build in the end for all modules with
> failing
> > >>      tests.
> > >>
> > >> I know there is '-fae', but it skips modules depending on ones with
> test
> > >> failures.
> > >>
> > >> I know there is '-fn', but it falsely makes the whole build pass.
> > >>
> > >> I know that the Maven build lifecycle is based on module dependencies
> > >> and that dependent modules usually should not be built, if a
> dependency
> > >> fails to build. But OTOH, the same build would pass with
> '-DskipTests',
> > >> and the requirement that artifacts be compiled and packaged and
> > >> dependent modules built, because those artifacts can in fact be
> compiled
> > >> and packaged, makes practical sense. Basically, the user wants test
> > >> failures reported correctly, but still make sure that as many tests as
> > >> possible are being run.
> > >>
> > >> Is there any way to achieve that?
> > >> --
> > >> Alexander Kriegisch
> > >> https://scrum-master.de
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >> For additional commands, e-mail: users-help@maven.apache.org
> > >>
> > >>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
Alexander, all I wanted to say is to discuss the xxxAtEnd as a Maven
pattern.
Is it what we really want to have in Maven?
Last time we discussed it we said that it was a workaround.
It should not be a problem to implement in Surefire but it might be an
internal issue and we should avoid it. So let's discuss this pattern in
general on the ML apart of the target in a concrete plugin.

On Sun, Feb 6, 2022 at 7:46 AM Alexander Kriegisch <al...@kriegisch.name>
wrote:

> Actually, I am not sure I want to compare with Install and Deploy
> plugin, but because you were mentioning them: 'installAtEnd' and
> 'deployAtEnd' are blessings IMO, and they are cornerstones of my work,
> because they help to avoid half-installed and - even worse -
> half-deployed multi-module projects which would lead to inconsistencies
> in repositories and might be hard to rectify in remote repositories,
> "burning" release numbers unnecessarily.
>
> Back to the topic at hand: Having a way to run all tests for a
> multi-module project which would build and package perfectly fine when
> skipping tests, i.e. not either forcing testing to stop for dependent
> projects (skipping tests there) or making the build falsely report
> success in the end, is a perfectly valid use case. Who would not like to
> have that? Creating a report for all failing tests without cheating the
> build result to be successful would simply be useful.
>
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Tibor Digana schrieb am 06.02.2022 01:45 (GMT +07:00):
>
> > It is basically the same feature known in the maven-deploy-plugin
> >
> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd
> >
> > Not sure if the command
> > mvn deploy -DdeployAtEnd
> > would fail to deploy dependent modules if the first module fails.
> >
> > We discussed this feature some time and we said that these features
> > xxxAtEnd are a hack.
> > The question is regarding Maven 4 and Maven 5.
> >
> >
> >
> >
> >
> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
> alexander@kriegisch.name>
> > wrote:
> >
> >> I know that this probably is a classic question, because there suggested
> >> answers on Stack Overflow (and maybe also somewhere here in this mailing
> >> list), but I did not found anything satisfying the following criteria:
> >>
> >>   1. Run all Surefire tests, if compilation succeeds, also those of
> >>      dependent modules, even if there are tests with failurer or errors.
> >>      (We leave Failsafe out of the picture for now for simplicity's
> >>      sake, but basically the same would apply to Failsafe tests for
> >>      modules which can be compiled and packaged, despite failing
> >>      Surefire tests.)
> >>
> >>   2. Fail the multi-module build in the end for all modules with failing
> >>      tests.
> >>
> >> I know there is '-fae', but it skips modules depending on ones with test
> >> failures.
> >>
> >> I know there is '-fn', but it falsely makes the whole build pass.
> >>
> >> I know that the Maven build lifecycle is based on module dependencies
> >> and that dependent modules usually should not be built, if a dependency
> >> fails to build. But OTOH, the same build would pass with '-DskipTests',
> >> and the requirement that artifacts be compiled and packaged and
> >> dependent modules built, because those artifacts can in fact be compiled
> >> and packaged, makes practical sense. Basically, the user wants test
> >> failures reported correctly, but still make sure that as many tests as
> >> possible are being run.
> >>
> >> Is there any way to achieve that?
> >> --
> >> Alexander Kriegisch
> >> https://scrum-master.de
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Mantas Gridinas <mg...@gmail.com>.
Ah, I missed the rest of the thread. Nevermind.

On Sun, Feb 6, 2022 at 8:25 AM Alexander Kriegisch <al...@kriegisch.name>
wrote:

> Mantas Gridinas schrieb am 06.02.2022 15:11 (GMT +07:00):
>
> > Doesnt vrrify goal precede the install goal?
>
> Yes. So? What does your question imply?
>
>
> > On Sun, Feb 6, 2022, 08:46 Alexander Kriegisch <alexander@kriegisch.name
> >
> > wrote:
> >
> >> Actually, I am not sure I want to compare with Install and Deploy
> >> plugin, but because you were mentioning them: 'installAtEnd' and
> >> 'deployAtEnd' are blessings IMO, and they are cornerstones of my work,
> >> because they help to avoid half-installed and - even worse -
> >> half-deployed multi-module projects which would lead to inconsistencies
> >> in repositories and might be hard to rectify in remote repositories,
> >> "burning" release numbers unnecessarily.
> >>
> >> Back to the topic at hand: Having a way to run all tests for a
> >> multi-module project which would build and package perfectly fine when
> >> skipping tests, i.e. not either forcing testing to stop for dependent
> >> projects (skipping tests there) or making the build falsely report
> >> success in the end, is a perfectly valid use case. Who would not like to
> >> have that? Creating a report for all failing tests without cheating the
> >> build result to be successful would simply be useful.
> >>
> >> --
> >> Alexander Kriegisch
> >> https://scrum-master.de
> >>
> >>
> >> Tibor Digana schrieb am 06.02.2022 01:45 (GMT +07:00):
> >>
> >> > It is basically the same feature known in the maven-deploy-plugin
> >> >
> >>
> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd
> >> >
> >> > Not sure if the command
> >> > mvn deploy -DdeployAtEnd
> >> > would fail to deploy dependent modules if the first module fails.
> >> >
> >> > We discussed this feature some time and we said that these features
> >> > xxxAtEnd are a hack.
> >> > The question is regarding Maven 4 and Maven 5.
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
> >> alexander@kriegisch.name>
> >> > wrote:
> >> >
> >> >> I know that this probably is a classic question, because there
> suggested
> >> >> answers on Stack Overflow (and maybe also somewhere here in this
> mailing
> >> >> list), but I did not found anything satisfying the following
> criteria:
> >> >>
> >> >>   1. Run all Surefire tests, if compilation succeeds, also those of
> >> >>      dependent modules, even if there are tests with failurer or
> errors.
> >> >>      (We leave Failsafe out of the picture for now for simplicity's
> >> >>      sake, but basically the same would apply to Failsafe tests for
> >> >>      modules which can be compiled and packaged, despite failing
> >> >>      Surefire tests.)
> >> >>
> >> >>   2. Fail the multi-module build in the end for all modules with
> failing
> >> >>      tests.
> >> >>
> >> >> I know there is '-fae', but it skips modules depending on ones with
> test
> >> >> failures.
> >> >>
> >> >> I know there is '-fn', but it falsely makes the whole build pass.
> >> >>
> >> >> I know that the Maven build lifecycle is based on module dependencies
> >> >> and that dependent modules usually should not be built, if a
> dependency
> >> >> fails to build. But OTOH, the same build would pass with
> '-DskipTests',
> >> >> and the requirement that artifacts be compiled and packaged and
> >> >> dependent modules built, because those artifacts can in fact be
> compiled
> >> >> and packaged, makes practical sense. Basically, the user wants test
> >> >> failures reported correctly, but still make sure that as many tests
> as
> >> >> possible are being run.
> >> >>
> >> >> Is there any way to achieve that?
> >> >> --
> >> >> Alexander Kriegisch
> >> >> https://scrum-master.de
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> >> For additional commands, e-mail: users-help@maven.apache.org
> >> >>
> >> >>
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

-- 
// Mantas

Re: Run all tests (also in dependent modules), fail build at end

Posted by Alexander Kriegisch <al...@kriegisch.name>.
Mantas Gridinas schrieb am 06.02.2022 15:11 (GMT +07:00):

> Doesnt vrrify goal precede the install goal?

Yes. So? What does your question imply?


> On Sun, Feb 6, 2022, 08:46 Alexander Kriegisch <al...@kriegisch.name>
> wrote:
> 
>> Actually, I am not sure I want to compare with Install and Deploy
>> plugin, but because you were mentioning them: 'installAtEnd' and
>> 'deployAtEnd' are blessings IMO, and they are cornerstones of my work,
>> because they help to avoid half-installed and - even worse -
>> half-deployed multi-module projects which would lead to inconsistencies
>> in repositories and might be hard to rectify in remote repositories,
>> "burning" release numbers unnecessarily.
>>
>> Back to the topic at hand: Having a way to run all tests for a
>> multi-module project which would build and package perfectly fine when
>> skipping tests, i.e. not either forcing testing to stop for dependent
>> projects (skipping tests there) or making the build falsely report
>> success in the end, is a perfectly valid use case. Who would not like to
>> have that? Creating a report for all failing tests without cheating the
>> build result to be successful would simply be useful.
>>
>> --
>> Alexander Kriegisch
>> https://scrum-master.de
>>
>>
>> Tibor Digana schrieb am 06.02.2022 01:45 (GMT +07:00):
>>
>> > It is basically the same feature known in the maven-deploy-plugin
>> >
>> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd
>> >
>> > Not sure if the command
>> > mvn deploy -DdeployAtEnd
>> > would fail to deploy dependent modules if the first module fails.
>> >
>> > We discussed this feature some time and we said that these features
>> > xxxAtEnd are a hack.
>> > The question is regarding Maven 4 and Maven 5.
>> >
>> >
>> >
>> >
>> >
>> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
>> alexander@kriegisch.name>
>> > wrote:
>> >
>> >> I know that this probably is a classic question, because there suggested
>> >> answers on Stack Overflow (and maybe also somewhere here in this mailing
>> >> list), but I did not found anything satisfying the following criteria:
>> >>
>> >>   1. Run all Surefire tests, if compilation succeeds, also those of
>> >>      dependent modules, even if there are tests with failurer or errors.
>> >>      (We leave Failsafe out of the picture for now for simplicity's
>> >>      sake, but basically the same would apply to Failsafe tests for
>> >>      modules which can be compiled and packaged, despite failing
>> >>      Surefire tests.)
>> >>
>> >>   2. Fail the multi-module build in the end for all modules with failing
>> >>      tests.
>> >>
>> >> I know there is '-fae', but it skips modules depending on ones with test
>> >> failures.
>> >>
>> >> I know there is '-fn', but it falsely makes the whole build pass.
>> >>
>> >> I know that the Maven build lifecycle is based on module dependencies
>> >> and that dependent modules usually should not be built, if a dependency
>> >> fails to build. But OTOH, the same build would pass with '-DskipTests',
>> >> and the requirement that artifacts be compiled and packaged and
>> >> dependent modules built, because those artifacts can in fact be compiled
>> >> and packaged, makes practical sense. Basically, the user wants test
>> >> failures reported correctly, but still make sure that as many tests as
>> >> possible are being run.
>> >>
>> >> Is there any way to achieve that?
>> >> --
>> >> Alexander Kriegisch
>> >> https://scrum-master.de
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> >> For additional commands, e-mail: users-help@maven.apache.org
>> >>
>> >>
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Mantas Gridinas <mg...@gmail.com>.
Doesnt vrrify goal precede the install goal?

On Sun, Feb 6, 2022, 08:46 Alexander Kriegisch <al...@kriegisch.name>
wrote:

> Actually, I am not sure I want to compare with Install and Deploy
> plugin, but because you were mentioning them: 'installAtEnd' and
> 'deployAtEnd' are blessings IMO, and they are cornerstones of my work,
> because they help to avoid half-installed and - even worse -
> half-deployed multi-module projects which would lead to inconsistencies
> in repositories and might be hard to rectify in remote repositories,
> "burning" release numbers unnecessarily.
>
> Back to the topic at hand: Having a way to run all tests for a
> multi-module project which would build and package perfectly fine when
> skipping tests, i.e. not either forcing testing to stop for dependent
> projects (skipping tests there) or making the build falsely report
> success in the end, is a perfectly valid use case. Who would not like to
> have that? Creating a report for all failing tests without cheating the
> build result to be successful would simply be useful.
>
> --
> Alexander Kriegisch
> https://scrum-master.de
>
>
> Tibor Digana schrieb am 06.02.2022 01:45 (GMT +07:00):
>
> > It is basically the same feature known in the maven-deploy-plugin
> >
> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd
> >
> > Not sure if the command
> > mvn deploy -DdeployAtEnd
> > would fail to deploy dependent modules if the first module fails.
> >
> > We discussed this feature some time and we said that these features
> > xxxAtEnd are a hack.
> > The question is regarding Maven 4 and Maven 5.
> >
> >
> >
> >
> >
> > On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <
> alexander@kriegisch.name>
> > wrote:
> >
> >> I know that this probably is a classic question, because there suggested
> >> answers on Stack Overflow (and maybe also somewhere here in this mailing
> >> list), but I did not found anything satisfying the following criteria:
> >>
> >>   1. Run all Surefire tests, if compilation succeeds, also those of
> >>      dependent modules, even if there are tests with failurer or errors.
> >>      (We leave Failsafe out of the picture for now for simplicity's
> >>      sake, but basically the same would apply to Failsafe tests for
> >>      modules which can be compiled and packaged, despite failing
> >>      Surefire tests.)
> >>
> >>   2. Fail the multi-module build in the end for all modules with failing
> >>      tests.
> >>
> >> I know there is '-fae', but it skips modules depending on ones with test
> >> failures.
> >>
> >> I know there is '-fn', but it falsely makes the whole build pass.
> >>
> >> I know that the Maven build lifecycle is based on module dependencies
> >> and that dependent modules usually should not be built, if a dependency
> >> fails to build. But OTOH, the same build would pass with '-DskipTests',
> >> and the requirement that artifacts be compiled and packaged and
> >> dependent modules built, because those artifacts can in fact be compiled
> >> and packaged, makes practical sense. Basically, the user wants test
> >> failures reported correctly, but still make sure that as many tests as
> >> possible are being run.
> >>
> >> Is there any way to achieve that?
> >> --
> >> Alexander Kriegisch
> >> https://scrum-master.de
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Alexander Kriegisch <al...@kriegisch.name>.
Actually, I am not sure I want to compare with Install and Deploy
plugin, but because you were mentioning them: 'installAtEnd' and
'deployAtEnd' are blessings IMO, and they are cornerstones of my work,
because they help to avoid half-installed and - even worse -
half-deployed multi-module projects which would lead to inconsistencies
in repositories and might be hard to rectify in remote repositories,
"burning" release numbers unnecessarily.

Back to the topic at hand: Having a way to run all tests for a
multi-module project which would build and package perfectly fine when
skipping tests, i.e. not either forcing testing to stop for dependent
projects (skipping tests there) or making the build falsely report
success in the end, is a perfectly valid use case. Who would not like to
have that? Creating a report for all failing tests without cheating the
build result to be successful would simply be useful.

-- 
Alexander Kriegisch
https://scrum-master.de


Tibor Digana schrieb am 06.02.2022 01:45 (GMT +07:00):

> It is basically the same feature known in the maven-deploy-plugin
> https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd
> 
> Not sure if the command
> mvn deploy -DdeployAtEnd
> would fail to deploy dependent modules if the first module fails.
> 
> We discussed this feature some time and we said that these features
> xxxAtEnd are a hack.
> The question is regarding Maven 4 and Maven 5.
> 
> 
> 
> 
> 
> On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <al...@kriegisch.name>
> wrote:
> 
>> I know that this probably is a classic question, because there suggested
>> answers on Stack Overflow (and maybe also somewhere here in this mailing
>> list), but I did not found anything satisfying the following criteria:
>>
>>   1. Run all Surefire tests, if compilation succeeds, also those of
>>      dependent modules, even if there are tests with failurer or errors.
>>      (We leave Failsafe out of the picture for now for simplicity's
>>      sake, but basically the same would apply to Failsafe tests for
>>      modules which can be compiled and packaged, despite failing
>>      Surefire tests.)
>>
>>   2. Fail the multi-module build in the end for all modules with failing
>>      tests.
>>
>> I know there is '-fae', but it skips modules depending on ones with test
>> failures.
>>
>> I know there is '-fn', but it falsely makes the whole build pass.
>>
>> I know that the Maven build lifecycle is based on module dependencies
>> and that dependent modules usually should not be built, if a dependency
>> fails to build. But OTOH, the same build would pass with '-DskipTests',
>> and the requirement that artifacts be compiled and packaged and
>> dependent modules built, because those artifacts can in fact be compiled
>> and packaged, makes practical sense. Basically, the user wants test
>> failures reported correctly, but still make sure that as many tests as
>> possible are being run.
>>
>> Is there any way to achieve that?
>> --
>> Alexander Kriegisch
>> https://scrum-master.de
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
It is basically the same feature known in the maven-deploy-plugin
https://maven.apache.org/plugins/maven-deploy-plugin/deploy-mojo.html#deployAtEnd

Not sure if the command
mvn deploy -DdeployAtEnd
would fail to deploy dependent modules if the first module fails.

We discussed this feature some time and we said that these features
xxxAtEnd are a hack.
The question is regarding Maven 4 and Maven 5.





On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <al...@kriegisch.name>
wrote:

> I know that this probably is a classic question, because there suggested
> answers on Stack Overflow (and maybe also somewhere here in this mailing
> list), but I did not found anything satisfying the following criteria:
>
>   1. Run all Surefire tests, if compilation succeeds, also those of
>      dependent modules, even if there are tests with failurer or errors.
>      (We leave Failsafe out of the picture for now for simplicity's
>      sake, but basically the same would apply to Failsafe tests for
>      modules which can be compiled and packaged, despite failing
>      Surefire tests.)
>
>   2. Fail the multi-module build in the end for all modules with failing
>      tests.
>
> I know there is '-fae', but it skips modules depending on ones with test
> failures.
>
> I know there is '-fn', but it falsely makes the whole build pass.
>
> I know that the Maven build lifecycle is based on module dependencies
> and that dependent modules usually should not be built, if a dependency
> fails to build. But OTOH, the same build would pass with '-DskipTests',
> and the requirement that artifacts be compiled and packaged and
> dependent modules built, because those artifacts can in fact be compiled
> and packaged, makes practical sense. Basically, the user wants test
> failures reported correctly, but still make sure that as many tests as
> possible are being run.
>
> Is there any way to achieve that?
> --
> Alexander Kriegisch
> https://scrum-master.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Run all tests (also in dependent modules), fail build at end

Posted by Tibor Digana <ti...@apache.org>.
This is the implementation in maven-deploy-plugin
https://github.com/apache/maven-deploy-plugin/blob/36a2030c8851e21cd1e0bec01c3cea4dc6055a48/src/main/java/org/apache/maven/plugins/deploy/DeployMojo.java#L180

It is caching the objects of ProjectDeployerRequest and called via
maven-artifact.
I can imaging Failsafe verification done in a similar way.
Surefire and Failsafe are very complex, so it would be quite a lot of work.

Maven should have some Event based mechanism regarding the whole build
where the plugin should be able to bind for later execution. I don't think
it has this native mechanism. Then could implement it other way than in the
Deploy plugin.

Cheers
Tibor



On Sat, Feb 5, 2022 at 5:27 AM Alexander Kriegisch <al...@kriegisch.name>
wrote:

> I know that this probably is a classic question, because there suggested
> answers on Stack Overflow (and maybe also somewhere here in this mailing
> list), but I did not found anything satisfying the following criteria:
>
>   1. Run all Surefire tests, if compilation succeeds, also those of
>      dependent modules, even if there are tests with failurer or errors.
>      (We leave Failsafe out of the picture for now for simplicity's
>      sake, but basically the same would apply to Failsafe tests for
>      modules which can be compiled and packaged, despite failing
>      Surefire tests.)
>
>   2. Fail the multi-module build in the end for all modules with failing
>      tests.
>
> I know there is '-fae', but it skips modules depending on ones with test
> failures.
>
> I know there is '-fn', but it falsely makes the whole build pass.
>
> I know that the Maven build lifecycle is based on module dependencies
> and that dependent modules usually should not be built, if a dependency
> fails to build. But OTOH, the same build would pass with '-DskipTests',
> and the requirement that artifacts be compiled and packaged and
> dependent modules built, because those artifacts can in fact be compiled
> and packaged, makes practical sense. Basically, the user wants test
> failures reported correctly, but still make sure that as many tests as
> possible are being run.
>
> Is there any way to achieve that?
> --
> Alexander Kriegisch
> https://scrum-master.de
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>