# Upload all relevant test failures. make -s testlogs 2>/dev/null | grep // | sort | uniq | ( declare log_count=0 while read target log; do if test -z "${target}"; then continue fi # N.B. If *all* tests fail due to some common cause, then we will # end up spending way too much time uploading logs. Instead, we just # upload the first 10 and stop. That is hopefully enough to debug. # # We include this test in the metadata, but note that we cannot # upload the actual test logs. The user should rerun locally. log_count=$((${log_count}+1)) if test "${log_count}" -ge 10; then echo " * ${target} (no upload)" | \ buildkite-agent annotate --style error --context failures --append else buildkite-agent artifact upload "${log}" echo " * [${target}](artifact://${log#/}) (${BUILDKITE_LABEL})" | \ buildkite-agent annotate --style error --context failures --append fi done ) # Upload all profiles, and include in an annotation. declare profile_output=$(mktemp --tmpdir) for file in $(find /tmp/profile -name \*.pprof -print 2>/dev/null | sort); do # Generate a link to the profile file at the top. profile_name="${file#/tmp/profile/}" buildkite-agent artifact upload "${file}" echo "