RE: Running tests from ant on a continuous integration server
RE: Running tests from ant on a continuous integration server
- Subject: RE: Running tests from ant on a continuous integration server
- From: "Brook, James" <email@hidden>
- Date: Fri, 24 Oct 2008 12:37:38 +0200
- Thread-topic: Running tests from ant on a continuous integration server
> -----Original Message-----
> From: Chuck Hill [mailto:email@hidden]
> Sent: Thursday, October 23, 2008 11:08 PM
> To: Brook, James
> Cc: email@hidden
> Subject: Re: Running tests from ant on a continuous integration server
>
>
> On Oct 22, 2008, at 11:40 PM, Brook, James wrote:
>
> > Chuck,
> >
> > That's really helpful. Thanks. I might have guessed that you would
> > be the one to answer.
>
> :-)
>
>
> > Our Selenium tests are actually written in Java and run from TestNG
> > using the Java driver for Selenium, so we have code that looks like
> > this:
> >
> > protected void login() {
> > browser.open(APP_PATH);
> > browser.type("username", USERNAME);
> > browser.type("password", PASSWORD);
> > browser.click("//input[@id='login']");
> > }
> >
> > The Java code takes care of launching the Selenium server and the
> > browser. The idea was that developers write and maintain tests with
> > the minimum of context switching.
>
> My idea is that I _don't_ want the developers writing the tests.
> Developers test what the implemented, not what the app is actually
> supposed to do. The tests will pass and the app will be wrong. :-)
> I have had fairly good success having a business savvy person use the
> Selenium IDE to write the tests. It also makes it fairly easy to edit
> them. IIRC it can record them in Java etc, but HTML files are easier
> to read (rendered in a browser) and easier for the less technically
> inclined to read.
I guess I am going way OT by taking this discussion further, but I feel
the need to respond anyway. We are using Scrum for software development.
This means that developers don't get the points for a story until it is
'DONE'. We have a generic definition of done, which includes the
provision of unit tests, acceptance tests, database scripts and UI
approval. The end result is that the developers are becoming intimately
familiar with the real meaning of 'DONE' and have realized the benefits
of writing good tests. In a lot of cases the product owner provides
Selenese (and Java scripts) recorded with the IDE. These are then
integrated/merged with the developers tests. So far we are finding that
Tests written by developers even provide superior coverage.
>
>
> > The Java API actually is not so bad at all for test code. I had
> > thought it would be more cumbersome. It's still too early to tell if
> > we can keep our acceptance tests maintainable in this form, but I am
> > hopeful that the automated build and test cycle will help.
>
>
> Ick. I'd HATE to do this in Java. Have you tried the Selenium IDE?
> I'd much rather click and type than write Java.
We have some strange people here who seem to be more comfortable with
code
Than using a mouse ;-)
>
> Also, have a look at Bromine: http://bromine.openqa.org/
>
I hadn't seen that yet. Looks promising. Have you adopted it?
>
>
> > Thanks for the ant help.
>
> You are welcome.
>
> Chuck
>
>
> >
> > --
> > James
> >
> > -----Original Message-----
> > From: Chuck Hill [mailto:email@hidden]
> > Sent: Wed 22.10.2008 19:37
> > To: Brook, James
> > Cc: email@hidden
> > Subject: Re: Running tests from ant on a continuous integration
server
> >
> > Hi James,
> >
> >
> > On Oct 22, 2008, at 8:18 AM, Brook, James wrote:
> >
> >> Each of our applications is built automatically on a continuous
> >> integration server whenever new code is committed. I would now like
> >> our tests to be run once these continuous integration builds are
> >> completed. These tests should be run from an ant task. We are using
> >> the new wolips build style to make this possible (no more nasty
> >> woproject/ant.blah files).
> >>
> >> My question is: does anyone have a nice ant target/task for
> >> achieving this? We are happy to run junit or testng, but I would
> >> like a task that makes it easy to provide the WebObjects classpath.
> >> I saw that previously there was a task called wounit, which
extended
> >> the junit task. This seems to have been dropped from the most
recent
> >> version of WOUnitTest. I guess we could make our own task, but it
> >> would be nice not to do this if someone already has a solution.
> >>
> >> The plan is to run Selenium-RC tests from junit and it would be
> >> excellent to get them running on the continuous integration
servers.
> >> Any pointers would be very much appreciated.
> >>
> >> It seems that some sort of vanilla 'run-tests' task would be a nice
> >> thing to have in the ant build files that WOLips generates.
> >
> >
> > I use this to run my TestNG tests:
> >
> > <target name="test" depends="setProps" if="has.unit.tests">
> >
> > <testng workingdir="${project.working.directory}"
> > outputDir="${test.report.dir}/${database.type}"
> > sourcedirref="${project.source.path}"
> > haltOnfailure="false">
> >
> > <!-- Pass values to
> > net.hhshoppers.hh.testng.EOTestSuite.java -->
> > <jvmarg value="-DDBType=${database.type}" />
> > <jvmarg value="-DJDBCUrl=${database.url}" />
> > <jvmarg value="-DJDBCDriver=${database.driver}" />
> > <jvmarg value="-DDBUserName=${database.userid}" />
> > <jvmarg value="-DDBPassword=${database.password}" />
> >
> > <!-- Make sure the tests run with enough memory -->
> > <jvmarg value="-Xmx768m" />
> >
> > <classpath refid="project.classpath"/>
> > <classpath>
> > <fileset dir="${build.product.dir}" includes="**/
> > *.jar" />
> > </classpath>
> > <xmlfileset dir="Testing/"
includes="${unit.test.suite}"/>
> > </testng>
> > </target>
> >
> > project.classpath is created using wopath:
> >
> > <wopath id="project.classpath">
> > <frameworks root="User" eclipse="true" />
> > <path refid="jars" />
> > </wopath>
> >
> > <path id="jars">
> > <fileset dir="${JarsDir}" includes="*.jar" />
> > </path>
> >
> >
> > You can run Selenium tests directly from Ant:
> >
> > <target name="run.suite">
> > <selenese
> > suite="${suite.path}"
> > browser="${browser.name}"
> > results="${results.path}"
> > timeoutInSeconds="2500"
> > startURL="http://${hostname}/"
> > />
> > </target>
> >
> >
> > --
> > Chuck Hill Senior Consultant / VP Development
> >
> > Practical WebObjects - for developers who want to increase their
> > overall knowledge of WebObjects or who are trying to solve specific
> > problems.
> > http://www.global-village.net/products/practical_webobjects
> >
> >
> >
> >
> >
> >
> >
> >
>
> --
> Chuck Hill Senior Consultant / VP Development
>
> Practical WebObjects - for developers who want to increase their
> overall knowledge of WebObjects or who are trying to solve specific
> problems.
> http://www.global-village.net/products/practical_webobjects
>
>
>
>
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden