abra/tests/integration/recipe_version.bats
decentral1se addbda9145
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
test: fixups for the changepocalypse
2024-07-09 09:41:49 +02:00

40 lines
1.0 KiB
Bash

#!/usr/bin/env bash
setup() {
load "$PWD/tests/integration/helpers/common"
_common_setup
}
@test "recipe versions" {
run $ABRA recipe versions gitea
assert_success
assert_output --partial '2.3.2+1.20.3-rootless'
}
@test "local tags used if no catalogue entry" {
latestRelease=$(git -C "$ABRA_DIR/recipes/$TEST_RECIPE" tag -l | tail -n 1)
run $ABRA recipe versions "$TEST_RECIPE"
assert_success
assert_output --partial "$latestRelease"
}
@test "versions listed in correct order" {
latestVersion=$(jq -r '.gitea.versions[-1] | keys[0]' < "$ABRA_DIR/catalogue/recipes.json")
refute [ -z "$latestVersion" ];
run bash -c '$ABRA recipe versions gitea --machine | jq -r ".[0].version" | head -n 1'
assert_success
assert_output "$latestVersion"
}
@test "app is first service listed" {
run bash -c '$ABRA recipe versions gitea --machine | jq -r ".[0].service" | uniq'
assert_success
assert_output 'app'
run bash -c '$ABRA recipe versions gitea --machine | jq -r ".[1].service" | uniq'
assert_success
assert_output 'db'
}