Skip to content

Commit

Permalink
make test less error prone on log changes
Browse files Browse the repository at this point in the history
  • Loading branch information
nam committed Nov 8, 2019
1 parent b3c6f14 commit 86a9813
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/suites/cli/use_local_charm.sh
Expand Up @@ -21,7 +21,7 @@ run_deploy_local_charm_revision() {
# If a error happens it means it could not use the git sha of the CWD
check_not_contains "${OUTPUT}" "exit status 128"

if [ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]; then
if [[ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]]; then
echo "The expected sha does not equal the ntp SHA"
exit 1
fi
Expand Down Expand Up @@ -72,9 +72,7 @@ run_deploy_local_charm_revision_no_vcs_but_version_file() {
wait_for "ntp" ".applications | keys[0]"
CURRENT_CHARM_SHA=$(juju status --format=json | jq '.applications.ntp."charm-version"')

check_contains "${DEPLOY_OUTPUT}" "charm is not in version control and uses a version file"

if [ "${VERSION_OUTPUT}" != "${CURRENT_CHARM_SHA}" ]; then
if [[ "${VERSION_OUTPUT}" != "${CURRENT_CHARM_SHA}" ]]; then
echo "The expected sha does not equal the ntp SHA. Current sha: ${CURRENT_CHARM_SHA} expected sha: ${VERSION_OUTPUT}"
exit 1
fi
Expand Down Expand Up @@ -107,12 +105,12 @@ run_deploy_local_charm_revision_relative_path() {
# We still expect the SHA to be the one from the place we deploy and not the CWD, which in this case has no SHA
CURRENT_CHARM_SHA=$(juju status --format=json | jq '.applications.ntp."charm-version"')

if [ "${SHA_OF_TMP}" = "${CURRENT_CHARM_SHA}" ]; then
if [[ "${SHA_OF_TMP}" = "${CURRENT_CHARM_SHA}" ]]; then
echo "The expected sha should not equal the tmp SHA. Current sha: ${CURRENT_CHARM_SHA}"
exit 1
fi

if [ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]; then
if [[ "${SHA_OF_NTP}" != "${CURRENT_CHARM_SHA}" ]]; then
echo "The expected sha does not equal the ntp SHA. Current sha: ${CURRENT_CHARM_SHA} expected sha: ${SHA_OF_NTP}"
exit 1
fi
Expand Down Expand Up @@ -146,7 +144,7 @@ run_deploy_local_charm_revision_invalid_git() {
wait_for "ntp" ".applications | keys[0]"
# We still expect the SHA to be the one from the place we deploy and not the CWD, which in this case has no SHA
CURRENT_CHARM_SHA=$(juju status --format=json | jq '.applications.ntp."charm-version"')
if [ "${WANTED_CHARM_SHA}" != "${CURRENT_CHARM_SHA}" ]; then
if [[ "${WANTED_CHARM_SHA}" != "${CURRENT_CHARM_SHA}" ]]; then
echo "The expected sha does not equal the ntp SHA. Current sha: ${CURRENT_CHARM_SHA} expected sha: ${WANTED_CHARM_SHA}"
exit 1
fi
Expand Down

0 comments on commit 86a9813

Please sign in to comment.