It's three months into a hectic projects and we still can't get a fully automatic build using AntHill featuring : CVS checkout, full build, EAR generation, non-regression tests compile (I don't dare call them unit tests!), BEA startup, EAR deployement, test running, JUnitReport, BEA shutdown, email to everyone if the tests didn't run 100% and I'm frustrated! I haven't had the time to really solve a nagging problem with this... Here it is.
We have a database that's setup just for the non-regression tests (which delete all data in the tables and sometimes insert data using DbUnit). We also have a development database for each developer (actually, just a different schema since we're using oracle). Obviously, when the tests run we need to tell DbUnit which database to connect to and the EJB Business Delegates the URL to the J2EE server... This is specified through a properties file using properties, one of them is jdbc.instanceName. Here is the catch : this properties file needs to be in the CVS for AntHill to check it out and it needs to contain the correct data. But if it's in the CVS, any developer may commit the database instance name he's been using by accident. Worst of all, he may commit the name of the database that actually has real data in it (used for sanity checks on the code)...
So I had this great idea, I'll refactor the config module so it looks for a config property in the SystemProperties first and I can tell AntHill to add a -D property when building the project...
That was a great idea until I noticed that when you fork your junit task in ANT, it doesn't propagate SystemProperties (which does make sense, I agree). But if I don't fork it, I get ClassNotFoundException errors and LinkageErrors because of XML and ANT's classloader
Now, you technically can set system properties when launching your JUnit task using (unsurprisingly...) the systemproperty tag so I did something like this:
So I guess, I will have to tell every developer to add a system property named jdbc.instanceName with the name of the database to use :(
Posted by pgirolami76 at March 23, 2003 07:39 PM | TrackBackSince when did anthill switch from OS to shared OS/Commercial ? Last time i tried anthill(about 2 months ago), i spent one full day trying to getting it up and running then I gave up. I have built similar systems by just using cron and ant with some shellscripting for the output, so I know sort of how these systems work. To me , anthill seemed like one of those tools that would be great to use provided one can get it up and running in *less* than one day.
Having said all this, maybe they have done major restructuring since they went commercial.. In that case i'll have to give it another go.
I got it up and running in 2 hours... no problem getting it to compile. It's the rest that's been difficult !
Posted by: Philippe at March 24, 2003 01:59 PMWe have solved this by having a ant target per "build-configuration" that generates a project.filters file which is bascially just a property file. (It is done via the task)
The property file is then just included by all our ant build.xml files.
The actual project.filters file is NEVER committed to cvs, it has to be generated (either manually by the developer..or by anthill/cruisecontrol in a 2-step process .. e.g. ant selectanthillconf (which generates the proeprty file) and then ant build which will utilize the just generated file....
Hope it can help :)
Posted by: Max at March 24, 2003 03:05 PMWe use CruiseControl, but maybe this will help... we have a specific .properties config file for the user that runs the integration build. So each developer has a "usename.proerties" file in CVS (richard.properties, fred.properties and so on) and in Ant we say:
property file="${user.name}.properties"
E.g., load richard.properties if I'm runing Ant on my machine. The integration build runs under a different (non-developer) user, so it has it's own .properties file. Doesn't matter what I do to my properties, I can't effect the integration build's config.
Hope that's of some use. Sounds somewhat similar to Max's suggestion.
Richard
Richard, that's a brilliant idea! :)
Posted by: Euxx at April 9, 2003 01:18 AM