test: less fragile integration suite [ci skip]

See coop-cloud/organising#584
See coop-cloud/organising#595
This commit is contained in:
2024-06-22 16:40:07 +02:00
parent a9ce2106c6
commit 2014cd6622
39 changed files with 249 additions and 425 deletions

View File

@ -19,6 +19,13 @@ setup(){
_common_setup
}
teardown(){
_rm "$BATS_TMPDIR/*.txt"
_rm_remote "/etc/*.txt"
_rm "$BATS_TMPDIR/mydir"
}
@test "validate app argument" {
run $ABRA app cp
assert_failure
@ -49,6 +56,7 @@ setup(){
assert_output --partial 'arguments must take $SERVICE:$PATH form'
}
# bats test_tags=slow
@test "error if local file missing" {
run $ABRA app cp "$TEST_APP_DOMAIN" thisfileshouldnotexist.txt app:/somewhere
assert_failure
@ -62,8 +70,6 @@ setup(){
run $ABRA app cp "$TEST_APP_DOMAIN" "$BATS_TMPDIR/myfile.txt" doesnt_exist:/ --debug
assert_failure
assert_output --partial 'no containers matching'
_rm "$BATS_TMPDIR/myfile.txt"
}
# bats test_tags=slow
@ -76,9 +82,6 @@ setup(){
run $ABRA app run "$TEST_APP_DOMAIN" app cat /etc/myfile.txt
assert_success
assert_output --partial "foo"
_rm "$BATS_TMPDIR/myfile.txt"
_rm_remote "/etc/myfile.txt"
}
# bats test_tags=slow
@ -102,9 +105,6 @@ setup(){
run $ABRA app run "$TEST_APP_DOMAIN" app cat /etc/myfile.txt
assert_success
assert_output --partial "bar"
_rm "$BATS_TMPDIR/myfile.txt"
_rm_remote "/etc/myfile.txt"
}
# bats test_tags=slow
@ -155,9 +155,6 @@ setup(){
run $ABRA app run "$TEST_APP_DOMAIN" app ls /etc/myfile2.txt
assert_success
assert_output --partial "myfile2.txt"
_rm "$BATS_TMPDIR/mydir"
_rm_remote "/etc/myfile*"
}
# bats test_tags=slow
@ -169,9 +166,6 @@ setup(){
assert_success
assert_exists "$BATS_TMPDIR/myfile.txt"
assert bash -c "cat $BATS_TMPDIR/myfile.txt | grep -q foo"
_rm "$BATS_TMPDIR/myfile.txt"
_rm_remote "/etc/myfile.txt"
}
# bats test_tags=slow
@ -183,9 +177,6 @@ setup(){
assert_success
assert_exists "$BATS_TMPDIR/myfile.txt"
assert bash -c "cat $BATS_TMPDIR/myfile.txt | grep -q foo"
_rm "$BATS_TMPDIR/myfile.txt"
_rm_remote "/etc/myfile.txt"
}
# bats test_tags=slow
@ -197,9 +188,6 @@ setup(){
assert_success
assert_exists "$BATS_TMPDIR/myfile2.txt"
assert bash -c "cat $BATS_TMPDIR/myfile2.txt | grep -q foo"
_rm "$BATS_TMPDIR/myfile2.txt"
_rm_remote "/etc/myfile.txt"
}
# bats test_tags=slow
@ -217,10 +205,6 @@ setup(){
assert_exists "$BATS_TMPDIR/mydir/etc/myfile.txt"
assert_success
assert_exists "$BATS_TMPDIR/mydir/etc/myfile2.txt"
_rm "$BATS_TMPDIR/mydir"
_rm_remote "/etc/myfile.txt"
_rm_remote "/etc/myfile2.txt"
}
# bats test_tags=slow
@ -238,8 +222,4 @@ setup(){
assert_exists "$BATS_TMPDIR/mydir/myfile.txt"
assert_success
assert_exists "$BATS_TMPDIR/mydir/myfile2.txt"
_rm "$BATS_TMPDIR/mydir"
_rm_remote "/etc/myfile.txt"
_rm_remote "/etc/myfile2.txt"
}