Skip to content

Commit 388e784

Browse files
authored
Fix caching scala test results (apache-spark-on-k8s#332)
1 parent 1372eb2 commit 388e784

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

.circleci/config.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,15 @@ jobs:
274274
- run:
275275
name: Merge cached test results with results provided by circle (if any)
276276
command: |
277-
[[ -f "$CIRCLE_INTERNAL_TASK_DATA/circle-test-results/results.json" ]] && circle_exists=1
277+
CIRCLE_TEST_RESULTS_FILE="$CIRCLE_INTERNAL_TASK_DATA/circle-test-results/results.json"
278+
[[ -f "$CIRCLE_TEST_RESULTS_FILE" ]] && circle_exists=1
278279
[[ -f "$TEST_RESULTS_FILE" ]] && cached_exists=1
279280
if [[ -z "$circle_exists" ]] || [[ -z "$cached_exists" ]]; then
280281
# Only one exists, CirclePlugin will try to look for both so we're good.
282+
if [[ -n "$circle_exists" ]]; then
283+
echo "Copying over circle test results file for caching"
284+
cp "$CIRCLE_TEST_RESULTS_FILE" "$TEST_RESULTS_FILE"
285+
fi
281286
exit 0
282287
fi
283288
@@ -293,15 +298,16 @@ jobs:
293298
> /tmp/new-test-results.json
294299
# Overwrite the previously cached results with the merged file
295300
mv -f /tmp/new-test-results.json "$TEST_RESULTS_FILE"
301+
- save_cache:
302+
key: v1-test-results-{{ .Branch }}-{{ .BuildNum }}
303+
paths:
304+
- "/tmp/test-results"
296305
- run:
297306
name: Run all tests
298307
command: ./dev/run-scala-tests.py \
299308
| tee -a "/tmp/run-scala-tests.log"
300309
no_output_timeout: 15m
301-
- save_cache:
302-
key: v1-test-results-{{ .Branch }}-{{ .BuildNum }}
303-
paths:
304-
- "/tmp/test-results"
310+
305311
- store_artifacts:
306312
path: /tmp/run-scala-tests.log
307313
destination: run-scala-tests.log

0 commit comments

Comments
 (0)