Re: Use of maven.test.skip
Hi, it is my experience that no matter how focused and fast each single test is, at some point running all of them will take too long if you build often. I agree totally with Jeffrey that it is important to make fast running focused test, but when you reach that limit when you feel you wait too long for the unit tests to run - I know I have a long time ago - it's time to make focused test suites for what you are working on right now (and include tests you feel are likley to break). For this to work in practise it is important that somebody else runs all the tests all the time and notify you if you have broken something lately. In our house, Bob does this (as in Bob the Builder). He runs Cruise Control and notifies us if we have broken something we did not antispate. We all feel that this is a good way to go about building and testing, but I'm sure there are people out there who would feel differently. As for making a focused test suite in maven (I do this in my IDE), I would try making your own goal in maven.xml running only a few tests at a time. This is just my opinion, though. I would love to hear how other people use maven to build, and run tests! Best regards, Bent André On Tue, 10 Aug 2004 19:54:57 -0500, Jeffrey D. Brekke [EMAIL PROTECTED] wrote: On Tue, 10 Aug 2004 22:40:13 +0100, Charles Daniels [EMAIL PROTECTED] said: I recommend you forget that the flag exists and make the tests faster. That doesn't necessarily help. If all of his tests take 0.1 second on average, but he has 1000 tests, it still takes 100 seconds to run them all, which may still be unacceptably long to wait when running frequently. Then they would still be too slow I guess. There are projects with many more than 1000 tests that run in a reasonable time ( http://jakarta.apache.org/commons/collections/junit-report.html ). Everyone has a threshold wrt build times. Maven runs the tests on each build because that is a best practice in our industry. They should be fast and focused tests, otherwise maybe the build should not be dependant upon them ( the slow ones that is, in which case you could move them into a separate testing project ). In my experience, slow running tests usually have external dependencies ( files, database, network ) which slow them down. I try to have unit/programmer tests not depend on anything external. Those tests ( that depend on external systems ) are important, and should exist. But having the build depend on them may not be wise. This has been discussed on this list before, sorry if I came off too harsh, I was really trying to help. On Tue, 10 Aug 2004 13:49:06 +0100, Kenny MacLeod [EMAIL PROTECTED] said: Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? I think you may be onto something here. If they are so long, maybe they aren't unit tests and should be moved. -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Use of maven.test.skip
Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? cheers kenny - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Use of maven.test.skip
How about just running maven java:compile? or, do maven mybuild -Dmaven.test.skip=true Eric -Original Message- From: Kenny MacLeod [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 10, 2004 2:49 PM To: Maven Users List Subject: Use of maven.test.skip Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? cheers kenny - 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: Use of maven.test.skip
You can override project properties on the maven command line: maven -Dmaven.test.skip=false If you have one environment where you want testing on by default and another where you want it off set maven.test.skip as appropriate in build.properties rather than project.properties. Andy [EMAIL PROTECTED] To: [EMAIL PROTECTED] 10/08/04 13:49 cc: Please respond toSubject: Use of maven.test.skip users Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? cheers kenny - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ For the latest data on the economy and society consult National Statistics at http://www.statistics.gov.uk ** Please Note: Incoming and outgoing email messages are routinely monitored for compliance with our policy on the use of electronic communications ** Legal Disclaimer : Any views expressed by the sender of this message are not necessarily those of the Office for National Statistics ** __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Use of maven.test.skip
Kenny, You can create simple wrapper goals like this: goal name=build-only description=Build without running tests j:set var=maven.test.skip value=true/ attainGoal name=jar:install-snapshot/ /goal goal name=install description=Build, run tests, and install attainGoal name=jar:install-snapshot/ /goal Then just invoke the appropriate one. Jeff On Tue, 10 Aug 2004, at 13:49:06 [GMT +0100] Kenny MacLeod wrote: Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? cheers kenny -- mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Use of maven.test.skip
I recommend you forget that the flag exists and make the tests faster. On Tue, 10 Aug 2004 13:49:06 +0100, Kenny MacLeod [EMAIL PROTECTED] said: Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? I think you may be onto something here. If they are so long, maybe they aren't unit tests and should be moved. -- = Jeffrey D. Brekke [EMAIL PROTECTED] Wisconsin, USA [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Use of maven.test.skip
-Original Message- From: Jeffrey D. Brekke [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 10, 2004 8:37 PM To: Maven Users List Subject: Re: Use of maven.test.skip I recommend you forget that the flag exists and make the tests faster. That doesn't necessarily help. If all of his tests take 0.1 second on average, but he has 1000 tests, it still takes 100 seconds to run them all, which may still be unacceptably long to wait when running frequently. On Tue, 10 Aug 2004 13:49:06 +0100, Kenny MacLeod [EMAIL PROTECTED] said: Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? I think you may be onto something here. If they are so long, maybe they aren't unit tests and should be moved. -- = Jeffrey D. Brekke [EMAIL PROTECTED] Wisconsin, USA [EMAIL PROTECTED] [EMAIL PROTECTED] - 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: Use of maven.test.skip
hmm, my fingers are bad. I meant, point test resource in your project.xml to the dummy one On Tue, 10 Aug 2004 14:57:06 -0700, dan tran [EMAIL PROTECTED] wrote: How about this! ;-) Create 2 test suites. One is a dummy one, and the other one has all tests you want to run. Point test resource in your project.xml so that maven will invoke after compilation. it happens very fast since no test to run. Create a goal in your maven.xml to run your real test suite using test:single goal. and run it any time you want -D On Tue, 10 Aug 2004 22:40:13 +0100, Charles Daniels [EMAIL PROTECTED] wrote: -Original Message- From: Jeffrey D. Brekke [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 10, 2004 8:37 PM To: Maven Users List Subject: Re: Use of maven.test.skip I recommend you forget that the flag exists and make the tests faster. That doesn't necessarily help. If all of his tests take 0.1 second on average, but he has 1000 tests, it still takes 100 seconds to run them all, which may still be unacceptably long to wait when running frequently. On Tue, 10 Aug 2004 13:49:06 +0100, Kenny MacLeod [EMAIL PROTECTED] said: Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? I think you may be onto something here. If they are so long, maybe they aren't unit tests and should be moved. -- = Jeffrey D. Brekke [EMAIL PROTECTED] Wisconsin, USA [EMAIL PROTECTED] [EMAIL PROTECTED] - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Use of maven.test.skip
On Tue, 10 Aug 2004 22:40:13 +0100, Charles Daniels [EMAIL PROTECTED] said: I recommend you forget that the flag exists and make the tests faster. That doesn't necessarily help. If all of his tests take 0.1 second on average, but he has 1000 tests, it still takes 100 seconds to run them all, which may still be unacceptably long to wait when running frequently. Then they would still be too slow I guess. There are projects with many more than 1000 tests that run in a reasonable time ( http://jakarta.apache.org/commons/collections/junit-report.html ). Everyone has a threshold wrt build times. Maven runs the tests on each build because that is a best practice in our industry. They should be fast and focused tests, otherwise maybe the build should not be dependant upon them ( the slow ones that is, in which case you could move them into a separate testing project ). In my experience, slow running tests usually have external dependencies ( files, database, network ) which slow them down. I try to have unit/programmer tests not depend on anything external. Those tests ( that depend on external systems ) are important, and should exist. But having the build depend on them may not be wise. This has been discussed on this list before, sorry if I came off too harsh, I was really trying to help. On Tue, 10 Aug 2004 13:49:06 +0100, Kenny MacLeod [EMAIL PROTECTED] said: Folks, I currently have a project where the unit tests take a considerable amount of time to run (5 minutes or so), and as a result, running them every time I do a build is proving impractical. Initially, I just added the maven.test.skip flag to my project.properties, but this isn't a good solution, mainly because if I explicitly want to run the unit tests, I have to take the flag out again. What I want is for the unit tests not to be run when i do a build, but I do want them to run if I explicitly say so. The interactions between the Java and Test plugins don't seem to be flexible enough to allow this. My current solution is to move the unit tests out to a seperate project, but that seems like an arse-backwards way of going about it. Can anyone suggest a better approach? I think you may be onto something here. If they are so long, maybe they aren't unit tests and should be moved. -- = Jeffrey D. Brekke [EMAIL PROTECTED] Wisconsin, USA [EMAIL PROTECTED] [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]