Skip to content

Commit e70d2ec

Browse files
authored
Pipe IT: Fixed the issue that the Pipe IT test error log could not be printed (#15242) (#15283)
(cherry picked from commit b1d4fed)
1 parent 00a36dc commit e70d2ec

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

.github/workflows/pipe-it-2cluster.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ jobs:
8787
echo "==================== BEGIN: ~/run-tests-$attempt.log ===================="
8888
echo "$test_output"
8989
echo "==================== END: ~/run-tests-$attempt.log ======================"
90+
91+
if ! mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/ 2>/dev/null; then
92+
echo "Failed to move log file ~/run-tests-$attempt.log to integration-test/target/cluster-logs/. Skipping..."
93+
fi
9094
9195
if echo "$test_output" | grep -q "Could not transfer artifact"; then
9296
if [ $attempt -lt $max_attempts ]; then
@@ -172,13 +176,15 @@ jobs:
172176
-am -PMultiClusterIT2ManualCreateSchema \
173177
-ntp >> ~/run-tests-$attempt.log && return 0
174178
test_output=$(cat ~/run-tests-$attempt.log)
175-
176-
mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/
177179
178180
echo "==================== BEGIN: ~/run-tests-$attempt.log ===================="
179181
echo "$test_output"
180182
echo "==================== END: ~/run-tests-$attempt.log ======================"
181183
184+
if ! mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/ 2>/dev/null; then
185+
echo "Failed to move log file ~/run-tests-$attempt.log to integration-test/target/cluster-logs/. Skipping..."
186+
fi
187+
182188
if echo "$test_output" | grep -q "Could not transfer artifact"; then
183189
if [ $attempt -lt $max_attempts ]; then
184190
echo "Test failed with artifact transfer issue, attempt $attempt. Retrying in $retry_sleep seconds..."
@@ -255,12 +261,14 @@ jobs:
255261
-ntp >> ~/run-tests-$attempt.log && return 0
256262
test_output=$(cat ~/run-tests-$attempt.log)
257263
258-
mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/
259-
260264
echo "==================== BEGIN: ~/run-tests-$attempt.log ===================="
261265
echo "$test_output"
262266
echo "==================== END: ~/run-tests-$attempt.log ======================"
263267
268+
if ! mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/ 2>/dev/null; then
269+
echo "Failed to move log file ~/run-tests-$attempt.log to integration-test/target/cluster-logs/. Skipping..."
270+
fi
271+
264272
if echo "$test_output" | grep -q "Could not transfer artifact"; then
265273
if [ $attempt -lt $max_attempts ]; then
266274
echo "Test failed with artifact transfer issue, attempt $attempt. Retrying in $retry_sleep seconds..."
@@ -337,12 +345,14 @@ jobs:
337345
-ntp >> ~/run-tests-$attempt.log && return 0
338346
test_output=$(cat ~/run-tests-$attempt.log)
339347
340-
mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/
341-
342348
echo "==================== BEGIN: ~/run-tests-$attempt.log ===================="
343349
echo "$test_output"
344350
echo "==================== END: ~/run-tests-$attempt.log ======================"
345351
352+
if ! mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/ 2>/dev/null; then
353+
echo "Failed to move log file ~/run-tests-$attempt.log to integration-test/target/cluster-logs/. Skipping..."
354+
fi
355+
346356
if echo "$test_output" | grep -q "Could not transfer artifact"; then
347357
if [ $attempt -lt $max_attempts ]; then
348358
echo "Test failed with artifact transfer issue, attempt $attempt. Retrying in $retry_sleep seconds..."
@@ -419,12 +429,14 @@ jobs:
419429
-ntp >> ~/run-tests-$attempt.log && return 0
420430
test_output=$(cat ~/run-tests-$attempt.log)
421431
422-
mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/
423-
424432
echo "==================== BEGIN: ~/run-tests-$attempt.log ===================="
425433
echo "$test_output"
426434
echo "==================== END: ~/run-tests-$attempt.log ======================"
427435
436+
if ! mv ~/run-tests-$attempt.log integration-test/target/cluster-logs/ 2>/dev/null; then
437+
echo "Failed to move log file ~/run-tests-$attempt.log to integration-test/target/cluster-logs/. Skipping..."
438+
fi
439+
428440
if echo "$test_output" | grep -q "Could not transfer artifact"; then
429441
if [ $attempt -lt $max_attempts ]; then
430442
echo "Test failed with artifact transfer issue, attempt $attempt. Retrying in $retry_sleep seconds..."

0 commit comments

Comments
 (0)