You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Timothy Astle <ti...@caris.com> on 2013/02/05 14:35:08 UTC

failsafe - why does -Dit.test in command line nullify properties in an execution?

FYI:  This is a failsafe specific questionand I'm hoping this is the 
correct fall-back mailing list as the 
surefire-users-subscribe@maven.apache.org address bounces 
(http://maven.apache.org/surefire/maven-failsafe-plugin/mail-lists.html).

I'm using version 2.13 of the maven failsafe plugin.

I have aseries of failsafe executions defined in my POM.  Each execution 
takes a unique set of propertiesthat feed selenium tests the information 
to test a particular browser version.

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-test-selenium-firefox-12.0</id>
<configuration>
<argLine>-Dselenium.port=${selenium.port}
-Dbrowser=firefox
-Dwebapp.url=http://${local_ip}:${cargo.port}/myAwesomeApp/
-Dselenium.host=${selenium.host}
-Dcargo.home=${cargo.container.home}
-Dbrowser.version=12.0
-Dcontext=myAwesomeApp
</argLine>
<includes>
<include>**/selenium/*ITCase.java</include>
</includes>
</configuration>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
...etc.
</plugin>

What I noticed is that if I specify -Dit.test in my command line to cite 
the specific test class that I'd like to test (i.e., mvn 
-Dmaven.failsafe.debug -Dit.test=your.TestCase clean verify 
-Pproduction,selenium), all of the properties within the execution 
argLine are never set.  So the selenium.port is null, the browser is 
null, webapp.url is null, etc. etc.

Is this the intended behaviour? This does not happen if I specify 
-Dmaven.failsafe.debug. I was hoping that it'd just add it.test to the 
existing collection of properties.

Any insight is appreciated,


Tim

Re: failsafe - why does -Dit.test in command line nullify properties in an execution?

Posted by Timothy Astle <ti...@caris.com>.
That's a-okayto be OT.  :)  I appreciate the feedback.

I've updated the configuration to use systemPropertyVariables but I 
still reproduce the same problem.  When I supply it.case via the command 
line, the properties fed into each execution via the 
systempropertyvalues block are nullified.


Tim


On 05/02/2013 9:51 AM, Stephen Connolly wrote:
> Slightly OT.
>
> Why are you using <argLine> which is for things like JVM memory options
> (think -Xmx512m) and not
> http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#systemPropertyVariablesfor
> setting the system properties in surefire/falsesafe's forked JVMs?
>
> You may have a bug, but I suspect the work-around is to use the correct
> tool for the job, i.e. systemPropertyVariables
>
> Now if the JVM options are not being passed through, that is a bug
>
>
> On 5 February 2013 13:35, Timothy Astle <ti...@caris.com> wrote:
>
>> FYI:  This is a failsafe specific questionand I'm hoping this is the
>> correct fall-back mailing list as the surefire-users-subscribe@**
>> maven.apache.org <su...@maven.apache.org> address
>> bounces (http://maven.apache.org/**surefire/maven-failsafe-**
>> plugin/mail-lists.html<http://maven.apache.org/surefire/maven-failsafe-plugin/mail-lists.html>
>> ).
>>
>> I'm using version 2.13 of the maven failsafe plugin.
>>
>> I have aseries of failsafe executions defined in my POM.  Each execution
>> takes a unique set of propertiesthat feed selenium tests the information to
>> test a particular browser version.
>>
>> <plugin>
>> <groupId>org.apache.maven.**plugins</groupId>
>> <artifactId>maven-failsafe-**plugin</artifactId>
>> <executions>
>> <execution>
>> <id>integration-test-selenium-**firefox-12.0</id>
>> <configuration>
>> <argLine>-Dselenium.port=${**selenium.port}
>> -Dbrowser=firefox
>> -Dwebapp.url=http://${local_**ip}:${cargo.port}/**myAwesomeApp/
>> -Dselenium.host=${selenium.**host}
>> -Dcargo.home=${cargo.**container.home}
>> -Dbrowser.version=12.0
>> -Dcontext=myAwesomeApp
>> </argLine>
>> <includes>
>> <include>**/selenium/*ITCase.**java</include>
>> </includes>
>> </configuration>
>> <goals>
>> <goal>integration-test</goal>
>> </goals>
>> </execution>
>> ...etc.
>> </plugin>
>>
>> What I noticed is that if I specify -Dit.test in my command line to cite
>> the specific test class that I'd like to test (i.e., mvn
>> -Dmaven.failsafe.debug -Dit.test=your.TestCase clean verify
>> -Pproduction,selenium), all of the properties within the execution argLine
>> are never set.  So the selenium.port is null, the browser is null,
>> webapp.url is null, etc. etc.
>>
>> Is this the intended behaviour? This does not happen if I specify
>> -Dmaven.failsafe.debug. I was hoping that it'd just add it.test to the
>> existing collection of properties.
>>
>> Any insight is appreciated,
>>
>>
>> Tim
>>

Re: failsafe - why does -Dit.test in command line nullify properties in an execution?

Posted by Timothy Astle <ti...@caris.com>.
Yea, I was going to start by debugging the Mojo to see what happens with 
the properties.

I'll peek around some more and may end up in the issue tracker.

Thanks for your help,

Tim


On 05/02/2013 9:52 AM, Stephen Connolly wrote:
> Also the it.test property is parsed by the Mojo and normally not passed
> through to the surefire engine. IOW the Maven plugin uses that property to
> decide what tests to ask for running.
>
>
> On 5 February 2013 13:51, Stephen Connolly
> <st...@gmail.com>wrote:
>
>> Slightly OT.
>>
>> Why are you using <argLine> which is for things like JVM memory options
>> (think -Xmx512m) and not
>> http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#systemPropertyVariablesfor setting the system properties in surefire/falsesafe's forked JVMs?
>>
>> You may have a bug, but I suspect the work-around is to use the correct
>> tool for the job, i.e. systemPropertyVariables
>>
>> Now if the JVM options are not being passed through, that is a bug
>>
>>
>> On 5 February 2013 13:35, Timothy Astle <ti...@caris.com> wrote:
>>
>>> FYI:  This is a failsafe specific questionand I'm hoping this is the
>>> correct fall-back mailing list as the surefire-users-subscribe@**
>>> maven.apache.org <su...@maven.apache.org> address
>>> bounces (http://maven.apache.org/**surefire/maven-failsafe-**
>>> plugin/mail-lists.html<http://maven.apache.org/surefire/maven-failsafe-plugin/mail-lists.html>
>>> ).
>>>
>>> I'm using version 2.13 of the maven failsafe plugin.
>>>
>>> I have aseries of failsafe executions defined in my POM.  Each execution
>>> takes a unique set of propertiesthat feed selenium tests the information to
>>> test a particular browser version.
>>>
>>> <plugin>
>>> <groupId>org.apache.maven.**plugins</groupId>
>>> <artifactId>maven-failsafe-**plugin</artifactId>
>>> <executions>
>>> <execution>
>>> <id>integration-test-selenium-**firefox-12.0</id>
>>> <configuration>
>>> <argLine>-Dselenium.port=${**selenium.port}
>>> -Dbrowser=firefox
>>> -Dwebapp.url=http://${local_**ip}:${cargo.port}/**myAwesomeApp/
>>> -Dselenium.host=${selenium.**host}
>>> -Dcargo.home=${cargo.**container.home}
>>> -Dbrowser.version=12.0
>>> -Dcontext=myAwesomeApp
>>> </argLine>
>>> <includes>
>>> <include>**/selenium/*ITCase.**java</include>
>>> </includes>
>>> </configuration>
>>> <goals>
>>> <goal>integration-test</goal>
>>> </goals>
>>> </execution>
>>> ...etc.
>>> </plugin>
>>>
>>> What I noticed is that if I specify -Dit.test in my command line to cite
>>> the specific test class that I'd like to test (i.e., mvn
>>> -Dmaven.failsafe.debug -Dit.test=your.TestCase clean verify
>>> -Pproduction,selenium), all of the properties within the execution argLine
>>> are never set.  So the selenium.port is null, the browser is null,
>>> webapp.url is null, etc. etc.
>>>
>>> Is this the intended behaviour? This does not happen if I specify
>>> -Dmaven.failsafe.debug. I was hoping that it'd just add it.test to the
>>> existing collection of properties.
>>>
>>> Any insight is appreciated,
>>>
>>>
>>> Tim
>>>
>>


Re: failsafe - why does -Dit.test in command line nullify properties in an execution?

Posted by Stephen Connolly <st...@gmail.com>.
Also the it.test property is parsed by the Mojo and normally not passed
through to the surefire engine. IOW the Maven plugin uses that property to
decide what tests to ask for running.


On 5 February 2013 13:51, Stephen Connolly
<st...@gmail.com>wrote:

> Slightly OT.
>
> Why are you using <argLine> which is for things like JVM memory options
> (think -Xmx512m) and not
> http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#systemPropertyVariablesfor setting the system properties in surefire/falsesafe's forked JVMs?
>
> You may have a bug, but I suspect the work-around is to use the correct
> tool for the job, i.e. systemPropertyVariables
>
> Now if the JVM options are not being passed through, that is a bug
>
>
> On 5 February 2013 13:35, Timothy Astle <ti...@caris.com> wrote:
>
>> FYI:  This is a failsafe specific questionand I'm hoping this is the
>> correct fall-back mailing list as the surefire-users-subscribe@**
>> maven.apache.org <su...@maven.apache.org> address
>> bounces (http://maven.apache.org/**surefire/maven-failsafe-**
>> plugin/mail-lists.html<http://maven.apache.org/surefire/maven-failsafe-plugin/mail-lists.html>
>> ).
>>
>> I'm using version 2.13 of the maven failsafe plugin.
>>
>> I have aseries of failsafe executions defined in my POM.  Each execution
>> takes a unique set of propertiesthat feed selenium tests the information to
>> test a particular browser version.
>>
>> <plugin>
>> <groupId>org.apache.maven.**plugins</groupId>
>> <artifactId>maven-failsafe-**plugin</artifactId>
>> <executions>
>> <execution>
>> <id>integration-test-selenium-**firefox-12.0</id>
>> <configuration>
>> <argLine>-Dselenium.port=${**selenium.port}
>> -Dbrowser=firefox
>> -Dwebapp.url=http://${local_**ip}:${cargo.port}/**myAwesomeApp/
>> -Dselenium.host=${selenium.**host}
>> -Dcargo.home=${cargo.**container.home}
>> -Dbrowser.version=12.0
>> -Dcontext=myAwesomeApp
>> </argLine>
>> <includes>
>> <include>**/selenium/*ITCase.**java</include>
>> </includes>
>> </configuration>
>> <goals>
>> <goal>integration-test</goal>
>> </goals>
>> </execution>
>> ...etc.
>> </plugin>
>>
>> What I noticed is that if I specify -Dit.test in my command line to cite
>> the specific test class that I'd like to test (i.e., mvn
>> -Dmaven.failsafe.debug -Dit.test=your.TestCase clean verify
>> -Pproduction,selenium), all of the properties within the execution argLine
>> are never set.  So the selenium.port is null, the browser is null,
>> webapp.url is null, etc. etc.
>>
>> Is this the intended behaviour? This does not happen if I specify
>> -Dmaven.failsafe.debug. I was hoping that it'd just add it.test to the
>> existing collection of properties.
>>
>> Any insight is appreciated,
>>
>>
>> Tim
>>
>
>

Re: failsafe - why does -Dit.test in command line nullify properties in an execution?

Posted by Stephen Connolly <st...@gmail.com>.
Slightly OT.

Why are you using <argLine> which is for things like JVM memory options
(think -Xmx512m) and not
http://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#systemPropertyVariablesfor
setting the system properties in surefire/falsesafe's forked JVMs?

You may have a bug, but I suspect the work-around is to use the correct
tool for the job, i.e. systemPropertyVariables

Now if the JVM options are not being passed through, that is a bug


On 5 February 2013 13:35, Timothy Astle <ti...@caris.com> wrote:

> FYI:  This is a failsafe specific questionand I'm hoping this is the
> correct fall-back mailing list as the surefire-users-subscribe@**
> maven.apache.org <su...@maven.apache.org> address
> bounces (http://maven.apache.org/**surefire/maven-failsafe-**
> plugin/mail-lists.html<http://maven.apache.org/surefire/maven-failsafe-plugin/mail-lists.html>
> ).
>
> I'm using version 2.13 of the maven failsafe plugin.
>
> I have aseries of failsafe executions defined in my POM.  Each execution
> takes a unique set of propertiesthat feed selenium tests the information to
> test a particular browser version.
>
> <plugin>
> <groupId>org.apache.maven.**plugins</groupId>
> <artifactId>maven-failsafe-**plugin</artifactId>
> <executions>
> <execution>
> <id>integration-test-selenium-**firefox-12.0</id>
> <configuration>
> <argLine>-Dselenium.port=${**selenium.port}
> -Dbrowser=firefox
> -Dwebapp.url=http://${local_**ip}:${cargo.port}/**myAwesomeApp/
> -Dselenium.host=${selenium.**host}
> -Dcargo.home=${cargo.**container.home}
> -Dbrowser.version=12.0
> -Dcontext=myAwesomeApp
> </argLine>
> <includes>
> <include>**/selenium/*ITCase.**java</include>
> </includes>
> </configuration>
> <goals>
> <goal>integration-test</goal>
> </goals>
> </execution>
> ...etc.
> </plugin>
>
> What I noticed is that if I specify -Dit.test in my command line to cite
> the specific test class that I'd like to test (i.e., mvn
> -Dmaven.failsafe.debug -Dit.test=your.TestCase clean verify
> -Pproduction,selenium), all of the properties within the execution argLine
> are never set.  So the selenium.port is null, the browser is null,
> webapp.url is null, etc. etc.
>
> Is this the intended behaviour? This does not happen if I specify
> -Dmaven.failsafe.debug. I was hoping that it'd just add it.test to the
> existing collection of properties.
>
> Any insight is appreciated,
>
>
> Tim
>