-
-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test refactoring & devcontainer enhancement(#1245)
* Whietlist dot imports for test packages * improved generate-lcov script * moved mock_call_sequence to helpertest * removed default config for markdown * generate seperate lcov.info for each directory * path fix in lcov generation script * ginkgo -> v2.13.1 * fixed redundant strings * added exampleComKey * added folder name to finish message * hide lcov.info in devcontainer * coverage plugin is bugged if lcov file is excluded * moved all lcov files to coverage folder * added requested toos #1251
- Loading branch information
Showing
12 changed files
with
91 additions
and
38 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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash -e | ||
|
||
FOLDER_PATH=$1 | ||
if [ -z "${FOLDER_PATH}" ]; then | ||
FOLDER_PATH=$PWD | ||
fi | ||
|
||
BASE_PATH=$2 | ||
if [ -z "${BASE_PATH}" ]; then | ||
BASE_PATH=$WORKSPACE_FOLDER | ||
fi | ||
|
||
if [ "$FOLDER_PATH" = "$BASE_PATH" ]; then | ||
echo "Skipping lcov creation for base path" | ||
exit 1 | ||
fi | ||
|
||
FOLDER_NAME=${FOLDER_PATH#"$BASE_PATH/"} | ||
WORK_NAME="$(echo "$FOLDER_NAME" | sed 's/\//-/g')" | ||
WORK_FILE_NAME="$WORK_NAME.ginkgo" | ||
WORK_FILE_PATH="/tmp/$WORK_FILE_NAME" | ||
OUTPUT_FOLDER="$BASE_PATH/coverage" | ||
OUTPUT_FILE_PATH="$OUTPUT_FOLDER/$WORK_NAME.lcov" | ||
|
||
|
||
mkdir -p "$OUTPUT_FOLDER" | ||
|
||
echo "-- Start $FOLDER_NAME ($(date '+%T')) --" | ||
|
||
TIMEFORMAT=' - Ginkgo tests finished in: %R seconds' | ||
time ginkgo --label-filter="!e2e" --keep-going --timeout=5m --output-dir=/tmp --coverprofile="$WORK_FILE_NAME" --covermode=atomic --cover -r -p "$FOLDER_PATH" || true | ||
|
||
TIMEFORMAT=' - lcov convert finished in: %R seconds' | ||
time gcov2lcov -infile="$WORK_FILE_PATH" -outfile="$OUTPUT_FILE_PATH" || true | ||
|
||
TIMEFORMAT=' - cleanup finished in: %R seconds' | ||
time rm "$WORK_FILE_PATH" || true | ||
|
||
echo "-- Finished $FOLDER_NAME ($(date '+%T')) --" |
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 |
---|---|---|
|
@@ -12,3 +12,5 @@ LICENSE | |
vendor | ||
e2e/ | ||
.devcontainer/ | ||
coverage.txt | ||
coverage/ |
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 |
---|---|---|
|
@@ -13,4 +13,4 @@ node_modules | |
package-lock.json | ||
vendor/ | ||
coverage.txt | ||
lcov.* | ||
coverage/ |
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
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,4 +1,4 @@ | ||
package util | ||
package helpertest | ||
|
||
import ( | ||
"context" | ||
|
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
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