I'm using the ${maven.test.failure.ignore} property in my pom.xml and my 
test runner returns 0 even with failed tests if I explicitly set the value 
with the '-Dmaven.test.failure.ignore=true' switch. But when I run the 
build in Jenkins without any explicit command line switches, it's not set 
to true like I expected. Does Jenkins not automatically set 
maven.test.failure.ignore=true?

Naturally, I can work around this by setting the property explicitly, I'm 
just curious.

On Monday, May 6, 2013 2:22:35 PM UTC-4, Dean Yu wrote:
>
> If you're using the Maven project type, it publishes the test results 
> automatically, so there's nothing else to configure. If you're using a 
> freestyle project, all you need to do is check the appropriate publish test 
> report post-build action, and it will automatically downgrade a successful 
> build to unstable if there are test failures in the test files. (My 
> experience is with the built in "Publish JUnit Test Report", but I believe 
> the xUnit plugin works the same way.)
>
> It's all about the format of the test results. There are many many plugins 
> that can parse different test result formats, so hopefully one would work 
> for you. The xUnit plugin is handy if your test format can be transformed 
> into Junit format; you'd just need to supply an XSL stylesheet that 
> describes the transformation rules.
>
>   -- Dean
>
> On Monday, May 6, 2013 10:41:15 AM UTC-7, Rob Campbell wrote:
>>
>> Aha. Thank you, Dean. That's a good first step. I can add some Maven 
>> configuration and change my test runner to return zero as needed. And then 
>> to indicate to Jenkins that I want to downgrade the build from successful 
>> to unstable? I'll look into outputting test results in a format consumable 
>> by the xUnit plugin, but is there another hook I could use?
>>
>> On Monday, May 6, 2013 1:19:45 PM UTC-4, Dean Yu wrote:
>>>
>>> Hi Rob,
>>>   Usually, build steps that return with a non-zero exit code is what 
>>> marks a build as failed. Test reporters, like the built in Junit reporter, 
>>> can downgrade a build from successful to unstable if it discovers failed 
>>> tests in the test results. It sounds like the maven-nar-plugin might be 
>>> returning a non-zero result on test failures.
>>>
>>>   -- Dean
>>>
>>>
>>> On Monday, May 6, 2013 8:24:16 AM UTC-7, Rob Campbell wrote:
>>>>
>>>> I'm attempting to use Jenkins for CI of a C++ project which is built 
>>>> using the maven-nar-plugin. I'd like to know how I could better integrate 
>>>> the nar-plugin with Jenkins so that failed tests do not cause a broken 
>>>> build, but instead cause an unstable build, as with JUnit tests for Java. 
>>>> The nar plugin has its own test execution goal and doesn't use the 
>>>> surefire 
>>>> plugin.
>>>>
>>>> Any ideas where I would start? Will I need to create a Jenkins plugin? 
>>>> or use an existing Jenkins plugin? or modify the maven-nar-plugin?
>>>>
>>>> Much appreciated,
>>>> Rob
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to