Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id BF4E9200C25 for ; Fri, 24 Feb 2017 16:35:14 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BCD1D160B69; Fri, 24 Feb 2017 15:35:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E1A6B160B5C for ; Fri, 24 Feb 2017 16:35:13 +0100 (CET) Received: (qmail 84842 invoked by uid 500); 24 Feb 2017 15:35:12 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 84831 invoked by uid 99); 24 Feb 2017 15:35:12 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2017 15:35:12 +0000 Received: from desktop-2khsk44 (5248749D.cm-4-1b.dynamic.ziggo.nl [82.72.116.157]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id D4FF11A00A2 for ; Fri, 24 Feb 2017 15:35:11 +0000 (UTC) Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes To: "Maven Users List" Subject: Re: Configuring the surefire plugin - a question References: Date: Fri, 24 Feb 2017 16:35:09 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Robert Scholte" Organization: Apache Software Foundation Message-ID: In-Reply-To: User-Agent: Opera Mail/12.17 (Win64) archived-at: Fri, 24 Feb 2017 15:35:14 -0000 On Fri, 24 Feb 2017 04:32:17 +0100, Paul Hammant wrot= e: > Thanks Jo=E3o, thanks Robert. > > I've taken Robert's snippet and expanded it a little to do what I want= : > > Diff: > https://github.com/paul-hammant/todobackend-jooby/commit/9626a3155eddb= aea74bbf66a3e899b81227842ee > (repo: paul-hammant/todobackend-jooby* branch: expectations*) > > I found that I had to be explicit about excludes too, and have a = > precursor > exclude that is outside of the three executions. > > I did a bunch of trial and error, but this was the minima. > > The test of correctness: > > $ mvn install | grep "Time elapsed" > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.23= 7 = > sec > - in todobackend.TodoUnitTest > Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 7.51= = > sec > - in todobackend.TodoIntegrationTest > Tests run: 4, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 11.6= 08 > sec - in todobackend.TodoWebDriverTest > (ignore some WebDriver noise to std-err) > I can't say I really understand the rules about additive includes and > excludes, but my job is to make speedy builds, not fully understand ev= ery > angle bracket of Maven. Just a small hint about the concept of includes/excludes. A test is executed if and only if it matches any include (or all if ther= e = are no includes) AND doesn't match any exclude. The problem I see is that by default you exclude every test (**/*). This= = implies that all includes are useless. By overriding the excludes per = execution-block you kind of fixed that. Robert > > Regards, > > - Paul > > > On Fri, Feb 17, 2017 at 2:00 PM, Robert Scholte = > wrote: > >> When you only want to change the pom (not the tests), a set of >> executionblocks will do the trick: >> >> >> org.apache.maven.plugins >> maven-surefire-plugin >> 2.18.1 >> >> >> unit-tests >> >> >> **/*Unit*.java >> >> >> >> >> functional-tests >> >> >> **/*WebDriver*.java >> >> >> >> >> integration-tests >> >> >> **/*Integration*.java >> >> >> >> >> >> >> >> On Thu, 16 Feb 2017 11:22:37 +0100, Jo=E3o Cabrita = >> >> wrote: >> >> I'd say you could add executions to the surefire plugin with differen= t >>> categories: >>> https://maven.apache.org/surefire/maven-surefire-plugin/ >>> examples/junit.html#Using_JUnit_Categories >>> >>> Look at this gist (I've omitted some details): >>> https://gist.github.com/kewne/2b909ab5e8035a4e44e406fa35e3276c >>> >>> AFAIK, even if the executions are all bound to the same phase in the= >>> lifecycle, they execute in the order specificied in the POM. >>> Beware this is the behavior I've observed and can't confirm it is >>> specified >>> behavior. >>> >>> >>> >>> Jo=E3o Cabrita >>> >>> On 16 February 2017 at 10:06, Paul Hammant wrote:= >>> >>> Hi folks,. >>>> >>>> I've a fast WebDriver using build that I blogged about: A 16 Second= = >>>> Java >>>> Webapp Build (Including WebDriver Tests) >>>> >>> build-including-webdriver-tests/> >>>> . >>>> >>>> Jooby (like SpringBoot and SparkJava) give new options for testing = - = >>>> it >>>> can >>>> be instantiated in a JUnit test. Everything can be done in Surefire= = >>>> now, >>>> and the Failsafe plugin isn't needed for these. Don't believe me -= = >>>> watch >>>> the video in the blog entry above, it's not long. >>>> >>>> New problem. I want unit tests to run in this order: >>>> >>>> 1. unit >>>> 2. integration (may invoke service calls headlessly) >>>> 3. function (will use WebDriver) >>>> >>>> >>>> I can't work out what magic I have to do with executions to allow = >>>> that to >>>> happen. >>>> >>>> Here is how far I got: >>>> >>>> >>>> https://github.com/paul-hammant/todobackend-jooby/blob/ >>>> master/pom.xml#L74 >>>> >>>> It is all a bit second class, because I'd have to do ... >>>> >>>> mvn clean test -Punit-tests >>>> mvn test -Pintegration-tests >>>> mvn test -Pfunctional-tests >>>> >>>> ... to simulate a pipeline, and I would be happy to just rely on >>>> annotations for classifications. >>>> >>>> I really want to do ... >>>> >>>> mvn clean test -DexecutionOrder=3Dunit,integration,functional >>>> -DstopBuildAtExecutionBoundariesForTestFailures >>>> >>>> >>>> ... and shave seconds off the build. >>>> >>>> How do I configure that tersely and elegantly in the surefire plugi= n >>>> today? >>>> >>> >> ---------------------------------------------------------------------= >> 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