tests: add unit test for label skipping
This commit is contained in:
@@ -4,7 +4,7 @@ load test_helper
|
||||
|
||||
setup() {
|
||||
global_setup
|
||||
deploy_app
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
@@ -20,10 +20,16 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(tags) tags:create, tags, tags:destroy" {
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku tags:create $TEST_APP v0.9.0"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku tags $TEST_APP | grep -q -E 'v0.9.0'"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
@@ -40,6 +46,11 @@ teardown() {
|
||||
}
|
||||
|
||||
@test "(tags) tags:deploy" {
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku tags:create $TEST_APP v0.9.0"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
@@ -64,3 +75,27 @@ teardown() {
|
||||
echo "status: $status"
|
||||
assert_failure
|
||||
}
|
||||
|
||||
@test "(tags) tags:deploy (onbuild)" {
|
||||
run /bin/bash -c "docker image pull gliderlabs/logspout:v3.2.13"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "docker image tag gliderlabs/logspout:v3.2.13 dokku/$TEST_APP:3.2.13"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku storage:mount $TEST_APP /var/run/docker.sock:/var/run/docker.sock"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run /bin/bash -c "dokku tags:deploy $TEST_APP 3.2.13"
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_output_contains "Image contains one or more ONBUILD directives, skipping label injection"
|
||||
assert_output_contains "COPY failed" 0
|
||||
assert_success
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user