abra/tests/integration/recipe_version.bats

40 lines
1.1 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 "error if not present in catalogue" {
skip "known issue, see https://git.coopcloud.tech/coop-cloud/recipes-catalogue-json/issues/6"
run $ABRA recipe versions "$TEST_RECIPE"
assert_failure
assert_output --partial "is not published on the catalogue"
}
@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'
}