-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add JUnit annotate BK plugin #5473
Changes from all commits
fa8fa7f
7ad37e0
300d9d2
2872ead
79cc5e5
727942e
7bd2cdb
eee4eda
8a8f73c
2bcd61f
ed730a4
98bfbfd
9ea2cb3
c3631a9
c4b22fc
982d626
8825767
607c2c8
31f3820
c5812aa
1294512
e922d16
b69f867
2516493
af0eb07
3317468
02c6546
35e0ee5
55e0200
9727f8c
71c20d8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Downloads and merges coverage files from multiple steps into a single file (build/TEST-go-unit.cov). | ||
# Usage: merge.sh <step1> <step2> ... Where <step> is the id of the step that contains the coverage artifact.# | ||
|
||
# Usage: merge.sh <step1> <step2> ... Where <step> is the id of the step that contains the coverage artifact.# | ||
set -euo pipefail | ||
set -x # for debugging | ||
|
||
COV_ARTIFACT="coverage.out" | ||
MERGED_COV_FILE="build/TEST-go-unit.cov" | ||
# Space separated list of paths to coverage files | ||
COV_PATHS="" | ||
MERGED_COV_FILE="TEST-go-unit.cov" | ||
|
||
go install github.com/wadey/gocovmerge@latest | ||
mkdir -p build | ||
|
||
for STEP_ID in "$@"; do | ||
mkdir -p $STEP_ID | ||
buildkite-agent artifact download --step $STEP_ID $COV_ARTIFACT $STEP_ID | ||
COV_PATHS="${COV_PATHS} $STEP_ID/$COV_ARTIFACT" | ||
done | ||
|
||
gocovmerge $COV_PATHS > $MERGED_COV_FILE | ||
echo "Merged coverage file: $MERGED_COV_FILE. See artifacts" | ||
buildkite-agent artifact download "coverage-*.out" . | ||
# Space separated list of paths to coverage files | ||
find coverage-*.out -exec printf '%s ' {} \; | xargs gocovmerge > "$MERGED_COV_FILE" | ||
echo "Merged coverage file: $MERGED_COV_FILE. See artifacts" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
#!/usr/bin/env bash | ||
set -uo pipefail | ||
|
||
source .buildkite/scripts/common.sh | ||
set +euo pipefail | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We set pipefail in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What script was never run? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because of the order in which we set the bash flags, the' pipe fail So if the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. coincidently, this failure is seen in this unrelated build https://buildkite.com/elastic/elastic-agent/builds/12911#_ |
||
|
||
echo "--- Unit tests" | ||
RACE_DETECTOR=true TEST_COVERAGE=true mage unitTest | ||
TESTS_EXIT_STATUS=$? | ||
echo "--- Prepare artifacts" | ||
# Copy coverage file to build directory so it can be downloaded as an artifact | ||
cp build/TEST-go-unit.cov coverage.out | ||
exit $TESTS_EXIT_STATUS | ||
mv build/TEST-go-unit.cov "coverage-${BUILDKITE_JOB_ID:go-unit}.out" | ||
mv build/TEST-go-unit.xml build/"TEST-${BUILDKITE_JOB_ID:go-unit}.xml" | ||
exit $TESTS_EXIT_STATUS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed something that might cause a problem.
Some steps produce the same artifact for reporting the test files, for example,
unit-tests-2204
produce the samexml
files asunit-tests-2204-arm64