Signed-off-by: Doug Davis <dug@us.ibm.com>
| ... | ... |
@@ -77,7 +77,7 @@ test-docker-py: build |
| 77 | 77 |
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py |
| 78 | 78 |
|
| 79 | 79 |
validate: build |
| 80 |
- $(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-toml validate-vet |
|
| 80 |
+ $(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-test validate-toml validate-vet |
|
| 81 | 81 |
|
| 82 | 82 |
shell: build |
| 83 | 83 |
$(DOCKER_RUN_DOCKER) bash |
| 52 | 53 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,35 @@ |
| 0 |
+#!/bin/bash |
|
| 1 |
+ |
|
| 2 |
+# Make sure we're not using gos' Testing package any more in integration-cli |
|
| 3 |
+ |
|
| 4 |
+source "${MAKEDIR}/.validate"
|
|
| 5 |
+ |
|
| 6 |
+IFS=$'\n' |
|
| 7 |
+files=( $(validate_diff --diff-filter=ACMR --name-only -- 'integration-cli/*.go' || true) ) |
|
| 8 |
+unset IFS |
|
| 9 |
+ |
|
| 10 |
+badFiles=() |
|
| 11 |
+for f in "${files[@]}"; do
|
|
| 12 |
+ # skip check_test.go since it *does* use the testing package |
|
| 13 |
+ if [ "$f" = "integration-cli/check_test.go" ]; then |
|
| 14 |
+ continue |
|
| 15 |
+ fi |
|
| 16 |
+ |
|
| 17 |
+ # we use "git show" here to validate that what's committed is formatted |
|
| 18 |
+ if git show "$VALIDATE_HEAD:$f" | grep -q testing.T; then |
|
| 19 |
+ badFiles+=( "$f" ) |
|
| 20 |
+ fi |
|
| 21 |
+done |
|
| 22 |
+ |
|
| 23 |
+if [ ${#badFiles[@]} -eq 0 ]; then
|
|
| 24 |
+ echo 'Congratulations! No testing.T found.' |
|
| 25 |
+else |
|
| 26 |
+ {
|
|
| 27 |
+ echo "These files use the wrong testing infrastructure:" |
|
| 28 |
+ for f in "${badFiles[@]}"; do
|
|
| 29 |
+ echo " - $f" |
|
| 30 |
+ done |
|
| 31 |
+ echo |
|
| 32 |
+ } >&2 |
|
| 33 |
+ false |
|
| 34 |
+fi |