Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the smoke tests #11844

Merged
merged 4 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 16 additions & 2 deletions tests/includes/juju.sh
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,22 @@ juju_bootstrap() {
# When double quotes are added to ${series}, the juju bootstrap
# command looks correct, and works outside of the harness, but
# does not run, goes directly to cleanup.
#shellcheck disable=SC2086
juju bootstrap ${series} --debug="${debug}" --build-agent=${BUILD_AGENT} "${provider}" "${name}" -d "${model}" "$@" > "${output}" 2>&1
set_test_verbosity
case "${VERBOSE}" in
1)
#shellcheck disable=SC2086
juju bootstrap ${series} --debug="${debug}" --build-agent=${BUILD_AGENT} "${provider}" "${name}" -d "${model}" "$@" > "${output}" 2>&1
;;
2)
#shellcheck disable=SC2086
juju bootstrap ${series} --debug="${debug}" --build-agent=${BUILD_AGENT} "${provider}" "${name}" -d "${model}" "$@" 2>&1 | tee "${output}"
;;
3)
#shellcheck disable=SC2086
juju bootstrap ${series} --debug="${debug}" --build-agent=${BUILD_AGENT} "${provider}" "${name}" -d "${model}" "$@" > "${output}" 2>&1
SimonRichardson marked this conversation as resolved.
Show resolved Hide resolved
;;
esac
set_verbosity
else
#shellcheck disable=SC2086
juju bootstrap ${series} --debug="${debug}" --build-agent=${BUILD_AGENT} "${provider}" "${name}" -d "${model}" "$@"
Expand Down
7 changes: 5 additions & 2 deletions tests/includes/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ run() {

START_TIME=$(date +%s)
set_test_verbosity
$CMD "$@" > "${TEST_DIR}/${TEST_CURRENT}.log" 2>&1
case "${VERBOSE}" in
1)
$CMD "$@" > "${TEST_DIR}/${TEST_CURRENT}.log" 2>&1
;;
2)
$CMD "$@" 2>&1 | tee "${TEST_DIR}/${TEST_CURRENT}.log"
cat "${TEST_DIR}/${TEST_CURRENT}.log"
;;
3)
cat "${TEST_DIR}/${TEST_CURRENT}.log"
$CMD "$@" > "${TEST_DIR}/${TEST_CURRENT}.log" 2>&1
SimonRichardson marked this conversation as resolved.
Show resolved Hide resolved
;;
esac
set_verbosity
Expand Down
8 changes: 1 addition & 7 deletions tests/suites/smoke/build.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
run_build() {
OUT=$(make go-build 2>&1 || true)
if [ -n "${OUT}" ]; then
echo ""
echo "$(red 'Found some issues:')"
echo "\\n${OUT}"
exit 1
fi
make go-build 2>&1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than be fancy, just let it fail!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you still want to be fancy:

OUT=$(make go-build 2>&1 || echo "BUILD FAILED")
if [ "$OUT" =~ (BUILD FAILED) ]; then
  ....
fi

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll think about it

}

test_build() {
Expand Down
3 changes: 2 additions & 1 deletion tests/suites/smoke/task.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ test_smoke() {

file="${TEST_DIR}/test-smoke.log"

test_build

bootstrap "test-smoke" "${file}"

test_build
test_deploy "${file}"

destroy_controller "test-smoke"
Expand Down