24

I installed Jenkins on Ubuntu 10.10 and I could not find any mention of setting up database for data persistance.

So the first question is where does the data get stored, and secondly, can we setup Hudson / Jenkins with mySQL ? or similar databases?

Abhijeet Kasurde
  • 985
  • 9
  • 20
kamal
  • 509
  • 4
  • 10
  • 21

4 Answers4

14

Hudson/Jenkins doesn't quite work that way. It stores configurations and job information in /var/lib/jenkins by default (if you're using the .deb package). If you want to setup persistence for a specific application, that's something you'll want to handle yourself - Hudson is a continuous integration server, not a test framework.

Check out the Wiki article on Continuous Integration for an overview of what to expect.

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
Andrew M.
  • 10,982
  • 2
  • 34
  • 29
  • 2
    @Redmumba i understand its a CI Server, but i was merely looking into the possibility of it being used to drive unit tests and persisting the results in a database instead of flar files. As Jenkins CAN be used to drive and display tests. Any thoughts? – kamal Feb 08 '11 at 19:40
  • A build is much more than a compile (or its dynamic language variations). A build may consist of the compilation, testing, inspection, and deployment—among other things. A build acts as the process for putting source code together and verifying that the software works as a cohesive unit. – kamal Feb 08 '11 at 20:27
  • 1
    Like I said, Jenkins is just a CI server--its not a framework. For all sakes and purposes, Jenkins is just running scripts you specify--it doesn't care about persistent storage, the languages you use, or even what you're doing. That's where I think the disconnect is--Jenkins doesn't provide persistent storage for your application, etc.. – Andrew M. Feb 08 '11 at 20:30
  • 1
    ref: from the book "Continuous Integration: Many consider CI without automated, continuous testing not to be CI. We couldn’t agree more. Without automated tests, it is difficult for developers or other project stakeholders to have confidence in software changes. Most developers on projects that use a CI system use unit- testing tools such as JUnit, NUnit, or other xUnit frameworks to run tests. Furthermore, you can run different categories of tests from a CI system to speed up your builds. These categories may include unit, component, system, load/performance, security, and others. – kamal Feb 08 '11 at 22:12
  • and i agree Jenkins is not a Test Automation Framework like FITNesse etc – kamal Feb 08 '11 at 22:14
  • 1
    Right; so we're on the same page. Jenkins *runs* these things--it doesn't manage persistence layers, test frameworks, build tools (except for ant), etc.. You'll need to build your persistence layer and tests separately. Jenkins can graph unittests if they're outputted in xunit format, which is something the Java testing frameworks provide; many other languages (such as Python's nose) will output in that format too. – Andrew M. Feb 09 '11 at 00:26
7

Jenkins can seem like it is storing data, based on what your scripts are doing and how.

As an example; the scripts that run your daily commit builds can be setup to hand off the "pass/fail" results to Jenkins to store in an XML file. Then, if you are ever interested in pulling up the historical "pass/fail" results and using them somewhere other than in the Jenkins GUI, you can make a call into the Jenkins API and get a return of that XML. Parse it and you've got the data you need.

But -- Other than doing this, Jenkins has no repository system all by its lonesome.

In addition, following is the jenkins api information: https://wiki.jenkins-ci.org/display/JENKINS/Remote+access+API

Reddy
  • 103
  • 4
Jag
  • 71
  • 1
  • 1
2

The answer is that jenkins will not set this up for you. You need to tell it how to setup the environment and how to execute it's tests. This is normally done in the build steps section. If you will provide more info as to which platform you are using them perhaps we could give you a more concrete answer. You could have a shell script that will install your application and run it's tests, and then you call that from hudson. Making the test runner output data in a hudson-friendly way to finally get the results of your tests into the webUI for viewing those.

Jorge Vargas
  • 189
  • 2
2

It stores data in your home directory in a .jenkins directory. You can find all relevant information related to your builds in this directory.

Jenkins not provides build in support for connecting to any database.

HBruijn
  • 72,524
  • 21
  • 127
  • 192
user257831
  • 21
  • 1