Fix a broken auth token test and support conditional tests for "versioned" releases. (#1195)

pull/1200/head
Jim 5 years ago committed by GitHub
parent f493fd3252
commit c7bac26e1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,7 +32,11 @@ export BOUNDARY_ADDR=<your_install>
2. Run the tests
```bash
# for an untagged non-version of boundary
bats -p boundary/
# for an official boundary version
IS_VERSION=true bats -p boundary/
```
## Running Tests Against Other Deployments

@ -3,7 +3,7 @@ function read_token() {
then
echo "y" | boundary auth-tokens read
else
boundary auth-tokens read -id $1
boundary auth-tokens read -id $1 -format json
fi
}

@ -3,6 +3,9 @@ function version() {
}
function version_is_valid() {
if [ "$IS_VERSION" = "" ]; then
skip "not a version build"
fi
ver=$($(strip version) | jq -c '.version' | cut -d 'v' -f2)
if [ "$ver" == "null" ]; then
return 1
@ -12,7 +15,7 @@ function version_is_valid() {
function revision_is_valid() {
len=$($(strip version) | jq -c '.revision' | cut -d '+' -f1 | wc -m)
if [ "$len" -eq 42 ]; then
if [ "$len" -eq 43 ]; then
return 0
fi
return 1

@ -16,3 +16,10 @@ export NEW_USER='test'
echo "$output"
[ "$status" -eq 0 ]
}
@test "boundary/version: revision output is valid" {
run revision_is_valid
echo "$output"
[ "$status" -eq 0 ]
}

Loading…
Cancel
Save