Just to make clear: *I* did not add *anything* to make it go wrong -- I just execute the existing Maven Dependency Plugin's test suite into which I added an assumption. Neither did I write that plugin nor its tests nor its POM. Just to clarify that.
-Markus -----Ursprüngliche Nachricht----- Von: Tibor Digana [mailto:[email protected]] Gesendet: Montag, 17. August 2020 13:27 An: Maven Developers List Betreff: Re: Assumption fail treated as unexcepted exception?! yes it should be marked Skipped. Many factors may turn this. As for instance I have these experiences with Powermock which always fails the test in IntelliJ IDEA even if the assumption fails. Check it out with almost empty POM and a trivial test and compare the outcome with the one you have attached. And then you will maybe see more. @Test public void test() { assumeTrue(false); } This code should work with JUnit 4.12 and whatever plugin version. Turn this code to your specifics one by one and you will see what you have added necessarily has changed the behavior. T On Sun, Aug 16, 2020 at 1:40 PM Markus KARG <[email protected]> wrote: > Guys, > > > > I'm stuck with working on a new feature due to this, so I hope you can help > me quickly: > > > > JUnit knows assumptions, assertions and exceptions. Failing assertions will > FAIL tests (hence will fail maven builds). Failing assumptions will SKIP > tests (hence will pass maven builds). Exceptions will ERROR tests (hence > will break maven builds). Unfortunately today I noticed that assumptions > actually ERROR test (hence fail builds) in Maven! > > > > (I simply added another test to maven dependency plugin which contains an > always-failing assumption to proof the claim) > > > > [INFO] Results: > > [INFO] > > [ERROR] Errors: > > [ERROR] TestCopyMojo.proofClaim:274 ┐ AssumptionViolated always skip > > [INFO] > > [ERROR] Tests run: 257, Failures: 0, Errors: 1, Skipped: 0 > > > > It seems maven treats JUnit assumptions just like JUnit exceptions! :-( > > > > Can someone tell my why that happens? Do I have to set some option tell > Maven it shall SKIP instead of ERROR on failing assumptions?! > > > > Thanks in advance! > > -Markus Karg > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
