diff --git a/src/gocover/README.md b/src/gocover/README.md index aff55db..9050504 100644 --- a/src/gocover/README.md +++ b/src/gocover/README.md @@ -22,6 +22,7 @@ a gocover command to run Go unit tests with coverages, updating the README.md wi | race | run tests with race detector enabled (-race) | boolean | true | | verbose | run tests with -v | boolean | true | | tags | comma-separated list of additional build tags (-tags) | string | - | +| run | if set, run only those tests, examples, and fuzz tests matching the regular expression | string | - | | uncovered-packages | space separated optional list of package patterns to exclude from coverage analysis | string | - | | green | percentage number for the badge to become green | string | 80 | | yellow | percentage number for the badge to become yellow | string | 50 | diff --git a/src/gocover/devcontainer-feature.json b/src/gocover/devcontainer-feature.json index e346a6c..bba8304 100644 --- a/src/gocover/devcontainer-feature.json +++ b/src/gocover/devcontainer-feature.json @@ -1,7 +1,7 @@ { "name": "Go Coverage with Badge", "id": "gocover", - "version": "1.0.0", + "version": "1.0.1", "description": "a gocover command to run Go unit tests with coverages, updating the README.md with a coverage badge.", "keywords": [ "go", @@ -44,6 +44,14 @@ "default": "", "description": "comma-separated list of additional build tags (-tags)" }, + "run": { + "type": "string", + "default": "", + "proposals": [ + "^Test" + ], + "description": "if set, run only those tests, examples, and fuzz tests matching the regular expression" + }, "uncovered-packages": { "type": "string", "default": "", diff --git a/src/gocover/install.sh b/src/gocover/install.sh index 96958ad..b1ad8e6 100755 --- a/src/gocover/install.sh +++ b/src/gocover/install.sh @@ -8,6 +8,7 @@ HTML=${HTML:-false} COUNT=${COUNT:-1} NUM_PROGRAMS=${NUM_PROGRAMS} # ...just a reminder RACE=${RACE:-true} +#RUN=${RUN} VERBOSE=${VERBOSE:-true} GREEN=${GREEN:-80} YELLOW=${YELLOW:-50} @@ -27,11 +28,14 @@ tee "${GOCOVER_PATH}" > /dev/null \ << EOF #!/usr/bin/env bash +set -e + ROOT="${ROOT}" HTML="${HTML}" COUNT="${COUNT}" NUM_PROGRAMS="${NUM_PROGRAMS}" RACE="${RACE}" +RUN="${RUN}" TAGS="${TAGS}" VERBOSE="${VERBOSE}" IGNORE_PKGS=("${IGNORE_PKGS[@]}") @@ -88,6 +92,7 @@ trap 'rm -rf -- "\${GOCOVERTMPDIR}"' EXIT [[ "\${RACE}" = "true" ]] && RACE="-race" || unset RACE [[ "\${VERBOSE}" = "true" ]] && VERBOSE="-v" || unset VERBOSE [[ -n "\${TAGS}" ]] && TAGS="-tags=\${TAGS}" || unset TAGS +[[ -n "\${RUN}" ]] && RUN="-run=\${RUN}" || unset RUN [[ \${#POSARGS[@]} -eq 0 ]] && POSARGS+="./..." @@ -97,6 +102,7 @@ if [[ -n "\${ROOT+x}" ]]; then \${VERBOSE} \ \${RACE} \ -count=\${COUNT} \${NUM_PROGRAMS} \ + \${RUN} \ \${TAGS} \ \${COVERPKG} \ \${POSARGS[@]} -args -test.gocoverdir="\${GOCOVERTMPDIR}" @@ -105,6 +111,7 @@ go test -cover \ \${VERBOSE} \ \${RACE} \ -count=\${COUNT} \${NUM_PROGRAMS} \ + \${RUN} \ \${TAGS} \ \${COVERPKG} \ \${POSARGS[@]} -args -test.gocoverdir="\${GOCOVERTMPDIR}" diff --git a/src/grafanactl/README.md b/src/grafanactl/README.md index b6e5d0f..eae2765 100644 --- a/src/grafanactl/README.md +++ b/src/grafanactl/README.md @@ -1,3 +1,5 @@ +### **IMPORTANT NOTE** +- **This Feature is deprecated, and will no longer receive any further updates/support.** # grafanactl (grafanactl) diff --git a/test/gocover/run-only-tests.sh b/test/gocover/run-only-tests.sh new file mode 100755 index 0000000..118d2d9 --- /dev/null +++ b/test/gocover/run-only-tests.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -e + +source dev-container-features-test-lib + +go mod init example.com/foo + +cat >foo.go <foo_test.go <