Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-6488

Buckminster doesn't inherit environment variables

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      STEPS TO REPRODUCE

      1. Log in as an Admin to a Hudson instance with the Buckminster plug-in for Hudson installed and configured
      2. Navigate to Administration / Configure System
      3. In Global Properties section check the Environment Variables check box and add a variable like this:
        name:
        TEST_VARIABLE

        value:

        a_test
      4. save the settings
      5. 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>)
      6. 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.

      7. save the settings and run the job
      8. 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
      9. 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.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          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-6488 Buckminster doesn't inherit environment variables

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - 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-6488 Buckminster doesn't inherit environment variables
          Hide
          jutzig jutzig added a comment -

          Thank you for this very detailed issue report and the test data. That made it very easy to reproduce and resolve the issue.
          I just released version 1.0.3 which includes the fix for this issue.
          Unfortunately I think there's something wrong with the release infrastructure lately so I'm not sure when the new version will be available in the update center.
          If it doesn't show up within a few days you might have to download the hpi manually.

          Show
          jutzig jutzig added a comment - Thank you for this very detailed issue report and the test data. That made it very easy to reproduce and resolve the issue. I just released version 1.0.3 which includes the fix for this issue. Unfortunately I think there's something wrong with the release infrastructure lately so I'm not sure when the new version will be available in the update center. If it doesn't show up within a few days you might have to download the hpi manually.
          Hide
          mruza mruza added a comment - - edited

          Thank you for the quick fix!

          Show
          mruza mruza added a comment - - edited Thank you for the quick fix!

            People

            Assignee:
            jutzig jutzig
            Reporter:
            mruza mruza
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: