1

I am executing regression 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

Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93
Mani
  • 61
  • 8

3 Answers3

1

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).

Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93
  • Hi Anders Lindahl! thanks for you reply , I am using MySql as DB., I will create batch file to do this cleanup. Is there any example to do this ? – Mani Jun 25 '11 at 06:36
0

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 :)

0

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.

javydreamercsw
  • 5,363
  • 13
  • 61
  • 106