feat: add volume arg to volume rm

See toolshed/abra#574
This commit is contained in:
2025-08-13 13:41:38 +02:00
committed by decentral1se
parent 2cfc40dc28
commit 091611b984
2 changed files with 100 additions and 5 deletions

View File

@ -63,20 +63,24 @@ teardown(){
# bats test_tags=slow
@test "remove volumes" {
sleep 3 # NOTE(d1): hack to avoid "network not found"
_deploy_app
_undeploy_app
run $ABRA app volume ls "$TEST_APP_DOMAIN"
assert_success
assert_output --partial 'test-volume'
run $ABRA app volume rm "$TEST_APP_DOMAIN" --force
assert_success
assert_output --partial 'volumes removed successfully'
run $ABRA app volume ls "$TEST_APP_DOMAIN"
assert_success
assert_output --partial 'no volumes created'
}
# bats test_tags=slow
@test "remove no volumes" {
sleep 3 # NOTE(d1): hack to avoid "network not found"
_deploy_app
_undeploy_app
@ -88,3 +92,59 @@ teardown(){
assert_success
assert_output --partial 'no volumes removed'
}
# bats test_tags=slow
@test "remove single volume" {
_deploy_app
_undeploy_app
run $ABRA app volume ls "$TEST_APP_DOMAIN"
assert_success
assert_output --partial 'test-volume'
assert_output --partial 'test-volume-two'
run $ABRA app volume rm "$TEST_APP_DOMAIN" test-volume-two --force
assert_success
assert_output --partial 'test-volume-two removed successfully'
run $ABRA app volume ls "$TEST_APP_DOMAIN"
assert_success
assert_output --partial 'test-volume'
refute_output --partial 'test-volume-two'
run $ABRA app volume rm "$TEST_APP_DOMAIN" --force
assert_success
assert_output --partial 'volumes removed successfully'
run $ABRA app volume ls "$TEST_APP_DOMAIN"
assert_success
assert_output --partial 'no volumes created'
}
# bats test_tags=slow
@test "remove single volume incorrect name" {
_deploy_app
_undeploy_app
run $ABRA app volume rm "$TEST_APP_DOMAIN" DOESNTEXIST --force
assert_failure
assert_output --partial 'no volume with name'
}
# bats test_tags=slow
@test "remove single volume doesn't delete similar name" {
_deploy_app
_undeploy_app
run $ABRA app volume ls "$TEST_APP_DOMAIN"
assert_success
assert_output --partial 'test-volume-two'
run $ABRA app volume rm "$TEST_APP_DOMAIN" test-volume --force
assert_success
assert_output --partial 'test-volume removed successfully'
run $ABRA app volume ls "$TEST_APP_DOMAIN"
assert_success
assert_output --partial 'test-volume-two'
}