System properties hidden by hudson while test execution

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

System properties hidden by hudson while test execution

Frederic Camblor
Hi there,

I recently settled up a unit test which is based upon system properties.

When I launch it locally with maven :
> mvn test -DmyProperty=hello
The system property "myProperty" is passed to my test case (that is to say, when I do System.getProperty("myProperty"), "hello" is returned)

Whereas when I launch the same test under hudson (and configuring "Build goals & options" as "test -DmyProperty=hello"), system properties are not set (System.getProperty("myProperty") returns null)

Is there some workaround about this issue ?

FYI, I submitted an issue (3440) with a maven project demonstrating the issue.

Thanks in advance

Frédéric
Reply | Threaded
Open this post in threaded view
|

Re: System properties hidden by hudson while test execution

Frederic Camblor
Could someone download & test this maven project and try it on its hudson ?

By building it in command line with :
> mvn test -DmyProperty=hello
Everything goes well

But while building in hudson with same arguments, it goes wrong :-(

Is it a "normal" behaviour of hudson ?
Thing strange is the fact that if I put "-Dmaven.test.skip=true", under hudson, property will be used and tests won't be executed ...
It looks like every "maven properties" are interpreted but other ones are filtered... Am I wrong ? (I'd sincerely prefer to be :-))

Cheers
Frederic

Frédéric Camblor wrote
Hi there,
I recently settled up a unit test which is based upon system properties.

When I launch it locally with maven :
> mvn test -DmyProperty=hello
The system property "myProperty" is passed to my test case (that is to say,
when I do System.getProperty("myProperty"), "hello" is returned)

Whereas when I launch the same test under hudson (and configuring "Build
goals & options" as "test -DmyProperty=hello"), system properties are not
set (System.getProperty("myProperty") returns null)

Is there some workaround about this issue ?

FYI, I submitted an issue
(3440)<https://hudson.dev.java.net/issues/show_bug.cgi?id=3440> with
a maven project demonstrating the issue.

Thanks in advance

Frédéric