[JIRA] (JENKINS-17127) Pass DISPLAY as environment variable to Maven builds
zregvart commented on JENKINS-17127 Pass DISPLAY as environment variable to Maven builds Hi Marc, can you provide a test scenario for the problem you're experiencing? As I wrote in the previous comment, to me it seems that when Invoke Maven command is performed in freestyle build, DISPLAY is set correctly regardless of it being set in the environment of the process tree or not. I.e. my setup has DISPLAY variable set (I'm running in GUI mode), so when I start jenkins it inherits DISPLAY from my GUI enviroment, and the POM above and with Invoke Maven step on freestyle projects yields the Xvfb DISPLAY opened by the plugin. This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] (JENKINS-17127) Pass DISPLAY as environment variable to Maven builds
Marc Günther commented on JENKINS-17127 Pass DISPLAY as environment variable to Maven builds I was using your pom.xml from above. I created a freestyle job, with two buildsteps, a shell which executes mvn and a Maven buildstep doing the same. I get the correct output from the shell build step, and the wrong output from the other. Maybe the important point is, that the DISPLAY variable has to exist in the environment of the slave (we are using swarm) and not the master? This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] (JENKINS-17127) Pass DISPLAY as environment variable to Maven builds
Uwe Stuehler commented on JENKINS-17127 Pass DISPLAY as environment variable to Maven builds Thank you for the helpful code snippet! It turns out that we were a little overeager in making sure that all processes started as jenkins get the same environment. The DISPLAY variable was set in all of /.profile, /.bash_profile and ~/.bashrc. The Xvfb plugin works fine. This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] (JENKINS-17127) Pass DISPLAY as environment variable to Maven builds
Uwe Stuehler resolved JENKINS-17127 as Cannot Reproduce Pass DISPLAY as environment variable to Maven builds Change By: Uwe Stuehler (14/Mar/13 10:51 AM) Status: Open Resolved Resolution: CannotReproduce This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] (JENKINS-17127) Pass DISPLAY as environment variable to Maven builds
Marc Günther reopened JENKINS-17127 Pass DISPLAY as environment variable to Maven builds Unfortunately, that's not entirely true. When a DISPLAY variable already exists in the environment of the slave, the plugin will overwrite it with the correct value in a "Execute shell" build step, but it will NOT overwrite it in a "Invoke Maven" build stop. I verified that the xvfb plugin actually changes the DISPLAY entry in the EnvVars map, but it seems the Maven build step changes it back later. Although looking at the source code, I can not find where it does that. I'm not sure if this really is a bug with this plugin, or with Jenkins Maven build step, as the plugin seems to do the right thing. Change By: Marc Günther (14/Mar/13 5:07 PM) Resolution: CannotReproduce Status: Resolved Reopened This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] (JENKINS-17127) Pass DISPLAY as environment variable to Maven builds
zregvart commented on JENKINS-17127 Pass DISPLAY as environment variable to Maven builds Hi Uwe, are you certain that jenkins started the firefox process? From what I see in your example output parent process of the firefox process has PID 31323, whilst maven/java processes have PID 31236 and 31202. DISPLAY environment variable should be set in all processes started by the jenkins job, even in the ones started by "Invoke top-level Maven targets". You can check this with exec-maven-plugin, i.e.: ?xml version="1.0" encoding="UTF-8"? project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd" modelVersion4.0.0/modelVersion groupIdfreestyle/groupId artifactIdsample/artifactId packagingjar/packaging version1.0.0-SNAPSHOT/version build plugins plugin groupIdorg.codehaus.mojo/groupId artifactIdexec-maven-plugin/artifactId version1.2.1/version executions execution idshow-display/id phasecompile/phase goals goalexec/goal /goals configuration executableenv/executable /configuration /execution /executions /plugin /plugins /build /project This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[JIRA] (JENKINS-17127) Pass DISPLAY as environment variable to Maven builds
Uwe Stuehler created JENKINS-17127 Pass DISPLAY as environment variable to Maven builds Issue Type: Improvement Assignee: zregvart Components: xvfb Created: 08/Mar/13 12:04 PM Description: For a freestyle project with an "Invoke top-level Maven targets" build step and the Xvfb plugin enabled, the display number is not passed in the DISPLAY environment variable, but as a property, instead: jenkins@ci4:~$ env|grep DISPLAY DISPLAY=:85 jenkins@ci4:~$ ps -ef|grep firef jenkins 31202 22976 0 17:48 ?00:00:00 /bin/sh /opt/maven3.0.4/bin/mvn -f pom.xml -Dtestsuite=Document -DDISPLAY=:7 clean install -B -Dwebdriver.firefox.bin=/opt/firefox-esr/firefox -Dtest=TestSuiteDocument -Djava.io.tmpdir=/home/jenkins/workspace/selenium-tests/tmp -Dmaven.repo.local=/home/jenkins/workspace/selenium-tests/.repository jenkins 31236 31202 19 17:48 ?00:00:09 /opt/java/bin/java -Djava.io.tmpdir=/tmp/tmp_maven.31202.tmp -Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -classpath /opt/maven3.0.4/boot/plexus-classworlds-2.4.jar -Dclassworlds.conf=/opt/maven3.0.4/bin/m2.conf -Dmaven.home=/opt/maven3.0.4 org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml -Dtestsuite=Document -DDISPLAY=:7 clean install -B -Dwebdriver.firefox.bin=/opt/firefox-esr/firefox -Dtest=TestSuiteDocument -Djava.io.tmpdir=/home/jenkins/workspace/selenium-tests/tmp -Dmaven.repo.local=/home/jenkins/workspace/selenium-tests/.repository jenkins 31375 31323 40 17:49 ?00:00:16 /opt/firefox-esr/firefox -foreground jenkins 31416 27994 0 17:49 pts/000:00:00 grep firef jenkins@ci4:~$ sed -e 's/.*DISPLAY=//' /proc/31375/environ :85... Outside of the build, the DISPLAY variable is set to :85, Jenkins passes -DDISPLAY=:7 to Maven, but the firefox process still has DISPLAY=:85 in its environment. If we convert our build step to "Execute shell", everything works as expected but then we have to "hard-code" the Maven version instead of choosing one from the Maven installations that we configured globally. Would it be hard to change the behaviour so that the DISPLAY environment variable gets set instead, or in addition to the Java property? Environment: Debian 6.0.3 Jenkins 1.501 Xvfb plugin 1.0.7 Project: Jenkins Priority: Minor Reporter: Uwe Stuehler This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators. For more information on JIRA, see: http://www.atlassian.com/software/jira -- You received this message because you are subscribed to the Google Groups Jenkins Issues group. To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.