mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Validate we're not using the old testing stuff
Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
parent
3c9ae03a86
commit
ecccfa82aa
4 changed files with 40 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -77,7 +77,7 @@ test-docker-py: build
|
||||||
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
|
$(DOCKER_RUN_DOCKER) hack/make.sh binary test-docker-py
|
||||||
|
|
||||||
validate: build
|
validate: build
|
||||||
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-toml validate-vet
|
$(DOCKER_RUN_DOCKER) hack/make.sh validate-dco validate-gofmt validate-test validate-toml validate-vet
|
||||||
|
|
||||||
shell: build
|
shell: build
|
||||||
$(DOCKER_RUN_DOCKER) bash
|
$(DOCKER_RUN_DOCKER) bash
|
||||||
|
|
|
@ -46,6 +46,7 @@ echo
|
||||||
DEFAULT_BUNDLES=(
|
DEFAULT_BUNDLES=(
|
||||||
validate-dco
|
validate-dco
|
||||||
validate-gofmt
|
validate-gofmt
|
||||||
|
validate-test
|
||||||
validate-toml
|
validate-toml
|
||||||
validate-vet
|
validate-vet
|
||||||
|
|
||||||
|
|
35
hack/make/validate-test
Normal file
35
hack/make/validate-test
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Make sure we're not using gos' Testing package any more in integration-cli
|
||||||
|
|
||||||
|
source "${MAKEDIR}/.validate"
|
||||||
|
|
||||||
|
IFS=$'\n'
|
||||||
|
files=( $(validate_diff --diff-filter=ACMR --name-only -- 'integration-cli/*.go' || true) )
|
||||||
|
unset IFS
|
||||||
|
|
||||||
|
badFiles=()
|
||||||
|
for f in "${files[@]}"; do
|
||||||
|
# skip check_test.go since it *does* use the testing package
|
||||||
|
if [ "$f" = "integration-cli/check_test.go" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# we use "git show" here to validate that what's committed is formatted
|
||||||
|
if git show "$VALIDATE_HEAD:$f" | grep -q testing.T; then
|
||||||
|
badFiles+=( "$f" )
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ ${#badFiles[@]} -eq 0 ]; then
|
||||||
|
echo 'Congratulations! No testing.T found.'
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo "These files use the wrong testing infrastructure:"
|
||||||
|
for f in "${badFiles[@]}"; do
|
||||||
|
echo " - $f"
|
||||||
|
done
|
||||||
|
echo
|
||||||
|
} >&2
|
||||||
|
false
|
||||||
|
fi
|
|
@ -8,7 +8,9 @@ import (
|
||||||
"github.com/go-check/check"
|
"github.com/go-check/check"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test(t *testing.T) { check.TestingT(t) }
|
func Test(t *testing.T) {
|
||||||
|
check.TestingT(t)
|
||||||
|
}
|
||||||
|
|
||||||
type TimerSuite struct {
|
type TimerSuite struct {
|
||||||
start time.Time
|
start time.Time
|
||||||
|
|
Loading…
Reference in a new issue