You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Simon Kitching <sk...@obsidium.com> on 2006/01/10 02:57:46 UTC

Running unit tests under maven2?

Hi,

I'm trying to run tomahawk unit tests. In current/tomahawk/tomahawk I enter:
   mvn test

However the output indicates:
[INFO] [surefire:test]
[INFO] Tests are skipped.

Any suggestions?

I do see this earlier in the output:
[WARNING]
    Artifact junit:junit:jar:3.8.1 retains local scope 'test'
    overriding broader scope 'compile' given by a dependency.
    If this is not intended, modify or remove the local scope.

I wouldn't think this is the cause, but then again...


Thanks,

Simon

Re: Running unit tests under maven2?

Posted by Simon Kitching <sk...@obsidium.com>.
Simon Kitching wrote:

> I do see this earlier in the output:
> [WARNING]
>    Artifact junit:junit:jar:3.8.1 retains local scope 'test'
>    overriding broader scope 'compile' given by a dependency.
>    If this is not intended, modify or remove the local scope.

hmm..

in ~/.m2/repository, commons-collections-3.1.pom declares a dependency 
on junit, but does not mark it with <scope>test</scope>. Adding the 
scope tag makes the above warning go away.

Any idea who I should notify?

Still get "tests skipped" though..

Cheers,

Simon



Re: Running unit tests under maven2?

Posted by Sean Schofield <se...@gmail.com>.
See my comments on the new Maven thread ...

On 1/10/06, Wendy Smoak <ws...@gmail.com> wrote:
> On 1/10/06, Bill Dudney <bd...@mac.com> wrote:
>
> > Ah the artifactId, is what is causing it...
> > I really think we need a top level pom that is obviously a top level pom.
> >
> > What does everyone think about deleting 'build' and moving that pom into
> > current?
>
> I wouldn't put a pom in current, though I can't come up with a
> coherent reason why not.  I don't use it, but ISTR complaints from
> Eclipse users about that sort of structure.  I'd have to see what IDEA
> thinks of it before commenting further. :)
>
> Maven actually looks in the repository for the parent pom, so it
> doesn't matter too much where it lives.  You can use
>   <parent>
>      ...
>      <relativePath>../path/pom.xml</relativePath>
>   </parent>
> to provide a hint.  This lets Maven pick up local modifications to the
> parent pom before it's installed in the repository.
>
> --
> Wendy
>

Re: Running unit tests under maven2?

Posted by Wendy Smoak <ws...@gmail.com>.
On 1/10/06, Bill Dudney <bd...@mac.com> wrote:

> Ah the artifactId, is what is causing it...
> I really think we need a top level pom that is obviously a top level pom.
>
> What does everyone think about deleting 'build' and moving that pom into
> current?

I wouldn't put a pom in current, though I can't come up with a
coherent reason why not.  I don't use it, but ISTR complaints from
Eclipse users about that sort of structure.  I'd have to see what IDEA
thinks of it before commenting further. :)

Maven actually looks in the repository for the parent pom, so it
doesn't matter too much where it lives.  You can use
  <parent>
     ...
     <relativePath>../path/pom.xml</relativePath>
  </parent>
to provide a hint.  This lets Maven pick up local modifications to the
parent pom before it's installed in the repository.

--
Wendy

Re: Running unit tests under maven2?

Posted by Bill Dudney <bd...@mac.com>.
On Jan 9, 2006, at 7:37 PM, Wendy Smoak wrote:

> On 1/9/06, Bill Dudney <bd...@mac.com> wrote:
>
>> I've tried -Dmaven.test.skip=false and still the tests are skipped. I
>> also did a quick find/grep and I could find no instance of
>> <skip>true</skip> in any pom except the api/pom.xml. Weird, I'm still
>> digging...
>
> That's the one... I'm not sure if this is correct, but the api/ 
> pom.xml has:
>   <groupId>org.apache.myfaces</groupId>
>   <artifactId>myfaces</artifactId>
>   <packaging>pom</packaging>
>   <version>1.1.2-SNAPSHOT</version>
>
> And tomahawk has:
>  <parent>
>     <groupId>org.apache.myfaces</groupId>
>     <artifactId>myfaces</artifactId>
>     <version>1.1.2-SNAPSHOT</version>
>   </parent>
>
>
> So that *is* tomahawk's parent pom, and that's why the skipped tests
> defined there are affecting tomahawk.
>

Ah the artifactId, is what is causing it...

I really think we need a top level pom that is obviously a top level  
pom.

What does everyone think about deleting 'build' and moving that pom  
into current?

So on checkout of 'https://svn.apache.org/repos/asf/myfaces/current'  
we'd get this structure;

myfaces/pom.xml => the parent pom,
	groupId = org.apache.myfaces
	artifactId = myfaces

myfaces/api/pom.xml => parent to api and assembly, child to myfaces/ 
pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-api-module

myfaces/api/api/pom.xml =>  child to myfaces/api/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-api

myfaces/api/myfaces-assembly/pom.xml =>  child to myfaces/api/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-assembly

myfaces/commons/pom.xml =>  child to myfaces/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-commons

myfaces/impl/pom.xml =>  child to myfaces/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-impl

myfaces/sandbox/pom.xml =>  parent to sandbox, sandbox-assembly and  
sandbox-examples - child to myfaces/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-sandbox-module

myfaces/sandbox/sandbox/pom.xml =>  child to myfaces/sandbox/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-sandbox

myfaces/sandbox/sandbox-assembly/pom.xml =>  child to myfaces/sandbox/ 
pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-sandbox-assembly

myfaces/sandbox/sandbox-examples/pom.xml =>  child to myfaces/sandbox/ 
pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-sandbox-examples

myfaces/tomahawk/pom.xml =>  parent to tomahawk, tomahawk-assembly  
and tomahawk-examples - child to myfaces/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-tomahawk-module

myfaces/tomahawk/tomahawk/pom.xml =>  child to myfaces/tomahawk/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-tomahawk

myfaces/tomahawk/tomahawk-assembly/pom.xml =>  child to myfaces/ 
tomahawk/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-tomahawk-assembly

myfaces/tomahawk/ tomahawk-examples/pom.xml =>  child to myfaces/ 
tomahawk/pom.xml
	groupId = org.apache.myfaces
	artifactiId = myfaces-tomahawk-examples

I think we could also get rid of all the externals and have something  
like this;

myfaces/trunk/pom.xml
myfaces/trunk/api
myfaces/trunk/commons
myfaces/trunk/impl
myfaces/trunk/sandbox
myfaces/trunk/site
myfaces/trunk/tomahawk

Which would not prevent us from doing separate releases and tags for  
the separately released stuff. I'm not positive this is the right  
thing to do, I chatted with the maven folks though and they are doing  
something similar on the mojo and the maven.apache.org project.

Thoughts?

-bd-

> I would have thought myfaces-build would be the parent pom, but
> haven't studied the changes made over the weekend other than to note
> that the build works. :)
>
> --
> Wendy


Re: Running unit tests under maven2?

Posted by Simon Kitching <sk...@obsidium.com>.
Wendy Smoak wrote:
> On 1/9/06, Bill Dudney <bd...@mac.com> wrote:
> 
>> I've tried -Dmaven.test.skip=false and still the tests are skipped. I
>> also did a quick find/grep and I could find no instance of
>> <skip>true</skip> in any pom except the api/pom.xml. Weird, I'm still
>> digging...
> 
> That's the one... I'm not sure if this is correct, but the api/pom.xml has:
>   <groupId>org.apache.myfaces</groupId>
>   <artifactId>myfaces</artifactId>
>   <packaging>pom</packaging>
>   <version>1.1.2-SNAPSHOT</version>
> 
> And tomahawk has:
>  <parent>
>     <groupId>org.apache.myfaces</groupId>
>     <artifactId>myfaces</artifactId>
>     <version>1.1.2-SNAPSHOT</version>
>   </parent>
> 
> So that *is* tomahawk's parent pom, and that's why the skipped tests
> defined there are affecting tomahawk.
> 
> I would have thought myfaces-build would be the parent pom, but I
> haven't studied the changes made over the weekend other than to note
> that the build works. :)

Thanks Wendy!

I added
   <configuration><skip>false</skip><configuration>
for the surefire plugin in the tomahawk/pom.xml and tests are now being 
executed.

When the API tests are fixed, this problem should go away. I do agree 
with you though that API doesn't feel right as the parent of tomahawk.

Cheers,

Simon

Re: Running unit tests under maven2?

Posted by Wendy Smoak <ws...@gmail.com>.
On 1/9/06, Bill Dudney <bd...@mac.com> wrote:

> I've tried -Dmaven.test.skip=false and still the tests are skipped. I
> also did a quick find/grep and I could find no instance of
> <skip>true</skip> in any pom except the api/pom.xml. Weird, I'm still
> digging...

That's the one... I'm not sure if this is correct, but the api/pom.xml has:
  <groupId>org.apache.myfaces</groupId>
  <artifactId>myfaces</artifactId>
  <packaging>pom</packaging>
  <version>1.1.2-SNAPSHOT</version>

And tomahawk has:
 <parent>
    <groupId>org.apache.myfaces</groupId>
    <artifactId>myfaces</artifactId>
    <version>1.1.2-SNAPSHOT</version>
  </parent>

So that *is* tomahawk's parent pom, and that's why the skipped tests
defined there are affecting tomahawk.

I would have thought myfaces-build would be the parent pom, but I
haven't studied the changes made over the weekend other than to note
that the build works. :)

--
Wendy

Re: Running unit tests under maven2?

Posted by Bill Dudney <bd...@mac.com>.
On Jan 9, 2006, at 7:15 PM, Wendy Smoak wrote:

> On 1/9/06, Simon Kitching <sk...@obsidium.com> wrote:
>
>> I'm trying to run tomahawk unit tests. In current/tomahawk/ 
>> tomahawk I enter:
>>    mvn test
>>
>> However the output indicates:
>> [INFO] [surefire:test]
>> [INFO] Tests are skipped.
>>
>> Any suggestions?
>
> Try running with -Dmaven.test.skip=false
>
> (or modify the pom that probably has something like <skip>true<skip>
> in the <configuration> for the Surefire plugin.)
>

I've tried -Dmaven.test.skip=false and still the tests are skipped. I  
also did a quick find/grep and I could find no instance of  
<skip>true</skip> in any pom except the api/pom.xml. Weird, I'm still  
digging...

>> I do see this earlier in the output:
>> [WARNING]
>>     Artifact junit:junit:jar:3.8.1 retains local scope 'test'
>>     overriding broader scope 'compile' given by a dependency.
>>     If this is not intended, modify or remove the local scope.
>>
>> I wouldn't think this is the cause, but then again...
>
> I don't think so... I see it in every build (not just MyFaces) and
> haven't yet had time to investigate.
>
> --
> Wendy


Re: Running unit tests under maven2?

Posted by Wendy Smoak <ws...@gmail.com>.
On 1/9/06, Simon Kitching <sk...@obsidium.com> wrote:

> I'm trying to run tomahawk unit tests. In current/tomahawk/tomahawk I enter:
>    mvn test
>
> However the output indicates:
> [INFO] [surefire:test]
> [INFO] Tests are skipped.
>
> Any suggestions?

Try running with -Dmaven.test.skip=false

(or modify the pom that probably has something like <skip>true<skip>
in the <configuration> for the Surefire plugin.)

> I do see this earlier in the output:
> [WARNING]
>     Artifact junit:junit:jar:3.8.1 retains local scope 'test'
>     overriding broader scope 'compile' given by a dependency.
>     If this is not intended, modify or remove the local scope.
>
> I wouldn't think this is the cause, but then again...

I don't think so... I see it in every build (not just MyFaces) and
haven't yet had time to investigate.

--
Wendy