Re: SVN: ignore post commit hooks on maven release

2013-07-19 Thread Dean Yu
Hi Steffen,
  The Subversion plugin gives you some options for specifying exclusions,
if you click the Advanced button on the job configuration page. My first
thought was that the appropriate thing to exclude by is a revision
property, but I don't think you get that level of control over the Maven
release plugin. If you can run your release job as a separate user, you
could exclude checkins by that user from triggering jobs.

  -- Dean


On 7/19/13 6:05 AM, "Steffen Breitbach"  wrote:

>Hi everyone!
>
>We're testing post commit hooks for SVN at the moment.
>
>Together with maven releases we have bit of a problem. If you allow
>concurrent builds in one job and start a release job, maven will commit
>to SVN twice, thus triggering two new builds trough the post commit hook.
>
>Is there a way to tell the SVN plug in "ignore post commit hooks for this
>job while running a maven release build"?
>
>Thanks in advance!
>
>Regards
>  Steffen
>
>-- 
>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-users+unsubscr...@googlegroups.com.
>For more options, visit https://groups.google.com/groups/opt_out.
>
>


-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: How does the SVN polling work (internally)?

2013-07-05 Thread Dean Yu
Having you considered using a Subversion post-commit hook to trigger your
jobs?

https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin

While this still requires the jobs to be configured with SCM polling, the
frequency can be greatly reduced.

  -- Dean



On 7/5/13 6:07 AM, "Steffen Breitbach"  wrote:

>On Fri, 2013-07-05 at 12:11 +, Mandeville, Rob wrote:
>> I'm not sure, but I'm guessing that
>> 
>> H/15 * * * *
>> 
>> Would poll every fifteen minutes.
>
>Yes, but as far as I know only from 1.510 onward. We're running 1.509.1
>LTS.
>
>For now, the syntax is H(x-y), so to "simulate" H/10 I used
>H(0-9),H(10-19),H(20-29),H(30-39),H(40-49),H(50-59)
>
>-- 
>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-users+unsubscr...@googlegroups.com.
>For more options, visit https://groups.google.com/groups/opt_out.
>
>


-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: GitHub Webhook to Jenkins "Cross Site Scripting"

2013-05-17 Thread Dean Yu
Just noticing this thread.

With respect to your original question about Git and Jenkin's CSRF setting,
as you've surmised, Jenkins protects all POST requests when this feature is
enabled. There's a snippet in the Subversion plugin wiki[1] about how to
make Subversion's commit hook work with the CSRF protection, and I would
expect the same pattern will work for Git.

With respect to authentication, CSRF is only tangentially related to
authentication. If your Jenkins instance requires an authenticated login,
the CSRF will factor that into the crumb. If your Jenkins allows anonymous
access, the CSRF protection will use other information for the crumb.

  -- Dean

[1] https://wiki.jenkins-ci.org/display/JENKINS/Subversion+Plugin

From:  spacegoose 
Reply-To:  "jenkinsci-users@googlegroups.com"

Date:  Thursday, May 16, 2013 3:03 PM
To:  "jenkinsci-users@googlegroups.com" 
Subject:  Re: GitHub Webhook to Jenkins "Cross Site Scripting"

> 
> 
> On Wednesday, May 15, 2013 9:23:23 AM UTC-4, spacegoose wrote:
>> I am trying to trigger Jenkins builds from commits to a private GitHub
>> repository. It only works when the the cross site scripting protection in
>> Jenkins is turned off.
>> 
>> Is there some way I can keep the cross site scripting protection setting on
>> and get the GitHub webhook to work? The error with it on is a 403 / no valid
>> crumb.
>> 
>> Can I use a crumb in the webhook URL?
>> 
>> Thanks,
>> Bill
> 
> 
> We ended up installing the GitHub plugin on Jenkins and it works, seemingly
> magically, w/o any authentication credentials specified, other than the
> Jenkins project specifying the GitHub repo & branch, and the GitHub webhook
> specifying the generic Jenkins /github-webhook/ URL on our Jenkins instance.
> 
> I looked in the Jenkins (1.514) config settings and didn't see any GItHub
> specific credentials.
> 
> We do have a special GitHub user with pull access to this repo, and it is
> setup with SSH keys to talk to our Jenkins (maybe this has something to do
> with it working?).
> 
> -- 
> 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-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  


-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Concurrent builds with SCM polling

2013-05-13 Thread Dean Yu
Next time this is happening, capture a thread dump of the master and all
the slaves by going to the URL:

http:///threadDump

We should be able to tell from the thread dump what the SCM polling thread
is getting blocked on.

  -- Dean


On 5/13/13 11:53 AM, "David Shaw"  wrote:

>On May 10, 2013, at 5:39 PM, Dean Yu  wrote:
>
>> On Thursday, May 9, 2013 1:02:58 PM UTC-7, Mandeville, Rob wrote:
>> I believe that the behavior you are seeing is by design.  The
>>concurrent builds checkbox allows you to run multiple instances of that
>>job at all, but the SCM poller will only launch one at a time.
>>Basically, with the checkbox you could kick off as many builds as you
>>wanted manually. 
>> 
>> This isn't quite right. SCM polling is independent of individual
>>builds. The fact that SCM polling is blocked while a build is in
>>progress sounds like a bug in the Mercurial plugin.
>> 
>> What should be happening is that every half hour, Jenkins will poll
>>your configured source location in Mercurial for changes. If there are
>>changes, a new build is scheduled into the build queue. If the project
>>is not marked as able to run concurrently, and there is no in progress
>>build of the job, and there is an available executor, then the new build
>>will start. If there is a build of the job in progress, the new build
>>will wait in the queue until the previous build completes. If, at the
>>next polling interval, there is yet another change detected, and the
>>first build is still in progress, the build in the queue is updated to
>>check out from the new revision. In other words, there is normally only
>>one outstanding build of the project in the queue at a time.
>> 
>> If the project is configured to run concurrently, Jenkins will assign
>>the build to an available executor, even if another build of the same
>>project is still in progress.
>
>Unfortunately, this isn't what is happening.  The job is configured to
>run concurrently, but the second build isn't queued until the first build
>completes.
>
>> Yet another possibility is if you have some mutex or semaphore
>>configured (via Throttle Concurrent Builds, Port Allocator, Locks and
>>Latches, or some similar plugin), and that is preventing multiple builds
>>from running at once.
>
>I'm not using any of those plugins.  To test, I set up a Jenkins install
>with no plugins (aside from Mercurial and the ones that are shipped with
>Jenkins).  It still happens.
>
>Any thoughts on how to debug this further?  I'm okay with the workaround
>that Rob Mandeville suggested, but if it's a bug, better to get it fixed
>than rely on a workaround forever.
>
>David
>
>-- 
>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-users+unsubscr...@googlegroups.com.
>For more options, visit https://groups.google.com/groups/opt_out.
>
>


-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Concurrent builds with SCM polling

2013-05-10 Thread Dean Yu
On Thursday, May 9, 2013 1:02:58 PM UTC-7, Mandeville, Rob wrote:
>
> I believe that the behavior you are seeing is by design.  The concurrent 
> builds checkbox allows you to run multiple instances of that job at all, 
> but the SCM poller will only launch one at a time.  Basically, with the 
> checkbox you could kick off as many builds as you wanted manually. 
>

This isn't quite right. SCM polling is independent of individual builds. 
The fact that SCM polling is blocked while a build is in progress sounds 
like a bug in the Mercurial plugin.

What should be happening is that every half hour, Jenkins will poll your 
configured source location in Mercurial for changes. If there are changes, 
a new build is scheduled into the build queue. If the project is not marked 
as able to run concurrently, and there is no in progress build of the job, 
and there is an available executor, then the new build will start. If there 
is a build of the job in progress, the new build will wait in the queue 
until the previous build completes. If, at the next polling interval, there 
is yet another change detected, and the first build is still in progress, 
the build in the queue is updated to check out from the new revision. In 
other words, there is normally only one outstanding build of the project in 
the queue at a time.

If the project is configured to run concurrently, Jenkins will assign the 
build to an available executor, even if another build of the same project 
is still in progress.

Yet another possibility is if you have some mutex or semaphore configured 
(via Throttle Concurrent Builds, Port Allocator, Locks and Latches, or some 
similar plugin), and that is preventing multiple builds from running at 
once.

  -- Dean

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Running slave in a chroot

2013-05-08 Thread Dean Yu
When I was working at Yahoo!, and we started working with Hudson/Jenkins, 
we originally went down this path. The issue we had was that by running the 
slave inside the chroot, multiple slaves would be contending for the same 
resources and capacity. We ultimately took the approach of running the 
slave outside the chroots, and wrote a BuildWrapper that intercepted each 
process launch to launch the process within a designated root.

  -- Dean

On Monday, April 22, 2013 11:52:53 AM UTC-7, flx wrote:
>
>  Hi Stephen
>
> Thanks for the hint, the second one looks good but I have to check this 
> with the
> admin of the buildserver.
> In the meanwhile I launch the slave via command on master. The master 
> ssh-s to the
> slave and starts the slave.jar in the chroot via a script. Seems to work 
> properly...
>  
>
> On 04/19/2013 10:42 AM, Stephen Connolly wrote:
>  
> Can you run a ssh-server in the chroot environment? or better yet, can you 
> create a user on the build slave that is always logged in within the chroot 
> environment? 
>
>  With the former you just connect to the chroot's ssh-server port. With 
> the latter you just connect as the chroot'ed user
>  
>
> On 18 April 2013 19:57, felix schwitzer >wrote:
>
>> I have a buildserver (ubuntu 12.04) and need to run a jenkins slave on 
>> that server
>> in a (s)chroot environment.
>>
>> Question: How can I set up a slave that runs directly in the 
>> chroot-environment on that
>> buildserver?
>> I mean, who can I achieve that jenkins master connects directly into the 
>> chroot?
>>
>> Background:
>> My jenkins project is a multiconfiguration project that runs on different 
>> slaves, some slaves are
>> simple linux boxes without a chroot-environment, others need the chroot. 
>> Therefore I try to
>> avoid entering into the chroot in each build step, because the job 
>> configuration becomes really
>> complex; If I enter the chroot in the build steps, I have to change into 
>> the chroot conditionally,
>> depending on the slave that builds the job.
>>
>> Thanks
>> Felix
>>
>> -- 
>> 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.
>>
>>
>>  
>  -- 
> 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.
>  
>  
>
>
>  

-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nar-plugin integration

2013-05-06 Thread Dean Yu
If you're using the Maven project type, it publishes the test results 
automatically, so there's nothing else to configure. If you're using a 
freestyle project, all you need to do is check the appropriate publish test 
report post-build action, and it will automatically downgrade a successful 
build to unstable if there are test failures in the test files. (My 
experience is with the built in "Publish JUnit Test Report", but I believe 
the xUnit plugin works the same way.)

It's all about the format of the test results. There are many many plugins 
that can parse different test result formats, so hopefully one would work 
for you. The xUnit plugin is handy if your test format can be transformed 
into Junit format; you'd just need to supply an XSL stylesheet that 
describes the transformation rules.

  -- Dean

On Monday, May 6, 2013 10:41:15 AM UTC-7, Rob Campbell wrote:
>
> Aha. Thank you, Dean. That's a good first step. I can add some Maven 
> configuration and change my test runner to return zero as needed. And then 
> to indicate to Jenkins that I want to downgrade the build from successful 
> to unstable? I'll look into outputting test results in a format consumable 
> by the xUnit plugin, but is there another hook I could use?
>
> On Monday, May 6, 2013 1:19:45 PM UTC-4, Dean Yu wrote:
>>
>> Hi Rob,
>>   Usually, build steps that return with a non-zero exit code is what 
>> marks a build as failed. Test reporters, like the built in Junit reporter, 
>> can downgrade a build from successful to unstable if it discovers failed 
>> tests in the test results. It sounds like the maven-nar-plugin might be 
>> returning a non-zero result on test failures.
>>
>>   -- Dean
>>
>>
>> On Monday, May 6, 2013 8:24:16 AM UTC-7, Rob Campbell wrote:
>>>
>>> I'm attempting to use Jenkins for CI of a C++ project which is built 
>>> using the maven-nar-plugin. I'd like to know how I could better integrate 
>>> the nar-plugin with Jenkins so that failed tests do not cause a broken 
>>> build, but instead cause an unstable build, as with JUnit tests for Java. 
>>> The nar plugin has its own test execution goal and doesn't use the surefire 
>>> plugin.
>>>
>>> Any ideas where I would start? Will I need to create a Jenkins plugin? 
>>> or use an existing Jenkins plugin? or modify the maven-nar-plugin?
>>>
>>> Much appreciated,
>>> 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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: nar-plugin integration

2013-05-06 Thread Dean Yu
Hi Rob,
  Usually, build steps that return with a non-zero exit code is what marks 
a build as failed. Test reporters, like the built in Junit reporter, can 
downgrade a build from successful to unstable if it discovers failed tests 
in the test results. It sounds like the maven-nar-plugin might be returning 
a non-zero result on test failures.

  -- Dean


On Monday, May 6, 2013 8:24:16 AM UTC-7, Rob Campbell wrote:
>
> I'm attempting to use Jenkins for CI of a C++ project which is built using 
> the maven-nar-plugin. I'd like to know how I could better integrate the 
> nar-plugin with Jenkins so that failed tests do not cause a broken build, 
> but instead cause an unstable build, as with JUnit tests for Java. The nar 
> plugin has its own test execution goal and doesn't use the surefire plugin.
>
> Any ideas where I would start? Will I need to create a Jenkins plugin? or 
> use an existing Jenkins plugin? or modify the maven-nar-plugin?
>
> Much appreciated,
> 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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Proper approach for creating pipeline builds that use standalone jobs as build steps

2013-03-29 Thread Dean Yu
Have you guys looked at the Build Flow plugin?

https://wiki.jenkins-ci.org/display/JENKINS/Build+Flow+Plugin

  -- Dean

From: Pete Akey mailto:pja...@gmail.com>>
Reply-To: 
"jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Date: Friday, March 29, 2013 1:13 PM
To: "jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Subject: Re: Proper approach for creating pipeline builds that use standalone 
jobs as build steps

I'm in the same boat.  The definition of a pipeline is based on 
upstream/downstream dependencies:  "In order to better support this process, we 
have developed the Build Pipeline Plugin. This gives the ability to form a 
chain of jobs based on their upstream\downstream dependencies. Downstream jobs 
may, as per the default behaviours, be triggered automatically ,or by a 
suitable authorised user manually triggering it." (from the jenkins plug-in 
page: https://wiki.jenkins-ci.org/display/JENKINS/Build+Pipeline+Plugin)

What I started looking into is first, create a Starter, which I would call with 
a URL with parameters.  For instance:

Trigger the STARTER job via URL, like
 
http://jenkins.acme.org/job/parameterized-build/buildWithParameters?VERSION=1.2.3
 OR
 
http://jenkins.acme.org/job/parameterized-build/buildWithParameters?VERSION=1.2.4
 OR
 
http://jenkins.acme.org/job/parameterized-build/buildWithParameters?VERSION=1.2.5
 ETC….

The STARTER job would then pass those parameters to the PIPELINE using the 
"Trigger Parameterized Build on Other Projects" post-build action (plug-in 
here: 
https://wiki.jenkins-ci.org/display/JENKINS/Parameterized+Trigger+Plugin), 
which would then kick off the PIPELINE presumably with the parameters that I 
passed in via URL call.

After a few tries initially, this wasn't working for me.  The goal is to send 
unique triggers via URL to a pipeline and have the pipeline build according to 
the parameters which will be passed job to job to job all the way down the 
pipeline.  That way, I only need on job per "build" and one pipeline, but it 
hasn't worked for me yet and at the moment, I haven't had time to experiment 
any further.  I just duplicated the jobs, each with unique parameters for now 
to get past a deadline.

If you have any success, please share.  I don't know if I'm going the right way 
about accomplishing this but in theory, it sounds like it's a good plan.

Best,
Pete


On Mar 29, 2013, at 1:03 PM, Marc Esher 
mailto:marc.es...@gmail.com>> wrote:

Greetings all,

I have a number of standalone jobs in Jenkins... build/compile, artifact 
generation, test runs, webserver restarts, CDN cache invalidation, and so forth.

What's the preferred approach for Assembling steps into a Build Pipeline 
without adding upstream / downstream dependencies into these standalone jobs?

Ideally, I'd have something like this:

Pipline Step 1 Job
  Runs Standalone Step 1 Job
  Kicks off Pipline Step 2 Job

Pipeline Step 2 Job
  Runs Standalone Step 2 Job
  Kicks off Pipeline Step 3 Job

... and so forth.

Such that Each pipeline step is essentially just a workflow configuration step 
that orchestrates other standalone jobs and then, upon successful completion of 
those standalone jobs, invokes the next step in the pipeline. I really don't 
want to add upstream/downstream dependencies into those standalone jobs, and I 
don't want to create duplicates of those jobs whose only difference is the 
addition of dependencies.

Thanks for guidance,

Marc

--
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




--
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
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-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




RE: AbstractTestResultAction#getFailedTests()

2013-01-24 Thread Dean Yu
You should just be able to change the return type. MetaTabulatedResult is in 
the inheritance chain for CaseResult. Type erasure should allow existing 
callers to continue to work.

  -- Dean

From: jenkinsci-...@googlegroups.com [jenkinsci-...@googlegroups.com] on behalf 
of Nalin Makar [nalin.ma...@gmail.com]
Sent: Wednesday, January 23, 2013 11:17 PM
To: jenkinsci-dev
Cc: jenkinsci-users@googlegroups.com
Subject: Re: AbstractTestResultAction#getFailedTests()

Thanks Dean. I'll create a pull request deprecating this method and introducing 
a new one.


On Wed, Jan 23, 2013 at 10:56 AM, Dean Yu 
mailto:d...@shutterfly.com>> wrote:
Here's the commit where this was added:

https://github.com/jenkinsci/jenkins/commit/f9823e39d17debd2e914ce13cdeec3b43581f09e

I would call this a case of poor abstraction. Seems like the signature should 
return List.

  -- Dean

From: Nalin Makar mailto:nalin.ma...@gmail.com>>
Reply-To: 
"jenkinsci-...@googlegroups.com<mailto:jenkinsci-...@googlegroups.com>" 
mailto:jenkinsci-...@googlegroups.com>>
Date: Wednesday, January 23, 2013 10:38 AM
To: jenkinsci-dev 
mailto:jenkinsci-...@googlegroups.com>>, 
"jenkinsci-users@googlegroups.com<mailto:jenkinsci-users@googlegroups.com>" 
mailto:jenkinsci-users@googlegroups.com>>
Subject: Re: AbstractTestResultAction#getFailedTests()

Ping! Any information/suggestions would help.


On Mon, Jan 21, 2013 at 10:57 PM, Nalin Makar 
mailto:nalin.ma...@gmail.com>> wrote:
Hi,

I have a question regarding 
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L191

AbstractTestResultAction is described as:


/**
 * Common base class for recording test result.


 *

 * 
 * {@link Project} and {@link Build} recognizes {@link Action}s that derive 
from this,


 * and displays it nicely (regardless of the underlying implementation.)


 *

 * @author Kohsuke Kawaguchi
 */




But the method getFailedTests() in this class returns 
List instead of something more generic like 
List

why is it done this way?

I have been updating TestNG plugin for Jenkins to fall in line with other test 
reporting plugins and have it's BuildAction implement AbstractTestResultAction, 
but I don't want to change the result classes to also have to implement a Junit 
specific class (hudson.tasks.junit.CaseResult). This means I still can't have 
email-ext plugin report on TestNG results in a generic way.

Thanks!
--
-nalin



--
-nalin



--
-nalin


Re: AbstractTestResultAction#getFailedTests()

2013-01-23 Thread Dean Yu
Here's the commit where this was added:

https://github.com/jenkinsci/jenkins/commit/f9823e39d17debd2e914ce13cdeec3b43581f09e

I would call this a case of poor abstraction. Seems like the signature should 
return List.

  -- Dean

From: Nalin Makar mailto:nalin.ma...@gmail.com>>
Reply-To: 
"jenkinsci-...@googlegroups.com" 
mailto:jenkinsci-...@googlegroups.com>>
Date: Wednesday, January 23, 2013 10:38 AM
To: jenkinsci-dev 
mailto:jenkinsci-...@googlegroups.com>>, 
"jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Subject: Re: AbstractTestResultAction#getFailedTests()

Ping! Any information/suggestions would help.


On Mon, Jan 21, 2013 at 10:57 PM, Nalin Makar 
mailto:nalin.ma...@gmail.com>> wrote:
Hi,

I have a question regarding 
https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/tasks/test/AbstractTestResultAction.java#L191

AbstractTestResultAction is described as:

/**
 * Common base class for recording test result.
 *
 * 
 * {@link Project} and {@link Build} recognizes {@link Action}s that derive 
from this,
 * and displays it nicely (regardless of the underlying implementation.)
 *
 * @author Kohsuke Kawaguchi
 */


But the method getFailedTests() in this class returns 
List instead of something more generic like 
List

why is it done this way?

I have been updating TestNG plugin for Jenkins to fall in line with other test 
reporting plugins and have it's BuildAction implement AbstractTestResultAction, 
but I don't want to change the result classes to also have to implement a Junit 
specific class (hudson.tasks.junit.CaseResult). This means I still can't have 
email-ext plugin report on TestNG results in a generic way.

Thanks!
--
-nalin



--
-nalin


RE: Creating a FreeStyleProject outside JUnit?

2013-01-16 Thread Dean Yu
I think your problem is the manner in which you are trying to create the 
object: you're calling a utility method on HudsonTestCase which extends JUnit's 
TestCase class. HudsonTestCase assumes its being used from JUnit. 

  -- Dean

From: jenkinsci-users@googlegroups.com [jenkinsci-users@googlegroups.com] on 
behalf of jserup [johs.se...@gmail.com]
Sent: Wednesday, January 16, 2013 3:43 AM
To: jenkinsci-users@googlegroups.com
Subject: Re: Creating a FreeStyleProject outside JUnit?

Ok makes sense but is possible to create eg. a FreeStyleProject /outside/ a
Junit TestRunner. Seems a bit strange that this can only be done through a
TestRunner.



--
View this message in context: 
http://jenkins.361315.n4.nabble.com/Creating-a-FreeStyleProject-outside-JUnit-tp4651594p4651665.html
Sent from the Jenkins users mailing list archive at Nabble.com.


Re: Creating a FreeStyleProject outside JUnit?

2013-01-15 Thread Dean Yu
IIRC, you need to use a Junit TestRunner to run the test, so that Junit's
test lifecycle is followed.

  -- Dean 

On 1/15/13 11:22 AM, "jserup"  wrote:

>I am creating a FreeStyleProject using this test class:
>
>import org.jvnet.hudson.test.HudsonTestCase;
>import org.apache.commons.io.FileUtils;
>import hudson.model.*;
>import hudson.tasks.Shell;
>
>public class AppTest extends HudsonTestCase
>{ 
>public void test1() throws Exception {
>FreeStyleProject project = createFreeStyleProject();
>project.getBuildersList().add(new Shell("echo hello"));
>
>FreeStyleBuild build = project.scheduleBuild2(0).get();
>System.out.println(build.getDisplayName()+" completed");
>
>// TODO: change this to use HtmlUnit
>String s = FileUtils.readFileToString(build.getLogFile());
>assertTrue(s.contains("+ echo hello"));
>} 
>} 
>
>From: 
>
>https://wiki.jenkins-ci.org/display/JENKINS/Unit+Test
>
>But is it only possible to create a FreeStyleProject (and other project
>types) from a JUnit test? If I do:
>
>public class Main {
>public void runit() throws Exception{
>AppTest at = new AppTest();
>at.test1();
>} 
>
>public static void main(String[] args) throws Exception {
>Main main = new Main();
>main.runit();
>} 
>} 
>
>
>I get: 
>
>Exception in thread "main" java.lang.NullPointerException
>at
>org.jvnet.hudson.test.HudsonTestCase.createUniqueProjectName(HudsonTestCas
>e.java:688) 
>at
>org.jvnet.hudson.test.HudsonTestCase.createFreeStyleProject(HudsonTestCase
>.java:652) 
>at com.build.jenkins.AppTest.test1(AppTest.java:10)
>at com.build.jenkins.Main.runit(MMain.java:7)
>at com.build.jenkins.Main.main(MMain.java:13)
>
>I have also looked at: hudson.triggers.TriggerStartTest which use:
>
>@Rule public JenkinsRule j = new JenkinsRule();
>
>instead. But moving that outside a Junit test class gives an error similar
>to the above. 
>
>
>Its seems that its only possible to create objects from hudson.model.*
>inside JUnit test or am I missing an alternative approach?
>
>Here are the dependencies that I use:
>
>
>org.jenkins-ci.main
>jenkins-core
>1.498
>
>
>
>org.jenkins-ci.main
>jenkins-test-harness
>1.498
>
>
>
>org.jenkins-ci.main
>1.498
>jenkins-war
>war
>
>
>org.jenkins-ci.main
>1.498
>jenkins-war
>war-for-test
>
>
>available from : 
>
>http://repo.jenkins-ci.org/webapp/browserepo.html?6
>
>
>
>--
>View this message in context:
>http://jenkins.361315.n4.nabble.com/Creating-a-FreeStyleProject-outside-JU
>nit-tp4651594.html
>Sent from the Jenkins users mailing list archive at Nabble.com.



Re: Read-only configurations plugin for latest jenkins

2013-01-09 Thread Dean Yu
I'm curious what this plugin does that's different than enabling the Extended 
Read permission, which is built-in. The extended read permission grants 
read-only access to the standard configuration pages.

  -- Dean

From: Alex Earl mailto:slide.o@gmail.com>>
Reply-To: 
"jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Date: Wednesday, January 9, 2013 4:56 AM
To: Sumit Nagal mailto:sumitna...@gmail.com>>, 
"jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Subject: RE: Read-only configurations plugin for latest jenkins

FYI, latest Jenkins is 1.497 or something close to that, not 1.466

Sent from my Windows Phone

From: Sumit Nagal
Sent: 1/8/2013 11:26 PM
To: jenkinsci-users@googlegroups.com
Subject: Read-only configurations plugin for latest jenkins

Hi,

I want to know if this plug-in 
(https://wiki.jenkins-ci.org/display/JENKINS/Read-only+configurations+plugin) 
is supported with latest jenkins (1.466)
I am able to see the Global configuration but not able to view Job 
configuration. Am I missing something ???

-Sumit


Re: Collapsing Console Section

2012-10-18 Thread Dean Yu
Or, you can enhance the existing plugin to support the use cases you have.

  -- Dean

From: sandy 
mailto:sandeep.thak...@enterprisedb.com>>
Reply-To: 
"jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Date: Wednesday, October 17, 2012 10:06 PM
To: "jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Cc: "rmandevi...@litle.com" 
mailto:rmandevi...@litle.com>>
Subject: Re: Collapsing Console Section

Thanks, If I write console sections for each begin/end pair, then it would make 
it really ugly as I have around 15 components and 5 platforms.

It seems to me that it is better to write a plugin for this.

On Wednesday, October 17, 2012 6:18:44 PM UTC+5:30, Mandeville, Rob wrote:
I’ve got the same problem, with no good solution.  In my case, some of these 
steps are inside of other steps, so I can be more than one “BEGIN” deep.  As 
far as I can tell, the only way to handle this is to write up each possible 
begin/end pair separately.  That was too ugly for me to pursue, and it only 
works if you know all the possible components in advance.

--Rob

From:jenkins...@googlegroups.com 
[mailto:jenkins...@googlegroups.com] On Behalf Of sandy
Sent: Wednesday, October 17, 2012 2:41 AM
To: jenkins...@googlegroups.com
Subject: Collapsing Console Section

Hi

I'm using Jenkins 1.483 on my Linux box. I have a query regarding the 
Collapsing console section.

My build scripts generates some echo statements like "BEGIN BUILD COMPONENT1" , 
"END BUILD COMPONENT1", "BEGIN BUILD COMPONENT2" , "END BUILD COMPONENT2", 
"BEGIN TEST COMPONENT1", etc..

I want to have a generic console section which covers all the above. So, I 
created a console section with:

Section Name: Build
Section Starts With: ^BEGIN.*
Section Ends With: ^END.*

This works, but I need to have the section name contains the values captured by 
the regular expression. How can I do it? I tried using {1}, {2}.. but those 
does not work. I want to have separate sections for individual components. Do I 
have to write my own plugin?

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


Re: Multiple JUnit reporters

2012-05-23 Thread Dean Yu
Hi Jens,
  See if the Labeled Test Groups plugin will work for you:

https://wiki.jenkins-ci.org/display/JENKINS/LabeledTestGroupsPublisher+Plug
in

  -- Dean


On 5/22/12 1:21 PM , "Jens Müller"  wrote:

>Hi,
>
>it's easy to publish JUnit test results and get a nice chart.
>
>Is it possible to have, say, two groups of JUnit test results and
>capture them separately and accordingly get two charts?
>
> -- Jens



Re: Displaying test results before job is finished

2012-05-15 Thread Dean Yu
Unfortunately not. As a post-build action, test results are processed
after all the build steps are completed.

  -- Dean

On 5/15/12 5:54 AM , "bl0ck3r"  wrote:

>I have hundreds of tests in a job, and it can take several hours to
>complete. Is there a way to have Jenkins display the test results as
>the job progresses?
>
>Do not tell me to split the job into smaller jobs, it is not practical
>as I would end up with hundreds of jobs and this would be
>unmanageable. I prefer to have one longer running job with hundreds of
>small tests, than hundreds of jobs with fewer tests.
>
>Thanks.



Re: Need help with a hudson.util.IOException2

2012-05-07 Thread Dean Yu
A class was compiled using a newer version of Java than you have installed on 
that slave.

  -- Dean

From: 7se7en7 mailto:ah...@hotmail.com>>
Reply-To: 
"jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
To: "jenkinsci-users@googlegroups.com" 
mailto:jenkinsci-users@googlegroups.com>>
Subject: Need help with a hudson.util.IOException2

I am getting this on one of my slaves that has the same exact structure as the 
other slaves and the other slaves are building fine. This particular slave is 
an old SUSE 10.3. I am not very familiar with Java and was wondering if someone 
could tell me where to start looking. Which one of the 'caused by...' is the 
first one that breaks? Thanks a lot.

hudson.util.IOException2: remote file operation failed: 
 at hudson.remoting.Channel@2a79cbc2:
15:31:05   at hudson.FilePath.act(FilePath.java:828)
15:31:05   at hudson.FilePath.act(FilePath.java:814)
15:31:05   at hudson.scm.CVSSCM.perform(CVSSCM.java:873)
15:31:05   at hudson.scm.CVSSCM.checkout(CVSSCM.java:805)
15:31:05   at hudson.model.AbstractProject.checkout(AbstractProject.java:1218)
15:31:05   at 
hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:581)
15:31:05   at 
hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
15:31:05   at hudson.model.Run.run(Run.java:1434)
15:31:05   at hudson.matrix.MatrixRun.run(MatrixRun.java:146)
15:31:05   at 
hudson.model.ResourceController.execute(ResourceController.java:88)
15:31:05   at hudson.model.Executor.run(Executor.java:239)
15:31:05  Caused by: java.io.IOException: Remote call on SUSE-103-64bit-testing 
failed
15:31:05   at hudson.remoting.Channel.call(Channel.java:655)
15:31:05   at hudson.FilePath.act(FilePath.java:821)
15:31:05   ... 10 more
15:31:05  Caused by: java.lang.ClassFormatError: Failed to load 
org.netbeans.lib.cvsclient.connection.AuthenticationException
15:31:05   at 
hudson.remoting.RemoteClassLoader.loadClassFile(RemoteClassLoader.java:154)
15:31:05   at 
hudson.remoting.RemoteClassLoader.findClass(RemoteClassLoader.java:131)
15:31:05   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
15:31:05   at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
15:31:05   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
15:31:05   at java.lang.Class.getDeclaredFields0(Native Method)
15:31:05   at java.lang.Class.privateGetDeclaredFields(Class.java:2259)
15:31:05   at java.lang.Class.getDeclaredField(Class.java:1852)
15:31:05   at 
java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1582)
15:31:05   at java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
15:31:05   at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:408)
15:31:05   at java.security.AccessController.doPrivileged(Native Method)
15:31:05   at java.io.ObjectStreamClass.(ObjectStreamClass.java:400)
15:31:05   at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:297)
15:31:05   at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:531)
15:31:05   at 
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1552)
15:31:05   at 
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1466)
15:31:05   at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
15:31:05   at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
15:31:05   at 
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1908)
15:31:05   at 
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1832)
15:31:05   at 
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1719)
15:31:05   at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
15:31:05   at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
15:31:05   at hudson.remoting.UserRequest.deserialize(UserRequest.java:182)
15:31:05   at hudson.remoting.UserRequest.perform(UserRequest.java:98)
15:31:05   at hudson.remoting.UserRequest.perform(UserRequest.java:48)
15:31:05   at hudson.remoting.Request$2.run(Request.java:287)
15:31:05   at 
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
15:31:05   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
15:31:05   at java.util.concurrent.FutureTask.run(FutureTask.java:123)
15:31:05   at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
15:31:05   at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
15:31:05   at hudson.remoting.Engine$1$1.run(Engine.java:60)
15:31:05   at java.lang.Thread.run(Thread.java:595)
15:31:05  Caused by: java.lang.UnsupportedClassVersionError: Bad version number 
in .class file
15:31:05   at java.lang.ClassLoader.defineClass1(Native Method)
15:31:05   at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
15:31:05   at java.lang.ClassLoader.defineClass(ClassLoad

Re: Jenkins build validated by web call

2012-04-19 Thread Dean Yu
Wouldn't you have the same requirement for deployments that are performed
manually? If so, it would make more sense to put this into your deployment
tool, not in Jenkins.

  -- Dean


On 4/19/12 1:26 AM , "Michele Sacchetti" 
wrote:

> Hi all
> 
> I'd like to introduce a sort of external validation on jenkins build.
> 
> Basically all I want to do is have people compile a "release form" on
> a ticketing tool (redmine,RT,etc. i do not care)
> Such ticketing tool can expose ticket status through web service/REST
> so it can be checked by http.
> 
> On jenkins i'd like to introduce a parametrized build in which ticket
> number has to be provided.
> Artifacts can be deployed (deploy/install goal) only if the ticket has
> been approved, all other goals are unaffected.
> 
> so basically I must introduce a step (the sooner the better, optimal
> solution would be pre-checkout but it's not mandatory) which will
> invoke an url, check the result and force the build to fail if needed.
> 
> All this logic must be contained in jenkins not into the project to be
> build (I have hundreds of them).
> 
> is there a plugin I can already use for this ?
> 
> thanks in advance



Re: Extension points: When to use the Describable/Descriptor pattern

2012-03-13 Thread Dean Yu
Hi Chris,
  You use the Describable/Descriptor pattern if you want to allow for 
configuration through the UI. Otherwise, you just need to use the 
ExtensionPoint marker interface. hudson.tasks.MailAddressResolver is an example 
of an extension point that doesn’t use Describables.

  -- Dean


On 3/13/12 4:51 AM , "Chris S."  wrote:

Hello,

I want to define an extension point, but I don't understand when to use the 
Describable/Descriptor pattern.
The wiki page 
https://wiki.jenkins-ci.org/display/JENKINS/Defining+a+new+extension+point 
doesn't help me really.

Thanks for any answers.



Re: custom build environments?

2012-02-22 Thread Dean Yu
We have an internal plugin that manages chroots for exactly this scenario. We 
set up the chroot through a BuildWrapper, and we override the launch method so 
that each build step enters the chroot before it executes. There’s a lot of 
internal-only code in here, so it’s not something we can open source. However, 
if you want more information, I can sketch out some more detail for you.

  -- Dean


On 2/22/12 2:57 PM , "Mark Waite"  wrote:

I experimented once with a "chroot" environment as a way to have different 
configurations on the same Linux machine.  I found chroot to be more 
complicated than I was ready to use at the time, but I believe it can be used 
to provide different executable versions hosted over the same Linux kernel.

If you need different Linux kernels in addition to different libraries and 
tools, then I think you'll need separate machines (physical or virtual).

Mark Waite





 From: Les Mikesell 
 To: jenkinsci-users 
 Sent: Wednesday, February 22, 2012 1:19 PM
 Subject: custom build environments?


Does anyone have suggestions for how to get Jenkins to make Linux
builds that don't match the stock system environment that
autoconf/configure would find?  For example, if you want to have
multiple versions of boost installed and compile jobs that each need
some specific version.