Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319339

Summary: [build] show accurate health information
Product: z_Archived Reporter: Steffen Pingel <steffen.pingel>
Component: MylynAssignee: Markus Knittig <markus>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 Keywords: contributed
Version: unspecified   
Target Milestone: 0.7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Include additional attributes
none
mylyn/context/zip
none
Adds and parses healthReport
none
mylyn/context/zip
none
Includes and parses healthReport
steffen.pingel: iplog+
mylyn/context/zip none

Description Steffen Pingel CLA 2010-07-09 00:43:01 EDT
The Hudson connector currently guesses the health (weather icon) of a build job. It should instead retrieve this through the rest API (see bug 317891).
Comment 1 Markus Knittig CLA 2010-07-13 13:54:03 EDT
Created attachment 174188 [details]
Include additional attributes

Have only excluded the build tag for now. Potential other optimizations: Exclude firstBuild, lastBuild, lastCompletedBuild, lastFailedBuild, lastStableBuild and/or lastSuccessfulBuild tags.
Comment 2 Markus Knittig CLA 2010-07-13 13:54:05 EDT
Created attachment 174189 [details]
mylyn/context/zip
Comment 3 Markus Knittig CLA 2010-07-13 13:54:58 EDT
Ah, there's the "&" too much.
Comment 4 Steffen Pingel CLA 2010-07-13 14:37:24 EDT
Could you check if part of the patch is missing? I don't see where the health information is actually parsed and set on the build job object.
Comment 5 Markus Knittig CLA 2010-07-13 15:29:08 EDT
Created attachment 174219 [details]
Adds and parses healthReport

Ah, sorry, missed that. This might get a bit trickier, since there can be more than one healthReport tag (typically build stability and test results). It looks like the lowest value determinants the icon, so I'm using that for now.
Comment 6 Markus Knittig CLA 2010-07-13 15:29:10 EDT
Created attachment 174220 [details]
mylyn/context/zip
Comment 7 Steffen Pingel CLA 2010-07-13 16:09:54 EDT
Thanks. Can you add a test case and combine everything in one patch (makes tracking stuff in the iplog easier)?
Comment 8 Markus Knittig CLA 2010-07-13 17:48:40 EDT
Created attachment 174239 [details]
Includes and parses healthReport

Sure, should have thought about that in the first place.
Comment 9 Markus Knittig CLA 2010-07-13 17:48:43 EDT
Created attachment 174240 [details]
mylyn/context/zip
Comment 10 Steffen Pingel CLA 2010-07-14 14:59:44 EDT
Thanks! I have applied the patch with some modifications:

* If a build did not have health information set (e.g. test-disabled)  it would get a health of 100 instead of -1. I modified the initialization slightly to address that.
* I made the parseJob() method public. The problem is that package protected access does not work across bundles when tests are running as Eclipse plug-in tests. http://michaelscharf.blogspot.com/2008/04/is-osgi-enemy-of-junit-tests_17.html has some more background on that.
* I added the test class to the AllHudsonTest suite. That is the suite that we are going to use for running tests eventually and all tests should be referenced here.
* When doing asserts always pass the expected value as the first argument, e.g.: assertEquals(80, behaviour.parseJob(job).getHealth());

I also fixed the view refresh which I broke a few days ago so the right icons should now actually show up in the view :).