add random app generator in bash. support create and delete verbs. tested on bash 4.3.18 and 3.2.53
This commit is contained in:
@@ -164,3 +164,15 @@ teardown() {
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "dokku client (create/delete)" {
|
||||
setup_client_repo
|
||||
run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh create"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
run bash -c "${BATS_TEST_DIRNAME}/../../contrib/dokku_client.sh delete force"
|
||||
echo "output: "$output
|
||||
echo "status: "$status
|
||||
assert_success
|
||||
}
|
||||
|
||||
@@ -107,6 +107,19 @@ deploy_app() {
|
||||
git push target master || destroy_app
|
||||
}
|
||||
|
||||
setup_client_repo() {
|
||||
TMP=$(mktemp -d -t "$TARGET.XXXXX")
|
||||
rmdir $TMP && cp -r ./tests/apps/nodejs-express $TMP
|
||||
cd $TMP
|
||||
git init
|
||||
git config user.email "robot@example.com"
|
||||
git config user.name "Test Robot"
|
||||
|
||||
[[ -f gitignore ]] && mv gitignore .gitignore
|
||||
git add .
|
||||
git commit -m 'initial commit'
|
||||
}
|
||||
|
||||
setup_test_tls() {
|
||||
TLS="/home/dokku/$TEST_APP/tls"
|
||||
mkdir -p $TLS
|
||||
|
||||
Reference in New Issue
Block a user