mirror of https://github.com/docker/docs.git
Merge pull request #690 from aluzzardi/lint-tests
travis: Lint test files (ensure they are not space indented)
This commit is contained in:
commit
a6ad9a073a
|
@ -24,6 +24,8 @@ script:
|
||||||
- script/validate-gofmt
|
- script/validate-gofmt
|
||||||
- go vet ./...
|
- go vet ./...
|
||||||
- fgt golint ./...
|
- fgt golint ./...
|
||||||
|
# Lint our test files and make sure they are not space indented.
|
||||||
|
- fgt find test -type f -exec grep -Hn -e "^ " {} \;
|
||||||
- go test -v -race ./...
|
- go test -v -race ./...
|
||||||
- script/coverage
|
- script/coverage
|
||||||
- goveralls -service=travis-ci -coverprofile=goverage.report
|
- goveralls -service=travis-ci -coverprofile=goverage.report
|
||||||
|
|
|
@ -44,35 +44,35 @@ function teardown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "image affinity" {
|
@test "image affinity" {
|
||||||
start_docker 2
|
start_docker 2
|
||||||
swarm_manage
|
swarm_manage
|
||||||
|
|
||||||
run docker -H ${HOSTS[0]} pull busybox
|
run docker -H ${HOSTS[0]} pull busybox
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
run docker_swarm run --name c1 -e affinity:image==busybox -d busybox:latest sh
|
run docker_swarm run --name c1 -e affinity:image==busybox -d busybox:latest sh
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
run docker_swarm run --name c2 -e affinity:image!=busybox -d busybox:latest sh
|
run docker_swarm run --name c2 -e affinity:image!=busybox -d busybox:latest sh
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
run docker_swarm run --name c3 --label 'com.docker.swarm.affinities=["image==busybox"]' -d busybox:latest sh
|
run docker_swarm run --name c3 --label 'com.docker.swarm.affinities=["image==busybox"]' -d busybox:latest sh
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
run docker_swarm run --name c4 --label 'com.docker.swarm.affinities=["image\!=busybox"]' -d busybox:latest sh
|
run docker_swarm run --name c4 --label 'com.docker.swarm.affinities=["image\!=busybox"]' -d busybox:latest sh
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
||||||
run docker_swarm inspect c1
|
run docker_swarm inspect c1
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *'"Name": "node-0"'* ]]
|
[[ "${output}" == *'"Name": "node-0"'* ]]
|
||||||
|
|
||||||
run docker_swarm inspect c2
|
run docker_swarm inspect c2
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" != *'"Name": "node-0"'* ]]
|
[[ "${output}" != *'"Name": "node-0"'* ]]
|
||||||
|
|
||||||
run docker_swarm inspect c3
|
run docker_swarm inspect c3
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" == *'"Name": "node-0"'* ]]
|
[[ "${output}" == *'"Name": "node-0"'* ]]
|
||||||
|
|
||||||
run docker_swarm inspect c4
|
run docker_swarm inspect c4
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[[ "${output}" != *'"Name": "node-0"'* ]]
|
[[ "${output}" != *'"Name": "node-0"'* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "label affinity" {
|
@test "label affinity" {
|
||||||
|
|
|
@ -32,7 +32,7 @@ function teardown() {
|
||||||
swarm_manage
|
swarm_manage
|
||||||
|
|
||||||
#create a container
|
#create a container
|
||||||
run docker_swarm run -d --name test_container busybox sleep 1000
|
run docker_swarm run -d --name test_container busybox sleep 1000
|
||||||
|
|
||||||
# test attach-ws api
|
# test attach-ws api
|
||||||
# jimmyxian/centos7-wssh is an image with websocket CLI(WSSH) wirtten in Nodejs
|
# jimmyxian/centos7-wssh is an image with websocket CLI(WSSH) wirtten in Nodejs
|
||||||
|
@ -47,19 +47,19 @@ function teardown() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "docker build" {
|
@test "docker build" {
|
||||||
start_docker 3
|
start_docker 3
|
||||||
swarm_manage
|
swarm_manage
|
||||||
|
|
||||||
run docker_swarm images -q
|
|
||||||
[ "$status" -eq 0 ]
|
|
||||||
[ "${#lines[@]}" -eq 0 ]
|
|
||||||
|
|
||||||
run docker_swarm build -t test $BATS_TEST_DIRNAME/testdata/build
|
run docker_swarm images -q
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
[ "${#lines[@]}" -eq 0 ]
|
||||||
|
|
||||||
run docker_swarm images -q
|
run docker_swarm build -t test $BATS_TEST_DIRNAME/testdata/build
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${#lines[@]}" -eq 1 ]
|
|
||||||
|
run docker_swarm images -q
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[ "${#lines[@]}" -eq 1 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "docker commit" {
|
@test "docker commit" {
|
||||||
|
@ -386,7 +386,7 @@ function teardown() {
|
||||||
docker save -o $IMAGE_FILE busybox:latest
|
docker save -o $IMAGE_FILE busybox:latest
|
||||||
|
|
||||||
start_docker 2
|
start_docker 2
|
||||||
swarm_manage
|
swarm_manage
|
||||||
|
|
||||||
run docker_swarm images -q
|
run docker_swarm images -q
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
|
Loading…
Reference in New Issue