File tree Expand file tree Collapse file tree 3 files changed +19
-17
lines changed
integration-tests/src/test
java/oracle/kubernetes/operator
src/integration-tests/bash Expand file tree Collapse file tree 3 files changed +19
-17
lines changed Original file line number Diff line number Diff line change @@ -608,8 +608,11 @@ public static void tearDown(String iTClassName) throws Exception {
608
608
StringBuffer cmd =
609
609
new StringBuffer (
610
610
"export RESULT_ROOT=$RESULT_ROOT && export PV_ROOT=$PV_ROOT && export IT_CLASS=" );
611
- cmd .append (iTClassName )
612
- .append (" && " )
611
+ cmd .append (iTClassName );
612
+ if (JENKINS ) {
613
+ cmd .append (" && export JENKINS_RESULTS_DIR=${WORKSPACE}/${BUILD_TAG} " );
614
+ }
615
+ cmd .append (" && " )
613
616
.append (BaseTest .getProjectRoot ())
614
617
.append ("/integration-tests/src/test/resources/statedump.sh" );
615
618
logger .info ("Running " + cmd );
Original file line number Diff line number Diff line change @@ -116,12 +116,12 @@ function state_dump {
116
116
fi
117
117
if [ " $JENKINS " = " true" ]; then
118
118
# Jenkins can only publish logs under the workspace
119
- mkdir -p ${WORKSPACE} /logdir/
120
- cp $ARCHIVE ${WORKSPACE} /logdir/
119
+ mkdir -p ${JENKINS_RESULTS_DIR}
120
+ cp $ARCHIVE ${JENKINS_RESULTS_DIR}
121
121
if [ " $? " = " 0" ]; then
122
- echo Copy complete. Archive $ARCHIVE copied to ${WORKSPACE} /logdir/
122
+ echo Copy complete. Archive $ARCHIVE copied to ${JENKINS_RESULTS_DIR}
123
123
else
124
- echo Failed to copy archive $ARCHIVE to ${WORKSPACE} /logdir/
124
+ echo Failed to copy archive $ARCHIVE to ${JENKINS_RESULTS_DIR}
125
125
fi
126
126
fi
127
127
else
@@ -155,7 +155,11 @@ function state_dump {
155
155
rm -rf ${RESULT_DIR} /samples
156
156
157
157
# now archive all the local test files
158
- $SCRIPTPATH /archive.sh " ${RESULT_DIR} " " ${RESULT_DIR} _archive"
158
+ if [ " $JENKINS " = " true" ]; then
159
+ $SCRIPTPATH /archive.sh " ${RESULT_DIR} " " ${JENKINS_RESULTS_DIR} "
160
+ else
161
+ $SCRIPTPATH /archive.sh " ${RESULT_DIR} " " ${RESULT_DIR} _archive"
162
+ fi
159
163
160
164
echo Done with state dump
161
165
}
Original file line number Diff line number Diff line change @@ -38,17 +38,12 @@ function archive {
38
38
[ $? -eq 0 ] || fail " Could not archive, 'jar cf $ARCHIVE $SOURCE_DIR ' command failed: ` cat $OUTFILE ` "
39
39
rm -f $OUTFILE
40
40
41
- find $ARCHIVE_DIR -maxdepth 1 -name " IntSuite*jar" | sort -r | awk ' { if (NR>10) print $NF }' | xargs rm -f
42
- if [ " $JENKINS " = " true" ]; then
43
- # Jenkins can only publish logs under the workspace
44
- mkdir -p ${WORKSPACE} /logdir/
45
- cp $ARCHIVE ${WORKSPACE} /logdir/
46
- if [ " $? " = " 0" ]; then
47
- echo Copy complete. Archive $ARCHIVE copied to ${WORKSPACE} /logdir/
48
- else
49
- echo Failed to copy archive $ARCHIVE to ${WORKSPACE} /logdir/
50
- fi
41
+ # Jenkins log cleanup is managed on Jenkins job config
42
+ if [ ! " $JENKINS " = " true" ]; then
43
+ find $ARCHIVE_DIR -maxdepth 1 -name " IntSuite.${IT_CLASS} .PV.*jar" | sort -r | awk ' { if (NR>5) print $NF }' | xargs rm -f
44
+ find $ARCHIVE_DIR -maxdepth 1 -name " IntSuite.${IT_CLASS} .TMP.*jar" | sort -r | awk ' { if (NR>5) print $NF }' | xargs rm -f
51
45
fi
46
+
52
47
53
48
trace Archived to \' $ARCHIVE \' .
54
49
}
You can’t perform that action at this time.
0 commit comments