ci: tolerate the lack of tags in the repository (#1296)

This commit is contained in:
Josh Soref 2022-07-13 01:28:47 -04:00 committed by GitHub
parent ce16c638b7
commit e1fd8ad970
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,22 +35,26 @@ teardown() {
@test "asdf update should checkout the latest non-RC tag" {
local tag=$(git tag | grep -vi "rc" | tail -1)
run asdf update
[ "$status" -eq 0 ]
cd $ASDF_DIR
git tag | grep $tag
[ "$?" -eq 0 ]
if [ -n "$tag" ]; then
run asdf update
[ "$status" -eq 0 ]
cd $ASDF_DIR
git tag | grep $tag
[ "$?" -eq 0 ]
fi
}
@test "asdf update should checkout the latest tag when configured with use_release_candidates = yes" {
local tag=$(git tag | tail -1)
export ASDF_CONFIG_DEFAULT_FILE=$BATS_TMPDIR/asdfrc_defaults
echo "use_release_candidates = yes" >$ASDF_CONFIG_DEFAULT_FILE
run asdf update
[ "$status" -eq 0 ]
cd $ASDF_DIR
git tag | grep $tag
[ "$?" -eq 0 ]
if [ -n "$tag" ]; then
export ASDF_CONFIG_DEFAULT_FILE=$BATS_TMPDIR/asdfrc_defaults
echo "use_release_candidates = yes" >$ASDF_CONFIG_DEFAULT_FILE
run asdf update
[ "$status" -eq 0 ]
cd $ASDF_DIR
git tag | grep $tag
[ "$?" -eq 0 ]
fi
}
@test "asdf update is a noop for when updates are disabled" {