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

Bug 341334

Summary: -Dhudson=true is not visible in tests on Hudson
Product: [Eclipse Project] Platform Reporter: Szymon Brandys <Szymon.Brandys>
Component: RelengAssignee: Platform-Releng-Inbox <platform-releng-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, david_williams, sptaszkiewicz
Version: 3.7   
Target Milestone: 3.8   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 295393, 340834    

Description Szymon Brandys CLA 2011-03-30 06:28:22 EDT
-Dhudson=true is not visible in tests. The check added in ResourceTest#isHudsonOnWin7 does not work.
Comment 1 Szymon Brandys CLA 2011-11-09 09:08:01 EST
Hi Kim, what is the target for this thing?
Comment 2 David Williams CLA 2012-04-02 17:24:18 EDT
I'll optimistically say the target will be "within a month from now" ... but, since I don't know anything about it, it might help if you gave em a little context. 

I'm guessing your test works one way on hudson, another way when not on hudson, and you need that -D parameter to check? Seems like there should be a better solution (that doesn't rely on system flag) but I'll take your word for it for now. 

Once I get the builds working, the tests will be next and am guessing this just needs to be added to some list of system parameters. (emphasis on guessing :)
Comment 3 Szymon Brandys CLA 2012-04-06 08:06:50 EDT
(In reply to comment #2)
> I'm guessing your test works one way on hudson, another way when not on hudson,
> and you need that -D parameter to check?

Right. In general we want to run whole suite. On Hudson the Windows tests are not run with admin privileges what is required to create symlinks. Thus we want to disable some tests there.
Comment 4 David Williams CLA 2012-06-20 21:59:14 EDT
I'm open to further discussion, but I'd prefer not to fix this in the way described so far. 

It would be far better for you to have some way to figure out if you had admin privileges or not "on your own" and do tests or not based on that, since that's the critical thing. I could imagine running the tests on other machines ... perhaps under hudson, perhaps under admin privileges, so not sure a simple "hudson=true" is right approach. 

But, if you insist :) ... you can actually figure this out on your own getting a "system property" and if its set, then you are on hudson, if not, you are not. 

The one I use in some of our build scripts (to decide if we are running on Hudson or not) is "HUDSON_URL". There's only a few I've found reliably always set and that's one of them (some you'd think would be, like "HUDSON_USER" are not always set). 

If you want to pursue a more "from above" solution, I'd prefer to set something like "adminprivledges=false" and we'd know to hard code it, for when running on build.eclipse.org ... but, hopefully there's some way to detect that from your code. Perhaps catch a certain security exception, or something?
Comment 5 Dani Megert CLA 2012-06-21 03:12:13 EDT
> It would be far better for you to have some way to figure out if you had 
> admin privileges or not
+1.