Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Fixed
-
Component/s: buckminster-plugin
-
Labels:None
-
Similar Issues:
Description
STEPS TO REPRODUCE
- Log in as an Admin to a Hudson instance with the Buckminster plug-in for Hudson installed and configured
- Navigate to Administration / Configure System
- In Global Properties section check the Environment Variables check box and add a variable like this:
name:TEST_VARIABLE
value:
a_test
- save the settings
- unzip the attached local.test.zip file (containing a Buckminster project to demonstrate the problem) to a folder accessible to Hudson (I will refer to this folder as to <Folder>)
- create a new job and add a Run Buckminster build step to it, supplying the following values:
Commands:resolve "${local.test.location}/local.test/local.test.cquery" perform "local.test#save.environment"
JVM Arguments:
-Dlocal.test.location=<Folder>
Note that you have to name the property local.test.location, as this name is expected by some of the files included in the project.
- save the settings and run the job
- explore the job's workspace, there should be a file named: all.properties, this file lists all properties and environment variables (prefixed with the customary env. prefix) available to the Buckminster build step
- examine the all.properties file
ACTUAL RESULTS
the file does not contain a property (env.TEST_VARIABLE) corresponding to the (TEST_VARIABLE) environment variable defined in step 3.
EXPECTED RESULTS
the file contains a property corresponding to the TEST_VARIABLE environment variable defined in step 3.:
env.TEST_VARIABLE=a_test
ADDITIONAL INFO
- The TEST_VARIABLE is available as expected in Execute Shell build steps but not in Run Buckminster build steps.
- The problem is not limited to the globally defined environment variables; variables exported by other plug-ins are affected too. This is actually how I discovered the problem: I was trying to run some JUnit tests which happen to require GUI using Buckminster's JUnit support together with the Xvnc plugin. This plug-in exports the "DISPLAY" environment variable, for X clients to be able to connect to Xvnc server. And as my Buckminster build step configured to run the tests didn't inherit the variable, the tests failed badly.
Code changed in hudson
User: : jutzig
Path:
trunk/hudson/plugins/buckminster/src/main/java/hudson/plugins/buckminster/BuckminsterInstallation.java
trunk/hudson/plugins/buckminster/src/main/java/hudson/plugins/buckminster/EclipseBuckminsterBuilder.java
trunk/hudson/plugins/buckminster/src/main/java/hudson/plugins/buckminster/command/CommandLineBuilder.java
trunk/hudson/plugins/buckminster/src/main/java/hudson/plugins/buckminster/targetPlatform/TargetPlatformPublisher.java
trunk/hudson/plugins/buckminster/src/main/java/hudson/plugins/buckminster/util/ReadDelegatingTextFile.java
http://jenkins-ci.org/commit/30941
Log:
JENKINS-6488Buckminster doesn't inherit environment variables