fix: abra app new checks out latest version

See coop-cloud/organising#618
This commit is contained in:
2024-06-20 08:36:09 +02:00
parent e07ae8cccd
commit 316fdd3643
4 changed files with 42 additions and 5 deletions

View File

@ -37,6 +37,15 @@ teardown(){
}
@test "create new app" {
_fetch_recipe
_latest_tag
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" checkout $LATEST_TAG
assert_success
_latest_hash
_reset_recipe
run $ABRA app new "$TEST_RECIPE" \
--no-input \
--server "$TEST_SERVER" \
@ -44,8 +53,8 @@ teardown(){
assert_success
assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" status
assert_output --partial "up to date"
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" log -1
assert_output --partial "$LATEST_HASH"
}
@test "create new app with version" {

View File

@ -35,3 +35,11 @@ _set_git_author() {
run git -C "$ABRA_DIR/recipes/$TEST_RECIPE" config --local user.name test
assert_success
}
_latest_tag() {
export LATEST_TAG=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" describe --abbrev=0)
}
_latest_hash() {
export LATEST_HASH=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" log -1 --pretty=format:%h)
}