I am executing reg开发者_Go百科ression test created by selenium and triggered from hudson. After this test i need to clean up DB , so for this any option there in Hudson to connect DB and execute some script? Or what is the best way to do this one?
Thanks in advance by Mani
There is no build-in plugin in Hudson/Jenkins that I'm aware of, but you can make the Hudson build process execute a shell script/bat file that in turn can do whatever you can do with a script:
Shell scripts and Windows Batch commands
Depending on your situation it might be preferable to add this step to an overall build script (as an <exec>
task in ant for example).
You can do as stated above or if you connect to the databases using JPA or Hibernate you can set up those so the database is recreated each time. That's how I do it on my case. From the question is hard to tell which method you use to connect to the database.
My tests are being invoked through TestNG and before they run, I clean up the DB via JDBC.
Since you didn't say which DB you are using, I recommending Googling for "[DB] JDBC example", changing [DB] for whatever DBMS you are using :)
精彩评论