-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #926 from posit-dev/kg-redux-deploy-all
Add CLI Deploy Tests
- Loading branch information
Showing
6 changed files
with
87 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bats | ||
|
||
load '../node_modules/bats-support/load' | ||
load '../node_modules/bats-assert/load' | ||
|
||
# list-accounts should return the account from env | ||
@test "list accounts" { | ||
run ${EXE} list-accounts | ||
assert_success | ||
assert_output --partial "Nickname: \"env\"" | ||
assert_output --partial "Configured via: CONNECT_SERVER environment variable" | ||
assert_output --partial "Authentication: Connect API key" | ||
} | ||
|
||
# test-account should pass with env | ||
@test "test accounts" { | ||
run ${EXE} test-account env | ||
assert_success | ||
assert_output --partial "Name: Administrator Smith" | ||
assert_output --partial "Username: admin" | ||
assert_output --partial "Email: [email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,28 +2,13 @@ | |
|
||
load '../node_modules/bats-support/load' | ||
load '../node_modules/bats-assert/load' | ||
|
||
# list-accounts should return the account from env | ||
@test "list accounts" { | ||
run ${EXE} list-accounts | ||
assert_success | ||
assert_output --partial "Nickname: \"env\"" | ||
assert_output --partial "Configured via: CONNECT_SERVER environment variable" | ||
assert_output --partial "Authentication: Connect API key" | ||
} | ||
|
||
# test-account should pass with env | ||
@test "test accounts" { | ||
run ${EXE} test-account env | ||
assert_success | ||
assert_output --partial "Name: Administrator Smith" | ||
assert_output --partial "Username: admin" | ||
assert_output --partial "Email: [email protected]" | ||
} | ||
source ../content/bundles/${CONTENT}/test/.publisher-env | ||
CONTENT_PATH='../content/bundles/' | ||
|
||
# deploy content with the env account | ||
@test "deploy content" { | ||
run ${EXE} deploy ../sample-content/fastapi-simple/ -n ci_deploy | ||
@test "deploy ${CONTENT}" { | ||
|
||
run ${EXE} deploy ${CONTENT_PATH}/${CONTENT} -n ci_deploy | ||
assert_success | ||
assert_output --partial "Test Deployment... [OK]" | ||
# now test the deployment via api | ||
|
@@ -33,12 +18,13 @@ load '../node_modules/bats-assert/load' | |
run curl --silent --show-error -L --max-redirs 0 --fail \ | ||
-X GET \ | ||
-H "Authorization: Key ${CONNECT_API_KEY}" "${CONNECT_SERVER}/__api__/v1/content/${GUID}" | ||
assert_output --partial "\"app_mode\":\"python-fastapi\"" | ||
assert_output --partial "\"app_mode\":\"${CONTENT_TYPE}\"" | ||
} | ||
|
||
# redeploy content from previous test | ||
@test "redeploy content" { | ||
run ${EXE} redeploy ci_deploy ../sample-content/fastapi-simple/ | ||
@test "redeploy ${CONTENT}" { | ||
|
||
run ${EXE} redeploy ci_deploy ${CONTENT_PATH}${CONTENT} | ||
assert_success | ||
assert_output --partial "Test Deployment... [OK]" | ||
# now test the deployment via api | ||
|
@@ -48,6 +34,7 @@ load '../node_modules/bats-assert/load' | |
run curl --silent --show-error -L --max-redirs 0 --fail \ | ||
-X GET \ | ||
-H "Authorization: Key ${CONNECT_API_KEY}" "${CONNECT_SERVER}/__api__/v1/content/${GUID}" | ||
assert_output --partial "\"app_mode\":\"python-fastapi\"" | ||
assert_output --partial "\"app_mode\":\"${CONTENT_TYPE}\"" | ||
# cleanup | ||
run rm -rf ${CONTENT_PATH}${CONTENT}/.posit/ ${CONTENT_PATH}${CONTENT}/.positignore | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters