Skip to content

Commit

Permalink
Merge pull request #15163 from anvial/JUJU-2713-fix-test-refresh-suit…
Browse files Browse the repository at this point in the history
…e-3-0

#15163

This PR fixes `juju refresh` output check and revision check. The problem was in the additional WARNING that was introduced in 3.0 (in the `refresh` command). Now test checks are WARNING-agnostic :)

## Checklist

- [x] Code style: imports ordered, good names, simple structure, etc
- [x] Comments saying why design decisions were made

## QA steps

```sh
cd tests; ./main.sh -p lxd refresh
```
  • Loading branch information
jujubot committed Feb 8, 2023
2 parents ab70c57 + e6aafd7 commit 9e02bc1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/suites/refresh/refresh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ run_refresh_cs() {
wait_for "ubuntu" "$(idle_condition "ubuntu")"

OUT=$(juju refresh ubuntu 2>&1 || true)
if echo "${OUT}" | grep -E -vq "Added"; then
if echo "${OUT}" | grep -E -q "Added"; then
echo "refresh passed successfully"
else
# shellcheck disable=SC2046
echo $(red "failed refreshing charm: ${OUT}")
exit 5
Expand All @@ -20,7 +22,7 @@ run_refresh_cs() {
printf "${OUT}\n"

# Added charm-store charm "ubuntu", revision 21 in channel stable, to the model
revision=$(echo "${OUT}" | awk 'BEGIN{FS=","} {print $2}' | awk 'BEGIN{FS=" "} {print $2}')
revision=$(echo "${OUT}" | tail -n 1 | awk 'BEGIN{FS=","} {print $2}' | awk 'BEGIN{FS=" "} {print $2}')

wait_for "ubuntu" "$(charm_rev "ubuntu" "${revision}")"
wait_for "ubuntu" "$(idle_condition "ubuntu")"
Expand Down

0 comments on commit 9e02bc1

Please sign in to comment.