Skip to content

Commit 3fa4608

Browse files
authored
update solarissimple dotests.sh to allow artifact copying in jenkins (#4253)
* update solarissimple dotests.sh to allow artifact copying in jenkins Signed-off-by: Stewart X Addison <[email protected]> * Remove commented out sections at end now testing is complete Signed-off-by: Stewart X Addison <[email protected]> * update invocation of test job in simplepipe.groovy Signed-off-by: Stewart X Addison <[email protected]> * Placate linter Signed-off-by: Stewart X Addison <[email protected]> --------- Signed-off-by: Stewart X Addison <[email protected]>
1 parent 40c46ef commit 3fa4608

File tree

2 files changed

+28
-8
lines changed

2 files changed

+28
-8
lines changed

sbin/solaris/dotests.sh

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212
#
1313
# SPDX-License-Identifier: Apache-2.0
1414
# ********************************************************************************
15+
# shellcheck disable=SC2006
16+
#
17+
# dotests.sh
18+
# Designed for running via a proxy machine for the Temurin Solaris tests
19+
# Expects the build under test to be either in $PWD/build_artifacts or
20+
# an accessible job name specified as UPSTREAM_JOBLINK e.g.
21+
# https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk8u/job/jdk8u-solaris-x64-temurin-simplepipe/167
22+
#
23+
# Requires two parameters for the name of the test suite to run e.g.
24+
# ./dotests.sh sanity openjdk
25+
#
1526

1627
if [ `uname -m` = i86pc ]; then ADOPTARCH=x64; else ADOPTARCH=sparcv9; fi
1728
# Check for Xvfb on display :5
@@ -33,17 +44,25 @@ else
3344
rm -rf aqa-tests
3445
git clone https://github.com/adoptium/aqa-tests
3546
cd aqa-tests
36-
[ -z "$UPSTREAM_JOBLINK" ] && UPSTREAM_JOBLINK=https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk8u/job/jdk8u-solaris-${ADOPTARCH}-temurin-simple/lastSuccessfulBuild
37-
# Linter can go do one if it objects to the backticks - "$(" is not understood by Solaris' bourne shell
38-
JDK_TARBALL_NAME=`curl -s "${UPSTREAM_JOBLINK}/artifact/workspace/target/filenames.txt" | grep "OpenJDK8U-jdk_.*tar.gz$"`
39-
[ -z "$JDK_TARBALL_NAME" ] && echo "Could not retrieve filenames.txt from $UPSTREAM_JOBLINK" && exit 1
40-
echo Downloading and extracting JDK tarball ...
41-
curl -O "${UPSTREAM_JOBLINK}/artifact/workspace/target/$JDK_TARBALL_NAME" || exit 1
47+
if [ -z "${UPSTREAM_JOBLINK}" ]; then
48+
# Jenkins simpletest job will copy the artifacts to this location
49+
if [ ! -r "$PWD/build_artifacts/filenames.txt" ]; then
50+
echo "dotests.sh : UPSTREAM_JOBLINK not defined and $PWD/build_artifacts/filenames.txt does not exist" - cannot progress
51+
exit 1
52+
fi
53+
JDK_TARBALL_NAME=$PWD/build_artifacts/`cat $PWD/build_artifacts/filenames.txt | grep "OpenJDK8U-jdk_.*tar.gz$"`
54+
else
55+
# Linter can go do one if it objects to the backticks - "$(" is not understood by Solaris' bourne shell (SC2006)
56+
JDK_TARBALL_NAME=`curl -s "${UPSTREAM_JOBLINK}/artifact/workspace/target/filenames.txt" | grep "OpenJDK8U-jdk_.*tar.gz$"`
57+
[ -z "$JDK_TARBALL_NAME" ] && echo "Could not retrieve filenames.txt from $UPSTREAM_JOBLINK" && exit 1
58+
echo Downloading and extracting JDK tarball ...
59+
curl -O "${UPSTREAM_JOBLINK}/artifact/workspace/target/$JDK_TARBALL_NAME" || exit 1
60+
fi
4261
gzip -cd "$JDK_TARBALL_NAME" | tar xpf -
4362
echo Downloading and extracting JRE tarball ... Required for special.openjdk jdk_math_jre_0 target
4463
JRE_TARBALL_NAME="`echo $JDK_TARBALL_NAME | sed s/jdk/jre/`"
4564
if [ "$1" = "special" -a "$2" = "openjdk" ]; then
46-
curl -O "${UPSTREAM_JOBLINK}/artifact/workspace/target/$JRE_TARBALL_NAME" || exit 1
65+
[ ! -z "${UPSTREAM_JOBLINK}" ] && curl -O "${UPSTREAM_JOBLINK}/artifact/workspace/target/$JRE_TARBALL_NAME" || exit 1
4766
gzip -cd "$JRE_TARBALL_NAME" | tar xpf -
4867
fi
4968
fi

sbin/solaris/simplepipe.groovy

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ node('worker') {
8383
warnError("The command failed") {
8484
testJob = build job: "${jobTest}",
8585
parameters: [
86-
string( name: 'UPSTREAM_JOBLINK', value: "${jobBaseLink}pipe/${env.BUILD_ID}")
86+
string( name: 'UPSTREAM_JOB_NAME', value: "${jobBaseName}pipe"),
87+
string( name: 'UPSTREAM_JOB_NUMBER', value: "${env.BUILD_ID}"),
8788
]
8889
}
8990
}

0 commit comments

Comments
 (0)