test: more integration tests
This commit is contained in:
parent
58e78e4d7c
commit
10f612f998
|
@ -0,0 +1,35 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/helpers.sh"
|
||||
_setup_env
|
||||
}
|
||||
|
||||
@test "bash autocompletion" {
|
||||
run $ABRA autocomplete bash
|
||||
assert_success
|
||||
assert [ -f "$ABRA_DIR/autocompletion/bash" ]
|
||||
}
|
||||
|
||||
@test "zsh autocompletion" {
|
||||
run $ABRA autocomplete zsh
|
||||
assert_success
|
||||
assert [ -f "$ABRA_DIR/autocompletion/zsh" ]
|
||||
}
|
||||
|
||||
@test "fish autocompletion" {
|
||||
run $ABRA autocomplete fish
|
||||
assert_success
|
||||
assert [ -f "$ABRA_DIR/autocompletion/fish" ]
|
||||
}
|
||||
|
||||
@test "fizsh autocompletion" {
|
||||
run $ABRA autocomplete fizsh
|
||||
assert_success
|
||||
assert [ -f "$ABRA_DIR/autocompletion/zsh" ]
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_default_teardown
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/helpers.sh"
|
||||
_setup_env
|
||||
}
|
||||
|
||||
@test "catalogue generate" {
|
||||
run $ABRA catalogue generate
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "catalogue generate specific recipe" {
|
||||
run $ABRA catalogue generate gitea
|
||||
assert_success
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_default_teardown
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/helpers.sh"
|
||||
_setup_env
|
||||
|
||||
if [[ -f "$HOME/.local/bin/abra" ]]; then
|
||||
mv "$HOME/.local/bin/abra" "$HOME/.local/bin/abra_before_test"
|
||||
fi
|
||||
}
|
||||
|
||||
@test "install from script" {
|
||||
run bash -c 'curl https://install.abra.coopcloud.tech | bash'
|
||||
assert_success
|
||||
|
||||
assert [ -f "$HOME/.local/bin/abra" ]
|
||||
run $HOME/.local/bin/abra -v
|
||||
assert_output --partial 'beta'
|
||||
}
|
||||
|
||||
@test "install release candidate from script" {
|
||||
run bash -c 'curl https://install.abra.coopcloud.tech | bash -s -- --rc'
|
||||
assert_success
|
||||
|
||||
assert [ -f "$HOME/.local/bin/abra" ]
|
||||
run $HOME/.local/bin/abra -v
|
||||
assert_output --partial '-rc'
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_default_teardown
|
||||
|
||||
if [[ -f "$HOME/.local/bin/abra_before_test" ]]; then
|
||||
rm -rf "$HOME/.local/bin/abra"
|
||||
mv "$HOME/.local/bin/abra_before_test" "$HOME/.local/bin/abra"
|
||||
fi
|
||||
}
|
|
@ -24,6 +24,60 @@ setup() {
|
|||
assert_output --partial 'A new foobar app has been created!'
|
||||
}
|
||||
|
||||
@test "recipe fetch" {
|
||||
run $ABRA recipe fetch matrix-synapse
|
||||
assert_success
|
||||
assert [ -d "$ABRA_DIR/recipes/matrix-synapse" ]
|
||||
}
|
||||
|
||||
@test "recipe sync allows unstaged changes" {
|
||||
run $ABRA recipe fetch matrix-synapse
|
||||
assert_success
|
||||
|
||||
run echo "unstaged changes" >> "$ABRA_DIR/recipes/matrix-synapse/foo"
|
||||
assert_success
|
||||
|
||||
run $ABRA recipe sync matrix-synapse --patch
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "recipe sync detects unstaged label changes" {
|
||||
run $ABRA recipe fetch matrix-synapse
|
||||
assert_success
|
||||
|
||||
run $ABRA recipe sync matrix-synapse --patch
|
||||
assert_success
|
||||
|
||||
run $ABRA recipe sync matrix-synapse --patch
|
||||
assert_success
|
||||
assert_output --partial 'is already set, nothing to do?'
|
||||
}
|
||||
|
||||
@test "recipe list" {
|
||||
run $ABRA recipe list
|
||||
assert_success
|
||||
NUM_RECIPES=$(jq length "$ABRA_DIR/catalogue/recipes.json")
|
||||
assert_output --partial "total recipes: $NUM_RECIPES"
|
||||
}
|
||||
|
||||
@test "recipe list with pattern" {
|
||||
run $ABRA recipe list --pattern cloud
|
||||
assert_success
|
||||
assert_output --partial 'nextcloud'
|
||||
refute_output --partial 'matrix-synapse'
|
||||
}
|
||||
|
||||
@test "recipe lint" {
|
||||
run $ABRA recipe lint gitea
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "recipe versions" {
|
||||
run $ABRA recipe versions gitea
|
||||
assert_success
|
||||
assert_output --partial '2.3.2+1.20.3-rootless'
|
||||
}
|
||||
|
||||
teardown() {
|
||||
_default_teardown
|
||||
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/helpers.sh"
|
||||
_setup_env
|
||||
|
||||
if [[ -f "$HOME/.local/bin/abra" ]]; then
|
||||
mv "$HOME/.local/bin/abra" "$HOME/.local/bin/abra_before_test"
|
||||
fi
|
||||
}
|
||||
|
||||
@test "abra upgrade" {
|
||||
run $ABRA upgrade
|
||||
assert_success
|
||||
assert_output --partial 'Public interest infrastructure'
|
||||
|
||||
assert [ -f "$HOME/.local/bin/abra" ]
|
||||
run $HOME/.local/bin/abra -v
|
||||
assert_output --partial 'beta'
|
||||
}
|
||||
|
||||
@test "abra upgrade release candidate" {
|
||||
run $ABRA upgrade --rc
|
||||
assert_success
|
||||
assert_output --partial 'Public interest infrastructure'
|
||||
|
||||
assert [ -f "$HOME/.local/bin/abra" ]
|
||||
run $HOME/.local/bin/abra -v
|
||||
assert_output --partial '-rc'
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_default_teardown
|
||||
|
||||
if [[ -f "$HOME/.local/bin/abra_before_test" ]]; then
|
||||
rm -rf "$HOME/.local/bin/abra"
|
||||
mv "$HOME/.local/bin/abra_before_test" "$HOME/.local/bin/abra"
|
||||
fi
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
setup() {
|
||||
DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )"
|
||||
source "$DIR/helpers.sh"
|
||||
_setup_env
|
||||
}
|
||||
|
||||
@test "abra version" {
|
||||
run $ABRA -v
|
||||
assert_success
|
||||
assert_output --partial 'dev'
|
||||
}
|
||||
|
||||
teardown(){
|
||||
_default_teardown
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./testfunctions.sh
|
||||
source ./common.sh
|
||||
|
||||
run_test '$ABRA autocomplete bash'
|
||||
|
||||
run_test '$ABRA autocomplete fizsh'
|
||||
|
||||
run_test '$ABRA autocomplete zsh'
|
||||
|
||||
run_test '$ABRA autocomplete fish'
|
|
@ -1,8 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./testfunctions.sh
|
||||
source ./common.sh
|
||||
|
||||
run_test '$ABRA catalogue generate'
|
||||
|
||||
run_test '$ABRA catalogue generate gitea'
|
|
@ -1,12 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./testfunctions.sh
|
||||
source ./common.sh
|
||||
|
||||
run_test 'wget -O- https://install.abra.autonomic.zone | bash; ~/.local/bin/abra -v'
|
||||
|
||||
run_test 'wget -O- https://install.abra.autonomic.zone | bash -s -- --rc; ~/.local/bin/abra -v'
|
||||
|
||||
run_test '$ABRA upgrade; ~/.local/bin/abra -v'
|
||||
|
||||
run_test '$ABRA upgrade --rc; ~/.local/bin/abra -v'
|
|
@ -1,14 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
source ./testfunctions.sh
|
||||
source ./common.sh
|
||||
|
||||
run_test '$ABRA recipe new testrecipe'
|
||||
|
||||
run_test '$ABRA recipe list'
|
||||
|
||||
run_test '$ABRA recipe list --pattern cloud'
|
||||
|
||||
run_test '$ABRA recipe versions peertube'
|
||||
|
||||
run_test '$ABRA recipe lint gitea'
|
Loading…
Reference in New Issue