Skip to content

Commit

Permalink
Merge pull request #15653 from barrettj12/teardown-logs
Browse files Browse the repository at this point in the history
#15653

When run in verbose mode (`-v` flag), the Bash testing harness will now print controller teardown logs to stdout. Do this using the built-in `OUTPUT` utility function.

We are having intermittent teardown failures in many tests. This should help us diagnose the issue(s).

## QA steps

Run a test suite but skip all tests, so we can just check bootstrap and teardown.

In verbose mode, controller teardown logs are emitted:
```console
$ ./main.sh -v -s test_charmrevisionupdater agents
...
====> Destroying juju (ctrl-0ltmoxoh)

 | Destroying controller
 | Waiting for hosted model resources to be reclaimed
 | Waiting for 1 model
 | All hosted models reclaimed, cleaning up controller machines

====> Destroyed juju (ctrl-0ltmoxoh)
...
```

In non-verbose mode, they are hidden, as before.
```console
$ ./main.sh -s test_charmrevisionupdater agents
...
====> Destroying juju (ctrl-ih74p7fe)
====> Destroyed juju (ctrl-ih74p7fe)
...
```
  • Loading branch information
jujubot committed May 25, 2023
2 parents 4436840 + 870f6c7 commit ee886dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/includes/juju.sh
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,9 @@ destroy_controller() {

echo "====> Destroying juju ($(green "${name}"))"
if [[ ${KILL_CONTROLLER:-} != "true" ]]; then
echo "${name}" | xargs -I % juju destroy-controller --destroy-all-models -y % >"${output}" 2>&1
echo "${name}" | xargs -I % juju destroy-controller --destroy-all-models -y % 2>&1 | OUTPUT "${output}"
else
echo "${name}" | xargs -I % juju kill-controller -t 0 -y % >"${output}" 2>&1
echo "${name}" | xargs -I % juju kill-controller -t 0 -y % 2>&1 | OUTPUT "${output}"
fi

set +e
Expand Down

0 comments on commit ee886dd

Please sign in to comment.