forked from elastic/elastic-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JUnit annotate BK plugin (elastic#5473)
* Add JUnit annotate BK plugin Signed-off-by: Alexandros Sapranidis <alexandros@elastic.co>
- Loading branch information
1 parent
1d3e007
commit 0d5b335
Showing
5 changed files
with
75 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters