Skip to content

Commit

Permalink
Fix stf sha issue (#2913)
Browse files Browse the repository at this point in the history
* finish adding GIT_ISSUE_STATUS to the json

* add error handling

* delete output file

* change the name of input file

* change the common.xml

* fix the then

* change the to outputproperty in common.xm;

* add the error msg

* handle the case if branch not exit go to origin/branch

* solve the nested echo problem

* remove the change relaed to #2882

* move the if inside

* accept sha for openjdk_systemtest

* accept sha for openj9-systemtest

* get rid of repetetive code for cloneing stf

* fix the outputproperty unable to overwrite

* get rid of the change related to pr#2911

* change the git checkout logic

* fix the property name

* change the faikonerror to true
  • Loading branch information
xius666 authored Oct 1, 2021
1 parent f21cbac commit 55c3295
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions system/common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,46 +50,45 @@

<target name="clone_stf">
<echo message="git clone -q ${stf_repo} "/>
<exec executable="git" failonerror="false" dir="${SYSTEMTEST_ROOT}">
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}">
<arg value="clone" />
<arg value="-q"/>
<arg value="${stf_repo}"/>
</exec>

<echo message="git rev-parse ${stf_branch} "/>
<exec executable="git" failonerror="false" dir="${SYSTEMTEST_ROOT}/stf" outputproperty="stf_sha" resultproperty="code">
<exec executable="git" failonerror="false" dir="${SYSTEMTEST_ROOT}/stf" outputproperty="stf_sha1" resultproperty="code">
<arg value="rev-parse"/>
<arg value="${stf_branch}"/>
</exec>
<if>
<equals arg1="${code}" arg2="128"/>
<then>
<echo message="git rev-parse origin/${stf_branch}"/>
<exec executable="git" failonerror="false" dir="${SYSTEMTEST_ROOT}/stf" outputproperty="stf_sha" resultproperty="code2">
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}/stf" outputproperty="stf_sha2" resultproperty="code2">
<arg value="rev-parse"/>
<arg value="origin/${stf_branch}"/>
</exec>
<if>
<equals arg1="${code2}" arg2="128"/>
<then>
<echo message="This branch does not exist!"/>
</then>
</if>
</then>
<property name="stf_sha" value="${stf_sha2}"/>
</then>
</if>

<if>
<isset property="stf_sha"/>
<not>
<isset property="stf_sha"/>
</not>
<then>
<echo message="git checkout -q -f ${stf_sha} "/>
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}/stf" >
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
<arg value="${stf_sha}"/>
</exec>
<property name="stf_sha" value="${stf_sha1}"/>
</then>
</if>
<echo message="git checkout -q -f ${stf_sha} "/>
<exec executable="git" failonerror="true" dir="${SYSTEMTEST_ROOT}/stf" >
<arg value="checkout"/>
<arg value="-q"/>
<arg value="-f"/>
<arg value="${stf_sha}"/>
</exec>



<if>
<isset property="isZOS" />
Expand All @@ -114,7 +113,7 @@
</if>
<checkGitRepoSha repoDir="${SYSTEMTEST_ROOT}/stf" />
</target>

<target name="clone_systemtest">
<echo message="Cloning from: ${openjdk_systemtest_repo} -b ${openjdk_systemtest_branch}"/>
<exec executable="git" failonerror="false" dir="${SYSTEMTEST_ROOT}">
Expand Down Expand Up @@ -184,6 +183,7 @@
<checkGitRepoSha repoDir="${SYSTEMTEST_ROOT}/openj9-systemtest" />
</target>


<target name="check_systemtest" depends="common_init">
<if>
<not>
Expand Down

0 comments on commit 55c3295

Please sign in to comment.