Return-Path: Delivered-To: apmail-maven-users-archive@www.apache.org Received: (qmail 81595 invoked from network); 5 Oct 2010 14:32:36 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Oct 2010 14:32:36 -0000 Received: (qmail 45424 invoked by uid 500); 5 Oct 2010 14:32:34 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 45021 invoked by uid 500); 5 Oct 2010 14:32:30 -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 45013 invoked by uid 99); 5 Oct 2010 14:32:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Oct 2010 14:32:30 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anders.g.hammar@gmail.com designates 209.85.215.171 as permitted sender) Received: from [209.85.215.171] (HELO mail-ey0-f171.google.com) (209.85.215.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Oct 2010 14:32:25 +0000 Received: by eyg7 with SMTP id 7so4581877eyg.30 for ; Tue, 05 Oct 2010 07:32:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=kzfLD4WrOU+GhZqZimThUZVDUuhy5JQEsWaT5wpYOyk=; b=FMwupMxJyuXpcwFo8Yoiy10EA/P1qJStu0FFytPAqNkMAKUa3En6hI5JFGMmg0gcSA AHfyWPMpDo4CAdxLFZqnnB0R3TGzNQ/00qnC7wJSofPGV8X5o4TtbJt70LpzzLtKpOVz m6YxRPQpN7konaTl+wj/rdMUthbfo0j+S1vSc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=vf8y46uUxB3Oot//g7PR7cJ6qDBTBaRAkGrLfAvZmqntT9+gwiJ4PPyzQ937N/1HJI kISNXblM9rUtMKmqqNux5LPDEHuHqAFP9/rSFogB2px2YSwRpOeu/i+DeF6snvOOiLgE pZPFU4ovOcNPpDEd6YWGcJWFAvTC9MfO1x5yI= MIME-Version: 1.0 Received: by 10.213.28.196 with SMTP id n4mr8535908ebc.48.1286289123402; Tue, 05 Oct 2010 07:32:03 -0700 (PDT) Sender: anders.g.hammar@gmail.com Received: by 10.213.4.136 with HTTP; Tue, 5 Oct 2010 07:32:03 -0700 (PDT) In-Reply-To: References: Date: Tue, 5 Oct 2010 16:32:03 +0200 X-Google-Sender-Auth: YAUtKC8zG8S8dPUSmEFnFuVJO5U Message-ID: Subject: Re: Failing a build with maven-failsafe-plugin From: Anders Hammar To: Maven Users List Content-Type: multipart/alternative; boundary=0015174c0ffa4766fe0491df86d6 --0015174c0ffa4766fe0491df86d6 Content-Type: text/plain; charset=ISO-8859-1 Can it be much simpler than a copy 'n' paste example? But as always, a ticket with an improvement suggestion would be very much appreciated by the maven team! /Anders On Tue, Oct 5, 2010 at 16:27, Thomas Sundberg wrote: > Hi all! > > I am indeed missing the verify goal. I added it so my configuration became: > > > org.apache.maven.plugins > maven-failsafe-plugin > 2.6 > > > integration-test > > verify > > > > none > > > **/integration/** > > > > > > > and the result became that Maven is failing the build as well as tearing > down my app server. > > My opinion about the docs you point to Anders is that they are not as clear > as they could have been. > > Thanks for the pointers! > Thomas > > > On Tue, Oct 5, 2010 at 13:58, Anders Hammar wrote: > > > I guess you're missing the verify goal: > > > > http://maven.apache.org/plugins/maven-failsafe-plugin/usage.html > > > > /Anders > > > > On Tue, Oct 5, 2010 at 13:46, Thomas Sundberg wrote: > > > > > Hi! > > > > > > I want to use maven-failsafe-plugin to run some integration tests. I > want > > > Maven to run post-integration-test phase to tear down an application > > > server. > > > If any test fails, I want Maven to fail the build so my CI server can > > pick > > > it up and inform the developer who just made a mistake. > > > > > > My failsafe plugin is configured as: > > > > > > > > > org.apache.maven.plugins > > > maven-failsafe-plugin > > > 2.6 > > > > > > > > > integration-test > > > > > > integration-test > > > > > > > > > > > > none > > > > > > > > > **/integration/** > > > > > > > > > > > > > > > > > > > > > > > > This works fine, my app server gets set up and torn down. My > integration > > > tests are executed properly. But when I add a JUnit test like this: > > > > > > @Test > > > public void failingTest(){ > > > fail("Expected to fail"); > > > } > > > > > > Maven doesn't fail the build. > > > > > > I happily reports: > > > > > > > > > > > > Tests run: 2, Failures: 1, Errors: 0, Skipped: 0 > > > > > > > > > > > > [INFO] BUILD SUCCESS > > > [INFO] > > > > ------------------------------------------------------------------------ > > > [INFO] Total time: 30.828s > > > [INFO] Finished at: Tue Oct 05 13:08:36 CEST 2010 > > > [INFO] Final Memory: 15M/36M > > > [INFO] > > > > ------------------------------------------------------------------------ > > > > > > Do I need to set any additional property to get the > maven-failsafe-plugin > > > to > > > fail the build if a unit test failed? > > > Or am I trying to do something that the failsafe-plugin isn't done for? > > > > > > I'm running Maven 3.0-RC3 > > > > > > mvn -version > > > Apache Maven 3.0-RC3 (r1001464; 2010-09-26 18:14:28+0200) > > > Java version: 1.6.0_21 > > > Java home: C:\java\jdk1.6.0_21\jre > > > Default locale: sv_SE, platform encoding: Cp1252 > > > OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows" > > > > > > /Thomas > > > > > > -- > > > Thomas Sundberg > > > M. Sc. in Computer Science > > > > > > Mobile: +46 70 767 33 15 > > > Blog: http://thomassundberg.wordpress.com/ > > > Twitter: @thomassundberg > > > > > > Better software through faster feedback > > > > > > > > > -- > Thomas Sundberg > M. Sc. in Computer Science > > Mobile: +46 70 767 33 15 > Blog: http://thomassundberg.wordpress.com/ > Twitter: @thomassundberg > > Better software through faster feedback > --0015174c0ffa4766fe0491df86d6--