Update expected xml to JJB 2.0 format
[releng/global-jjb.git] / .jjb-test / expected-xml / gerrit-python-tox-verify-master
index 497228e..7505dce 100644 (file)
@@ -104,28 +104,22 @@ Example: docs,py2,py3
         <name>refs/heads/$GERRIT_BRANCH</name>
       </hudson.plugins.git.BranchSpec>
     </branches>
-    <excludedUsers/>
-    <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
     <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
-    <authorOrCommitter>false</authorOrCommitter>
-    <wipeOutWorkspace>true</wipeOutWorkspace>
-    <pruneBranches>false</pruneBranches>
     <remotePoll>false</remotePoll>
     <gitTool>Default</gitTool>
     <submoduleCfg class="list"/>
-    <relativeTargetDir/>
     <reference/>
     <gitConfigName/>
     <gitConfigEmail/>
-    <skipTag>true</skipTag>
-    <scmName/>
-    <useShallowClone>false</useShallowClone>
-    <ignoreNotifyCommit>false</ignoreNotifyCommit>
     <extensions>
+      <hudson.plugins.git.extensions.impl.BuildChooserSetting>
+        <buildChooser class="com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser"/>
+      </hudson.plugins.git.extensions.impl.BuildChooserSetting>
       <hudson.plugins.git.extensions.impl.SubmoduleOption>
         <disableSubmodules>false</disableSubmodules>
         <recursiveSubmodules>true</recursiveSubmodules>
         <trackingSubmodules>false</trackingSubmodules>
+        <parentCredentials>false</parentCredentials>
         <reference/>
         <timeout>10</timeout>
       </hudson.plugins.git.extensions.impl.SubmoduleOption>
@@ -274,6 +268,11 @@ lftools --version
 # pipdeptree
 </command>
     </hudson.tasks.Shell>
+    <EnvInjectBuilder>
+      <info>
+        <propertiesContent>PYTHON_VERSION=python3</propertiesContent>
+      </info>
+    </EnvInjectBuilder>
     <hudson.tasks.Shell>
       <command>#!/bin/bash
 # SPDX-License-Identifier: EPL-1.0
@@ -291,17 +290,19 @@ echo &quot;---&gt; tox-install.sh&quot;
 # DO NOT set -u as virtualenv's activate script has unbound variables
 set -e -o pipefail
 
-virtualenv --quiet &quot;/tmp/v/tox&quot;
+virtualenv --quiet -p &quot;$PYTHON_VERSION&quot; &quot;/tmp/v/tox&quot;
 # shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
 source &quot;/tmp/v/tox/bin/activate&quot;
 pip install --quiet --upgrade pip
 pip install --quiet --upgrade pipdeptree
-pip install --quiet --upgrade detox tox argparse
+pip install --quiet --upgrade argparse detox tox tox-pyenv
 
 echo &quot;----&gt; Pip Dependency Tree&quot;
 pipdeptree
-
-#!/bin/bash
+</command>
+    </hudson.tasks.Shell>
+    <hudson.tasks.Shell>
+      <command>#!/bin/bash
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -313,28 +314,43 @@ pipdeptree
 ##############################################################################
 echo &quot;---&gt; tox-run.sh&quot;
 
+# shellcheck source=/tmp/v/tox/bin/activate disable=SC1091
+source &quot;/tmp/v/tox/bin/activate&quot;
+
 # Ensure we fail the job if any steps fail.
 # DO NOT set -u as virtualenv's activate script has unbound variables
 set -e -o pipefail
 
 ARCHIVE_TOX_DIR=&quot;$WORKSPACE/archives/tox&quot;
 mkdir -p &quot;$ARCHIVE_TOX_DIR&quot;
-
 cd &quot;$WORKSPACE/$TOX_DIR&quot;
 
+if [ -d &quot;/opt/pyenv&quot; ]; then
+    echo &quot;---&gt; Setting up pyenv&quot;
+    export PYENV_ROOT=&quot;/opt/pyenv&quot;
+    export PATH=&quot;$PYENV_ROOT/bin:$PATH&quot;
+fi
+
+set +e  # Allow detox to fail so that we can collect the logs in the next step
 if [ ! -z &quot;$TOX_ENVS&quot; ]; then
     detox -e &quot;$TOX_ENVS&quot;  | tee -a &quot;$ARCHIVE_TOX_DIR/detox.log&quot;
+    detox_status=&quot;${PIPESTATUS[0]}&quot;
 else
     detox | tee -a &quot;$ARCHIVE_TOX_DIR/detox.log&quot;
+    detox_status=&quot;${PIPESTATUS[0]}&quot;
 fi
 
 # Disable SC2116 as we want to echo a space separated list of TOX_ENVS
 # shellcheck disable=SC2116
-for i in $(echo &quot;${TOX_ENVS//,/ }&quot;); do
-    cp -r &quot;.tox/$i/log&quot; &quot;$ARCHIVE_TOX_DIR/$i&quot;
+for i in .tox/*/log; do
+    tox_env=$(echo $i | awk -F'/' '{print $2}')
+    cp -r &quot;$i&quot; &quot;$ARCHIVE_TOX_DIR/$tox_env&quot;
 done
+set -e  # Logs collected so re-enable
 
 echo &quot;Completed tox runs.&quot;
+
+test &quot;$detox_status&quot; -eq 0 || exit &quot;$detox_status&quot;
 </command>
     </hudson.tasks.Shell>
   </builders>