Re: Unit tests run twice ?

2003-11-26 Thread Eric Berenguier
Hi Brett,

Brett Porter wrote:

Unfortunately the maven:pluginVar tag is read only, but you can probably do
this:
${pom.getPluginContext('maven-test-plugin').setVariable('maven.test.skip',
 

This one works. Thanks !

A better alternative should be :
attainGoal session=${context.getVariable('maven.session.global',
'parent')} name=jar:install /
attainGoal session=${context.getVariable('maven.session.global',
'parent')} name=site:generate /
 

How am i supposed to change the maven.test.skip variable between the two 
lines above ?
I've just tried to add a set var=maven.test.skip value=true but it 
doesn't work.

Eric



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Unit tests run twice ?

2003-11-26 Thread Brett Porter
 A better alternative should be :
 attainGoal session=${context.getVariable('maven.session.global',
 'parent')} name=jar:install /
 attainGoal session=${context.getVariable('maven.session.global',
 'parent')} name=site:generate /
   
 
 How am i supposed to change the maven.test.skip variable 
 between the two 
 lines above ?
 I've just tried to add a set var=maven.test.skip 
 value=true but it 
 doesn't work.

You shouldn't need to. In this case, test should only be attained once. But
I haven't tried it for myself.

Anyway, the plugincontext.setVariable might be enough for now. I'll look at
adding a decent tag for that.

Cheers,
Brett



RE: Unit tests run twice ?

2003-11-26 Thread dion
Yes, let's encapsulate the plugin communications into tags rather than 
script.

Once we have that, lets make project's getPluginContext method private.
--
dIon Gillard, Multitask Consulting
Blog:  http://blogs.codehaus.org/people/dion/



Brett Porter [EMAIL PROTECTED] wrote on 27/11/2003 08:28:18 AM:

  A better alternative should be :
  attainGoal session=${context.getVariable('maven.session.global',
  'parent')} name=jar:install /
  attainGoal session=${context.getVariable('maven.session.global',
  'parent')} name=site:generate /
   
  
  How am i supposed to change the maven.test.skip variable 
  between the two 
  lines above ?
  I've just tried to add a set var=maven.test.skip 
  value=true but it 
  doesn't work.
 
 You shouldn't need to. In this case, test should only be attained once. 
But
 I haven't tried it for myself.
 
 Anyway, the plugincontext.setVariable might be enough for now. I'll look 
at
 adding a decent tag for that.
 
 Cheers,
 Brett
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unit tests run twice ?

2003-11-25 Thread Tomasz Pik
Eric Berenguier wrote:

Hi,
Hi,

Maybe this help (sorry, not tested):

I'd like to write a single goal that install jar to repository and 
produce the maven site:
So i wrote something like this :

goal name=myGoal
   attainGoal name=jar:install/
property name='maven.test.skip' value='true'/

   attainGoal name=site:generate/
/goal
It works but both jar:install and site:generate call the test:test goal, 
so i have my unit tests run twice.
It's a real problem when unit tests take a long time to run.

Am i missing something ?
   Eric Berenguier
Tomek



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Unit tests run twice ?

2003-11-25 Thread Paul Libbrecht
I think the solution is to use lazyAttainGoal instead of attainGoal... 
but I never got it to work and I don't know wether an RC2 will repair 
this.
Then plugin-writers will be able to make use of it instead of making 
use of attainGoal or of prereqs (which is equivalent if I don't 
mistake).

paul



On Mardi, nove 25, 2003, at 15:04 Europe/Paris, Eric Berenguier wrote:

Hi,

I'd like to write a single goal that install jar to repository and 
produce the maven site:
So i wrote something like this :

goal name=myGoal
   attainGoal name=jar:install/
   attainGoal name=site:generate/
/goal
It works but both jar:install and site:generate call the test:test 
goal, so i have my unit tests run twice.
It's a real problem when unit tests take a long time to run.

Am i missing something ?
   Eric Berenguier


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Unit tests run twice ?

2003-11-25 Thread Sri Sankaran
I was thinking along the same lines except you probably want to exclude the tests on 
the jar build since one would like to see the unit test report on the site that is 
generated.

goal name=myGoal
  attainGoal name=site:generate/
  property name='maven.test.skip' value='true'/
  attainGoal name=jar:install/
/goal

Sri
-Original Message-
From: Tomasz Pik [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 25, 2003 9:12 AM
To: Maven Users List
Subject: Re: Unit tests run twice ?

Eric Berenguier wrote:

 Hi,

Hi,

Maybe this help (sorry, not tested):

 I'd like to write a single goal that install jar to repository and 
 produce the maven site:
 So i wrote something like this :
 
 goal name=myGoal
attainGoal name=jar:install/

 property name='maven.test.skip' value='true'/

attainGoal name=site:generate/
 /goal
 
 It works but both jar:install and site:generate call the test:test goal, 
 so i have my unit tests run twice.
 It's a real problem when unit tests take a long time to run.
 
 Am i missing something ?
Eric Berenguier

Tomek




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unit tests run twice ?

2003-11-25 Thread Eric Berenguier
Tomasz Pik wrote:

Maybe this help (sorry, not tested):

goal name=myGoal
   attainGoal name=jar:install/
property name='maven.test.skip' value='true'/

   attainGoal name=site:generate/
/goal
Thanks for your answer,

I tried that too, but it doesn't work (test are still run twice).

Eric



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Unit tests run twice ?

2003-11-25 Thread Eric Berenguier
property name='maven.test.skip' value='true'/ 


I tried that too, but it doesn't work (test are still run twice). 
As far i understand, properties can't be changed after being set, and 
the test plugin sets this to false. So the only way to change this 
property is to run maven -Dmaven.test.skip=true myGoal  (or put this 
in a build.properties or project.properties), but then i can't run any 
unit test at all.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Unit tests run twice ?

2003-11-25 Thread Vincent Massol


 -Original Message-
 From: Eric Berenguier [mailto:[EMAIL PROTECTED]
 Sent: 25 November 2003 16:14
 To: Maven Users List
 Subject: Re: Unit tests run twice ?
 
  property name='maven.test.skip' value='true'/
 
 
  I tried that too, but it doesn't work (test are still run twice).
 
 As far i understand, properties can't be changed after being set,

No. This is true for Maven but not for Jelly.

 and
 the test plugin sets this to false. So the only way to change this
 property is to run maven -Dmaven.test.skip=true myGoal  (or put this
 in a build.properties or project.properties), but then i can't run any
 unit test at all.
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Unit tests run twice ?

2003-11-25 Thread Eric Berenguier
Sri Sankaran wrote:

Have you tried

j:set var=maven.test.skip value=true scope=parent/
 

Still doesn't work.

Eric



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Unit tests run twice ?

2003-11-25 Thread Paul Libbrecht
Eric Berenguier wrote:
Sri Sankaran wrote:

Have you tried

j:set var=maven.test.skip value=true scope=parent/
 

Still doesn't work.
I don't think scope=parent is even needed there...
(if I don't mistake there's even no parent scope)
Paul

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Unit tests run twice ?

2003-11-25 Thread Brett Porter
Unfortunately the maven:pluginVar tag is read only, but you can probably do
this:

${pom.getPluginContext('maven-test-plugin').setVariable('maven.test.skip',
'true')}

We need to change that in future.

A better alternative should be :
attainGoal session=${context.getVariable('maven.session.global',
'parent')} name=jar:install /
attainGoal session=${context.getVariable('maven.session.global',
'parent')} name=site:generate /

I don't guarantee either work :)

Cheers,
Brett

 -Original Message-
 From: Eric Berenguier [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, 26 November 2003 2:25 AM
 To: Maven Users List
 Subject: Re: Unit tests run twice ?
 
 
 Sri Sankaran wrote:
 
 Have you tried
 
 j:set var=maven.test.skip value=true scope=parent/
   
 
 Still doesn't work.
 
 
 Eric
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]