Tibor Vass
da8cd68e4f
integration-cli: run goimports
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 5b7347c312
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:53 +02:00
Vikram bir Singh
9464d3cd68
Disable TestPsListContainersFilterExited (Windows)
...
On account of being flaky on both RS1 and RS5.
Co-Authored-By: Sebastiaan van Stijn <thaJeztah@users.noreply.github.com>
Signed-off-by: Vikram bir Singh <vikrambir.singh@docker.com>
(cherry picked from commit 7de4e13089
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:52 +02:00
Sebastiaan van Stijn
50cee7c48d
hack/test/unit: fix custom TESTFLAGS not working
...
The `-test.timeout=5m` was glued directly after the current `TESTFLAGS`,
causing them to be non-functional;
Before:
make TESTDEBUG=1 TESTDIRS='github.com/docker/docker/pkg/filenotify' TESTFLAGS='-test.run TestPollerEvent' test-unit
+ mkdir -p bundles
+ gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- -tags 'netgo seccomp libdm_no_deferred_remove' -cover -coverprofile=bundles/profile.out -covermode=atomic -test.run TestPollerEvent-test.timeout=5m github.com/docker/docker/pkg/filenotify
testing: warning: no tests to run
ok github.com/docker/docker/pkg/filenotify 0.003s coverage: 0.0% of statements [no tests to run]
DONE 0 tests in 0.298s
After:
make TESTDEBUG=1 TESTDIRS='github.com/docker/docker/pkg/filenotify' TESTFLAGS='-test.run TestPollerEvent' test-unit
+ mkdir -p bundles
+ gotestsum --format=standard-quiet --jsonfile=bundles/go-test-report.json --junitfile=bundles/junit-report.xml -- -tags 'netgo seccomp libdm_no_deferred_remove' -cover -coverprofile=bundles/profile.out -covermode=atomic -test.run TestPollerEvent -test.timeout=5m github.com/docker/docker/pkg/filenotify
ok github.com/docker/docker/pkg/filenotify 0.608s coverage: 44.7% of statements
DONE 1 tests in 0.922s
This was introduced in 42f0a0db75
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0620990307
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:52 +02:00
Tibor Vass
682a46189b
integration-cli: move each test suite to its own TestX testing function
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit f1c1cd436a
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:51 +02:00
Tibor Vass
e1c5cdf14d
hack: have integration-cli use gotestsum codepath
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 84928be605
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:50 +02:00
Sebastiaan van Stijn
4cf69b995e
integration-cli: remove unneeded fmt.Sprintf() in asserts
...
Replaced using a bit of grep-ing;
```
find . -name "*_test.go" -exec sed -E -i 's#assert.Assert\((.*), fmt.Sprintf\((.*)\)\)$#assert.Assert\(\1, \2\)#g' '{}' \;
```
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0fabf3e41e
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:50 +02:00
Pavel Tikhomirov
419995682f
integration-cli/requirements: Skip windows specific isolation requirements on non-windows
...
After the commit faaffd5d6d
("Windows:Disable 2 restart test when
Hyper-V") some tests became skipped on linux:
SKIP: docker_cli_restart_test.go:167: DockerSuite.TestRestartContainerSuccess (unmatched requirement IsolationIsProcess)
SKIP: docker_cli_restart_test.go:240: DockerSuite.TestRestartPolicyAfterRestart (unmatched requirement IsolationIsProcess)
But AFAIU it is highly unlikely that we actually meant to skip them on linux.
https://github.com/moby/moby/issues/39625
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
(cherry picked from commit b469933b06
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:49 +02:00
Tibor Vass
7ae6aa420d
integration-cli: remove TestingT
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 231ed42cab
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:48 +02:00
Tibor Vass
4c3e2dc441
suite: put suite setup inside test run
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit d32e6bbde8
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:47 +02:00
Tibor Vass
d98c74d38d
intgration-cli: fix formatting
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit cc01289792
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:47 +02:00
Tibor Vass
cf50c5bba8
integration-cli: fix pollCheck
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8eb9f3f90e
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:46 +02:00
Tibor Vass
05933ab2d4
integration-cli: have helper functions use testing.Helper()
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit bad6f3bf73
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:45 +02:00
Tibor Vass
15aa73ea4c
remove per-test -timeout logic because it does not work
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8bffe9524d
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:45 +02:00
Tibor Vass
df569fd54c
hack: update scripts
...
- remove -check.* flags
- use (per-test) -timeout flag
- allow user to override TEST_SKIP_* regardless of TESTFLAGS
- remove test-imports validation
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 7cd028f2d0
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:44 +02:00
Tibor Vass
0fa81e50e3
Update Jenkinsfile
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 7491db3e92
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:43 +02:00
Tibor Vass
a5282fa128
cleanup
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 925e407c7b
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:43 +02:00
Tibor Vass
da96e5c27b
Setup tests
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 8b40da168b
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:42 +02:00
Tibor Vass
fce03f9921
internal/test/suite
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit fd0ed80ff2
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:41 +02:00
Tibor Vass
c3d8cb99a0
vendor: remove vdemeester/shakers and go-check/check
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 3aa4ff64aa
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:41 +02:00
Tibor Vass
5f7621b01e
remove rm-gocheck.go and templates
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 9843c2f12c
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:40 +02:00
Tibor Vass
37555cdeff
remove waitAndAssert and type casts
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 649201dc44
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:39 +02:00
Tibor Vass
be42af89f8
fix remaining issues with checker.Not
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 40f1950e8e
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:38 +02:00
Tibor Vass
9266ff7893
waitAndAssert -> poll.WaitOn
...
go get -d golang.org/x/tools/cmd/eg && \
dir=$(go env GOPATH)/src/golang.org/x/tools && \
git -C "$dir" fetch https://github.com/tiborvass/tools handle-variadic && \
git -C "$dir" checkout 61a94b82347c29b3289e83190aa3dda74d47abbb && \
go install golang.org/x/tools/cmd/eg
eg -w -t template.waitAndAssert.go ./integration-cli 2>&1 \
| awk '{print $2}' | while read file; do
# removing vendor/ in import paths
# not sure why eg adds them
sed -E -i 's#^([\t]+").*/vendor/([^"]+)#\1\2#g' "$file"
sed -E -i 's#\.\(eg_compareFunc\)##g' "$file"
goimports -w "$file"
done
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit ac2f24e72a
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:38 +02:00
Tibor Vass
d766dac3bf
prepare for eg on waitAndAssert
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 42599f1cad
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:37 +02:00
Tibor Vass
c30d52b829
fix remaining compile issues
...
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 318b1612e1
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:36 +02:00
Tibor Vass
be66788e3c
rm-gocheck: fix compile errors from converting check.CommentInterface to string
...
while :; do \
out=$(go test -c ./integration-cli 2>&1 | grep 'cannot use nil as type string in return argument') || break
echo "$out" | while read line; do
file=$(echo "$line" | cut -d: -f1)
n=$(echo "$line" | cut -d: -f2)
sed -E -i "${n}"'s#\b(return .*, )nil#\1""#g' "$file"
done
done \
&& \
while :; do \
out=$(go test -c ./integration-cli/daemon 2>&1 | grep 'cannot use nil as type string in return argument') || break
echo "$out" | while read line; do
file=$(echo "$line" | cut -d: -f1)
n=$(echo "$line" | cut -d: -f2)
sed -E -i "${n}"'s#\b(return .*, )nil#\1""#g' "$file"
done
done \
&& \
while :; do \
out=$(go test -c ./pkg/discovery 2>&1 | grep 'cannot use nil as type string in return argument') || break
echo "$out" | while read line; do
file=$(echo "$line" | cut -d: -f1)
n=$(echo "$line" | cut -d: -f2)
sed -E -i "${n}"'s#\b(return .*, )nil#\1""#g' "$file"
done
done \
&& \
while :; do \
out=$(go test -c ./pkg/discovery/file 2>&1 | grep 'cannot use nil as type string in return argument') || break
echo "$out" | while read line; do
file=$(echo "$line" | cut -d: -f1)
n=$(echo "$line" | cut -d: -f2)
sed -E -i "${n}"'s#\b(return .*, )nil#\1""#g' "$file"
done
done \
&& \
while :; do \
out=$(go test -c ./pkg/discovery/kv 2>&1 | grep 'cannot use nil as type string in return argument') || break
echo "$out" | while read line; do
file=$(echo "$line" | cut -d: -f1)
n=$(echo "$line" | cut -d: -f2)
sed -E -i "${n}"'s#\b(return .*, )nil#\1""#g' "$file"
done
done \
&& \
while :; do \
out=$(go test -c ./pkg/discovery/memory 2>&1 | grep 'cannot use nil as type string in return argument') || break
echo "$out" | while read line; do
file=$(echo "$line" | cut -d: -f1)
n=$(echo "$line" | cut -d: -f2)
sed -E -i "${n}"'s#\b(return .*, )nil#\1""#g' "$file"
done
done \
&& \
while :; do \
out=$(go test -c ./pkg/discovery/nodes 2>&1 | grep 'cannot use nil as type string in return argument') || break
echo "$out" | while read line; do
file=$(echo "$line" | cut -d: -f1)
n=$(echo "$line" | cut -d: -f2)
sed -E -i "${n}"'s#\b(return .*, )nil#\1""#g' "$file"
done
done
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 64de5e8228
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:36 +02:00
Tibor Vass
dc044f26ea
rm-gocheck: goimports
...
goimports -w \
-- "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli" "./integration-cli/daemon" "./pkg/discovery" \
&& \
gofmt -w -s \
-- "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli" "./integration-cli/daemon" "./pkg/discovery"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 7813dfe9d7
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:35 +02:00
Tibor Vass
1b1fe4cc64
rm-gocheck: check.CommentInterface -> string
...
sed -E -i 's#(\*testing\.T\b.*)check\.CommentInterface\b#\1string#g' \
-- "integration-cli/daemon/daemon.go" "integration-cli/daemon/daemon_swarm.go" "integration-cli/docker_api_exec_test.go" "integration-cli/docker_api_swarm_service_test.go" "integration-cli/docker_api_swarm_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_restart_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_service_health_test.go" "integration-cli/docker_cli_service_logs_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_utils_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 3a24472c8e
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:34 +02:00
Tibor Vass
be28c05949
rm-gocheck: convert check.Commentf to string - other
...
sed -E -i 's#\bcheck.Commentf\(([^\)]+)\)#\1#g' \
-- "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_run_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 6e5cf532af
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:33 +02:00
Tibor Vass
2f069fa3a5
rm-gocheck: convert check.Commentf to string - with just one string
...
sed -E -i 's#\bcheck.Commentf\(("[^"]+")\)#\1#g' \
-- "integration-cli/daemon/daemon_swarm.go" "integration-cli/docker_api_containers_test.go" "integration-cli/docker_api_swarm_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_logs_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_userns_test.go" "integration-cli/docker_cli_volume_test.go" "integration-cli/docker_utils_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 6135eec30a
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:33 +02:00
Tibor Vass
673cf751ca
rm-gocheck: convert check.Commentf to string - with multiple args
...
sed -E -i 's#\bcheck.Commentf\(([^,]+),(.*)\)#fmt.Sprintf(\1,\2)#g' \
-- "integration-cli/daemon/daemon.go" "integration-cli/daemon/daemon_swarm.go" "integration-cli/docker_api_containers_test.go" "integration-cli/docker_api_exec_test.go" "integration-cli/docker_api_swarm_node_test.go" "integration-cli/docker_api_swarm_test.go" "integration-cli/docker_cli_attach_unix_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_commit_test.go" "integration-cli/docker_cli_cp_from_container_test.go" "integration-cli/docker_cli_cp_to_container_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_info_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_netmode_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_service_logs_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_userns_test.go" "integration-cli/docker_cli_volume_test.go" "integration-cli/docker_hub_pull_suite_test.go" "integration-cli/docker_utils_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit a2024a5470
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:32 +02:00
Tibor Vass
ed9449a424
rm-gocheck: Contains -> strings.Contains
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Contains, (.*)\)$#assert.Assert(c, eg_contains(\1, \2))#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_commit_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_info_test.go" "integration-cli/docker_cli_info_unix_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_netmode_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go" \
&& \
go get -d golang.org/x/tools/cmd/eg && dir=$(go env GOPATH)/src/golang.org/x/tools && git -C "$dir" fetch https://github.com/tiborvass/tools handle-variadic && git -C "$dir" checkout 61a94b82347c29b3289e83190aa3dda74d47abbb && go install golang.org/x/tools/cmd/eg \
&& \
/bin/echo -e 'package main\nvar eg_contains func(arg1, arg2 string, extra ...interface{}) bool' > ./integration-cli/eg_helper.go \
&& \
goimports -w ./integration-cli \
&& \
eg -w -t template.contains.go -- ./integration-cli \
&& \
rm -f ./integration-cli/eg_helper.go \
&& \
go run rm-gocheck.go redress '\bassert\.Assert\b.*(\(|,)\s*$' \
"integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_commit_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_info_test.go" "integration-cli/docker_cli_info_unix_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_netmode_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 98f2638fe5
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:31 +02:00
Tibor Vass
07b243656c
rm-gocheck: Not(Contains) -> !strings.Contains
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Not\(checker\.Contains\), (.*)\)$#assert.Assert(c, !eg_contains(\1, \2))#g' \
-- "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go" \
&& \
go get -d golang.org/x/tools/cmd/eg && dir=$(go env GOPATH)/src/golang.org/x/tools && git -C "$dir" fetch https://github.com/tiborvass/tools handle-variadic && git -C "$dir" checkout 61a94b82347c29b3289e83190aa3dda74d47abbb && go install golang.org/x/tools/cmd/eg \
&& \
/bin/echo -e 'package main\nvar eg_contains func(arg1, arg2 string, extra ...interface{}) bool' > ./integration-cli/eg_helper.go \
&& \
goimports -w ./integration-cli \
&& \
eg -w -t template.not_contains.go -- ./integration-cli \
&& \
rm -f ./integration-cli/eg_helper.go \
&& \
go run rm-gocheck.go redress '\bassert\.Assert\b.*(\(|,)\s*$' \
"integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 4e2e486b23
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:31 +02:00
Tibor Vass
99c1b63197
rm-gocheck: Matches -> cmp.Regexp
...
sed -E -i '0,/^import "github\.com/ s/^(import "github\.com.*)/\1\nimport "gotest.tools\/assert\/cmp")/' \
-- "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_links_test.go" \
&& \
sed -E -i '0,/^\t+"github\.com/ s/(^\t+"github\.com.*)/\1\n"gotest.tools\/assert\/cmp"/' \
-- "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_links_test.go" \
&& \
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Matches, (.*)\)$#assert.Assert(c, eg_matches(is.Regexp, \1, \2))#g' \
-- "integration-cli/docker_cli_images_test.go" "integration-cli/docker_api_containers_test.go" \
&& \
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Matches, (.*)\)$#assert.Assert(c, eg_matches(cmp.Regexp, \1, \2))#g' \
-- "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_links_test.go" \
&& \
go get -d golang.org/x/tools/cmd/eg && dir=$(go env GOPATH)/src/golang.org/x/tools && git -C "$dir" fetch https://github.com/tiborvass/tools handle-variadic && git -C "$dir" checkout 61a94b82347c29b3289e83190aa3dda74d47abbb && go install golang.org/x/tools/cmd/eg \
&& \
/bin/echo -e 'package main\nvar eg_matches func(func(cmp.RegexOrPattern, string) cmp.Comparison, interface{}, string, ...interface{}) bool' > ./integration-cli/eg_helper.go \
&& \
goimports -w ./integration-cli \
&& \
eg -w -t template.matches.go -- ./integration-cli \
&& \
rm -f ./integration-cli/eg_helper.go \
&& \
go run rm-gocheck.go redress '\bassert\.Assert\b.*(\(|,)\s*$' \
"integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_links_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit f2c9e391fc
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:30 +02:00
Tibor Vass
e25352a42a
rm-gocheck: run goimports to compile successfully
...
goimports -w \
-- "./integration-cli/daemon" "./pkg/discovery" "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli" \
&& \
gofmt -w -s \
-- "./integration-cli/daemon" "./pkg/discovery" "./pkg/discovery/file" "./pkg/discovery/kv" "./pkg/discovery/memory" "./pkg/discovery/nodes" "./integration-cli"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 59e55dcdd0
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:28 +02:00
Tibor Vass
d523748a4f
rm-gocheck: comment out check.TestingT
...
sed -E -i 's#([^*])(check\.TestingT\([^\)]+\))#\1/*\2*/#g' \
-- "integration-cli/check_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go" "pkg/discovery/nodes/nodes_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit eb67bb9fb5
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:27 +02:00
Tibor Vass
bbcad73a27
rm-gocheck: comment out check.Suite calls
...
sed -E -i 's#^([^*])+?((var .*)?check\.Suite\(.*\))#\1/*\2*/#g' \
-- "integration-cli/check_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_hub_pull_suite_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go" "pkg/discovery/nodes/nodes_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 81d2a0c389
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:26 +02:00
Tibor Vass
1da0c05e48
rm-gocheck: redress check.Suite calls
...
go run rm-gocheck.go redress '[^/]\bcheck\.Suite\(.*\{\s*$' \
"integration-cli/check_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_network_unix_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 6a8a9738ec
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:26 +02:00
Tibor Vass
7696045c1d
rm-gocheck: True
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.True#assert.Assert(c, \1#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_cp_from_container_test.go" "integration-cli/docker_cli_cp_to_container_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_service_create_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit d0fc8d082d
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:25 +02:00
Tibor Vass
cfd0c55d99
rm-gocheck: False
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.False\b#assert.Assert(c, !\1#g' \
-- "integration-cli/docker_cli_by_digest_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit b17bb1e74a
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:24 +02:00
Tibor Vass
e49237dc7d
rm-gocheck: NotNil
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.NotNil\b#assert.Assert(c, \1 != nil#g' \
-- "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_netmode_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/nodes/nodes_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 64a161aa3e
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:24 +02:00
Tibor Vass
ef4c63acf6
rm-gocheck: IsNil
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.IsNil\b#assert.Assert(c, \1 == nil#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_attach_test.go" "integration-cli/docker_cli_attach_unix_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_cp_from_container_test.go" "integration-cli/docker_cli_cp_to_container_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_health_test.go" "integration-cli/docker_cli_history_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_userns_test.go" "integration-cli/docker_cli_volume_test.go" "integration-cli/docker_hub_pull_suite_test.go" "integration-cli/docker_utils_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 2743e2d8bc
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:23 +02:00
Tibor Vass
7b91af803d
rm-gocheck: HasLen -> assert.Equal + len()
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.HasLen, (.*)#assert.Equal(c, len(\1), \2#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_pull_local_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_userns_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 491ef7b901
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:22 +02:00
Tibor Vass
17e04aa6c2
rm-gocheck: DeepEquals -> assert.DeepEqual
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.DeepEquals, (.*)#assert.DeepEqual(c, \1, \2#g' \
-- "integration-cli/docker_cli_daemon_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit dd9d28669f
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:21 +02:00
Tibor Vass
6dc7846d26
rm-gocheck: Equals -> assert.Equal
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Equals, (.*)#assert.Equal(c, \1, \2#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_api_swarm_node_test.go" "integration-cli/docker_cli_attach_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_commit_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_health_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_import_test.go" "integration-cli/docker_cli_info_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_links_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_plugins_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_rmi_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_service_health_test.go" "integration-cli/docker_cli_start_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_userns_test.go" "integration-cli/docker_cli_volume_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/generator_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/nodes/nodes_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 6dc7f4c167
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:21 +02:00
Tibor Vass
b3d02e7f3c
rm-gocheck: Not(Matches) -> !cmp.Regexp
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Not\(checker\.Matches\), (.*)\)#assert.Assert(c, !is.Regexp("^"+\2+"$", \1)().Success())#g' \
-- "integration-cli/docker_cli_images_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 10208e4d60
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:20 +02:00
Tibor Vass
819baeb430
rm-gocheck: Not(Equals) -> a != b
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Not\(checker\.Equals\), (.*)#assert.Assert(c, \1 != \2#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_prune_unix_test.go" "integration-cli/docker_cli_ps_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 0fa116fa8f
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:19 +02:00
Tibor Vass
fa8d7029a7
rm-gocheck: Not(IsNil) -> != nil
...
sed -E -i 's#\bassert\.Assert\(c, (.*), checker\.Not\(checker\.IsNil\)#assert.Assert(c, \1 != nil#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_service_create_test.go" "integration-cli/docker_cli_volume_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 74747b35e1
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:19 +02:00
Tibor Vass
c8da7fbd25
rm-gocheck: normalize to use checker
...
sed -E -i 's#\bcheck\.(Equals|DeepEquals|HasLen|IsNil|Matches|Not|NotNil)\b#checker.\1#g' \
-- "integration-cli/docker_api_containers_test.go" "integration-cli/docker_cli_attach_test.go" "integration-cli/docker_cli_attach_unix_test.go" "integration-cli/docker_cli_build_test.go" "integration-cli/docker_cli_build_unix_test.go" "integration-cli/docker_cli_by_digest_test.go" "integration-cli/docker_cli_create_test.go" "integration-cli/docker_cli_daemon_test.go" "integration-cli/docker_cli_external_volume_driver_unix_test.go" "integration-cli/docker_cli_health_test.go" "integration-cli/docker_cli_images_test.go" "integration-cli/docker_cli_inspect_test.go" "integration-cli/docker_cli_netmode_test.go" "integration-cli/docker_cli_network_unix_test.go" "integration-cli/docker_cli_port_test.go" "integration-cli/docker_cli_run_test.go" "integration-cli/docker_cli_run_unix_test.go" "integration-cli/docker_cli_save_load_test.go" "integration-cli/docker_cli_service_health_test.go" "integration-cli/docker_cli_swarm_test.go" "integration-cli/docker_cli_volume_test.go" "integration-cli/docker_utils_test.go" "pkg/discovery/discovery_test.go" "pkg/discovery/file/file_test.go" "pkg/discovery/generator_test.go" "pkg/discovery/kv/kv_test.go" "pkg/discovery/memory/memory_test.go" "pkg/discovery/nodes/nodes_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit 230f7bcc02
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:18 +02:00
Tibor Vass
99deded542
rm-gocheck: ErrorMatches -> assert.ErrorContains
...
sed -E -i 's#\bassert\.Assert\(c, (.*), check\.ErrorMatches,#assert.ErrorContains(c, \1,#g' \
-- "pkg/discovery/kv/kv_test.go"
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit a7d144fb34
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-09-26 23:52:17 +02:00