summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Schultz <william.schultz@mongodb.com>2017-05-26 10:49:15 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2017-05-26 10:49:15 -0400
commit2791ec5e7ddb33e8e2bc5bd3dea224a09502137a (patch)
tree3c5bfcfd3a6ba69f3664f18e8354ff505c1862a1
parent0a7fc5a88d4d950111011b7c2b53e004ebf88094 (diff)
downloadmongo-2791ec5e7ddb33e8e2bc5bd3dea224a09502137a.tar.gz
SERVER-29112 Jepsen evergreen test doesnt create report file
(cherry picked from commit 4c66dc439c430072763f4aa900063c23543c4297) Also includes the changes to the "run jepsen test" function from b54a4c655b2f35ebaae739f959e6e5b7d48f5f04.
-rw-r--r--etc/evergreen.yml19
1 files changed, 11 insertions, 8 deletions
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 5f2960e4c35..dc83d72e45a 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -627,27 +627,30 @@ functions:
end_time=$(date +%s)
elapsed_secs=$((end_time-start_time))
# Since we cannot use PIPESTATUS to get the exit code from the "lein run ..." pipe in dash shell,
- # we will check the output for success, failure or setup error.
+ # we will check the output for success, failure or setup error. Note that 'grep' returns with exit code
+ # 0 if it finds a match, and exit code 1 if no match is found.
grep -q "Everything looks good" jepsen_${task_name}_${execution}.log
- exit_code=$?
- if [ $exit_code -eq 0 ]; then
+ grep_exit_code=$?
+ if [ $grep_exit_code -eq 0 ]; then
status='"pass"'
failures=0
+ final_exit_code=0
else
grep -q "Analysis invalid" jepsen_${task_name}_${execution}.log
- exit_code=$?
- if [ $exit_code -eq 0 ]; then
+ grep_exit_code=$?
+ if [ $grep_exit_code -eq 0 ]; then
status='"fail"'
failures=1
+ final_exit_code=1
else
# If the failure is due to setup, then this is considered a system failure.
- echo $exit_code > jepsen_system_failure_${task_name}_${execution}
+ echo $grep_exit_code > jepsen_system_failure_${task_name}_${execution}
exit 0
fi
fi
# Create report.json
- echo "{\"failures\": $failures, \"results\": [{\"status\": $status, \"exit_code\": $exit_code, \"test_file\": \"${task_name}\", \"start\": $start_time, \"end\": $end_time, \"elapsed\": $elapsed_secs}]}" > ../../report.json
- exit $exit_code
+ echo "{\"failures\": $failures, \"results\": [{\"status\": $status, \"exit_code\": $final_exit_code, \"test_file\": \"${task_name}\", \"start\": $start_time, \"end\": $end_time, \"elapsed\": $elapsed_secs}]}" > ../report.json
+ exit $final_exit_code
- command: shell.exec
params:
working_dir: src/jepsen-mongodb