Run JUnit in Jenkins

7,154 views
Skip to first unread message

raf das

unread,
May 2, 2013, 5:06:02 PM5/2/13
to jenkins...@googlegroups.com
Hi friends,

I have my ready tests with selenium and JUnit.


How can I run on jenkins?

raf das

unread,
May 8, 2013, 10:08:02 AM5/8/13
to jenkins...@googlegroups.com
help-me :(

RDR

unread,
May 8, 2013, 10:27:11 AM5/8/13
to jenkinsci-users
There isn't a lot of information there, but....

Jenkins is used to schedule build of your jobs, exactly what that entails is up to you. Jenkins will not automatically run Junit tests (after all there might not be any tests). I don't know if you are using Maven, ANT or another tool to build your application, but what you need to do is add an extra step to execute your tests. (This is probably a good thing to do anyway as your developers can test the code before they commit)

After these have completed it should write a report back to the file system. You can then configure Jenkins to pick to the report and act on it - draw the graphs and fail builds if the tests fail.

Does this help?


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Mandeville, Rob

unread,
May 8, 2013, 10:31:21 AM5/8/13
to jenkins...@googlegroups.com

We’ve got nothing to go on, and as far as we can tell, you haven’t RTFM.

 

Running JUnit tests on Jenkins is almost the core use case for the program.  Asking how is a bit like asking “How do I write a document in Word?”

 

Start at http://jenkins-ci.org/ and go through the “Meet Jenkins” and “Use Jenkins” sections.  That will walk you through basic setup.  If you run into problems from there, you’ll have a more specific question that we can answer.

 

--Rob

--

You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

The information in this message is for the intended recipient(s) only and may be the proprietary and/or confidential property of Litle & Co., LLC, and thus protected from disclosure. If you are not the intended recipient(s), or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any use, dissemination, distribution or copying of this communication is prohibited. If you have received this communication in error, please notify Litle & Co. immediately by replying to this message and then promptly deleting it and your reply permanently from your computer.

raf das

unread,
May 8, 2013, 5:32:05 PM5/8/13
to jenkins...@googlegroups.com
I use maven, but do not know to configure it in jenkins.

How to insert my project in jenkins ?

1) localhost:8080

2)New Job

3) Build a free-style software project

4 ....... ?????????

Would like a step by step if possible. THANKS FRIENDS

Em quinta-feira, 2 de maio de 2013 18h06min02s UTC-3, raf das escreveu:

Mark Waite

unread,
May 8, 2013, 6:15:41 PM5/8/13
to jenkins...@googlegroups.com
Apparently, you're not using google search before posting a very general question to the mailing list.

The first google search result for "configuring maven project in jenkins" is:


Mark Waite


From: raf das <rafae...@gmail.com>
To: jenkins...@googlegroups.com
Sent: Wednesday, May 8, 2013 3:32 PM

Subject: Re: Run JUnit in Jenkins
--

Mikael Hugo

unread,
May 8, 2013, 6:31:31 PM5/8/13
to jenkins...@googlegroups.com

Hi Raf,

 

>I use maven, but do not know to configure it in jenkins.

 

I suspect there are several hundred people getting your questions, so please show the courtesy to spend 5 minutes on google before asking well documented questions.

 

https://wiki.jenkins-ci.org/display/JENKINS/Building+a+maven2+project

 

I can also recommend http://searchengineland.com/guide/how-to-use-google-to-search

 

Regards

 

Mikael

 

RDR

unread,
May 9, 2013, 4:27:47 AM5/9/13
to jenkinsci-users
Have you set up Maven to run your Unit tests? (see my previous post)


--

Mark Waite

unread,
May 8, 2013, 10:29:28 AM5/8/13
to jenkins...@googlegroups.com
You could use a google search to find pointers on how to run unit tests from Jenkins (execute an Ant task to run your JUnit tests, configure Ant to write the results as an XML file, use the "Publish JUnit results" post-build action to show the results) or you could read from the Jenkins Wiki about the JUnit publisher and about various Selenium plugins.

You could also start with a 5 minute screencast I made a few years ago.  http://t.co/Y0I1mfR is "Jenkins in Five Minutes"

Or, you could just experiment with the Jenkins job configuration web page and see what you discover there.

Thanks!
Mark Waite


Sent: Wednesday, May 8, 2013 8:08 AM

Subject: Re: Run JUnit in Jenkins
--

raf das

unread,
May 9, 2013, 5:37:07 PM5/9/13
to jenkins...@googlegroups.com
Let's start from the beginning.

for I run my tests in jenkins, I need to convert my project to maven, right?

Em quinta-feira, 2 de maio de 2013 18h06min02s UTC-3, raf das escreveu:

Kevin Fleming (BLOOMBERG/ 731 LEXIN)

unread,
May 9, 2013, 5:40:09 PM5/9/13
to jenkins...@googlegroups.com
No, Jenkins can run any type of build that can be scripted (that's what 'freestyle' projects are for).
--

raf das

unread,
May 9, 2013, 6:23:39 PM5/9/13
to jenkins...@googlegroups.com, Kevin Fleming
perfect, then as I squeegee my tests in the jenkins? I was told that is easier when configured with maven

Jules Reynolds

unread,
Jan 12, 2014, 5:42:34 PM1/12/14
to jenkins...@googlegroups.com, Kevin Fleming, rafae...@gmail.com
Hi,

I just set up my Junit tests in Jenkins, and I am using Maven. Once you set a build (in the Build section of a free style Jenkins job) with 

Maven 3.0
-e clean install

when Jenkins builds the project it will also run the tests automatically, without setting anything up in addition to what I specified above.

Let me know if this helps,
Jules
Reply all
Reply to author
Forward
0 new messages