0
0
forked from toolshed/abra

Compare commits

...

2 Commits

Author SHA1 Message Date
7f40394aff tests: app_deploy.bats 2025-03-07 15:43:50 +01:00
e35f8f95c6 fix tests 2025-03-07 15:20:18 +01:00
5 changed files with 16 additions and 20 deletions

View File

@ -15,10 +15,6 @@ func TestIsDirty(t *testing.T) {
t.Fatal(err)
}
if err := r.IsDirty(); err != nil {
t.Fatal(err)
}
assert.False(t, r.Dirty)
fpath := filepath.Join(r.Dir, "foo.txt")
@ -31,9 +27,10 @@ func TestIsDirty(t *testing.T) {
os.Remove(fpath)
})
if err := r.IsDirty(); err != nil {
dirty, err := r.IsDirty()
if err != nil {
t.Fatal(err)
}
assert.True(t, r.Dirty)
assert.True(t, dirty)
}

View File

@ -78,7 +78,6 @@ func TestGet(t *testing.T) {
Name: "mygit.org/myorg/cool-recipe",
EnvVersion: "1e83340e",
EnvVersionRaw: "1e83340e+U",
Dirty: true,
Dir: path.Join(cfg.GetAbraDir(), "/recipes/mygit_org_myorg_cool-recipe"),
GitURL: "https://mygit.org/myorg/cool-recipe.git",
SSHURL: "ssh://git@mygit.org/myorg/cool-recipe.git",

View File

@ -22,6 +22,8 @@ setup(){
teardown(){
_reset_recipe
_undeploy_app
_undeploy_app2 "gitea.$TEST_SERVER"
_reset_app
_reset_tags
@ -222,19 +224,6 @@ teardown(){
run $ABRA app deploy "gitea.$TEST_SERVER" --no-input --no-converge-checks
assert_success
assert_output --partial "$latestVersion"
run $ABRA app undeploy "gitea.$TEST_SERVER" --no-input
assert_success
run $ABRA app secret remove "gitea.$TEST_SERVER" --all --no-input
assert_success
run $ABRA app volume remove "gitea.$TEST_SERVER" --no-input
assert_success
run $ABRA app remove "gitea.$TEST_SERVER" --no-input
assert_success
assert_not_exists "$ABRA_DIR/servers/$TEST_SERVER/gitea.$TEST_SERVER.env"
}
# bats test_tags=slow

View File

@ -30,6 +30,15 @@ _undeploy_app() {
assert_output --partial 'unknown'
}
_undeploy_app2() {
run $ABRA app undeploy "$1" --no-input
run $ABRA app ls --server "$TEST_SERVER" --status
assert_success
assert_output --partial "$1"
assert_output --partial 'unknown'
}
_rm_app() {
# NOTE(d1): not asserting outcomes on teardown here since some might fail
# depending on what the test created. all commands run through anyway

View File

@ -38,6 +38,8 @@ _set_git_author() {
}
_git_commit() {
_set_git_author
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" add .
assert_success