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

Buckminster doesn't inherit environment variables

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • buckminster-plugin
    • None

      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.

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

              Created:
              Updated:
              Resolved: