-
Notifications
You must be signed in to change notification settings - Fork 494
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
[JUJU-1195]rewrite to bash based nw clouds display test #14455
[JUJU-1195]rewrite to bash based nw clouds display test #14455
Conversation
131d584
to
d148257
Compare
QA steps passed successfully: https://pastebin.ubuntu.com/p/jKHXYNj7dd/ There are some comments to code. |
@@ -45,6 +45,107 @@ EOF | |||
fi | |||
} | |||
|
|||
# Assess how clouds behaves when only expected clouds are defined. | |||
run_assess_clouds() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to rename: run_clouds
tests/suites/cli/display_clouds.sh
Outdated
@@ -45,6 +45,107 @@ EOF | |||
fi | |||
} | |||
|
|||
# Assess how clouds behaves when only expected clouds are defined. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change according to renaming
tests/suites/cli/display_clouds.sh
Outdated
} | ||
|
||
# Assess how show-cloud behaves | ||
run_assess_show_cloud() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to rename: "run_show_cloud"
echo | ||
|
||
mkdir -p "${TEST_DIR}/juju" | ||
echo "" >>"${TEST_DIR}/juju/public-clouds.yaml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we need to create a subfolder juju
. Other tests writes directly to TEST_DIR
#Remove the attributes added by display. i.e 'defined' attribute whose value is not "built-in". | ||
CLOUD_LIST=$(JUJU_DATA="${TEST_DIR}/juju" juju clouds --client --format=json 2>/dev/null | jq 'with_entries(select(.value.defined != "built-in"))') | ||
EXPECTED={} | ||
if [ "${CLOUD_LIST}" != "${EXPECTED}" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for this purpose we use check
, check_contains
or diff (see /includes/check.sh
).
tests/suites/cli/display_clouds.sh
Outdated
mkdir -p "${TEST_DIR}/juju" | ||
echo "" >>"${TEST_DIR}/juju/public-clouds.yaml" | ||
echo "" >>"${TEST_DIR}/juju/credentials.yaml" | ||
mkdir -p "${TEST_DIR}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that we do not need to mkdir
, look to other tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cleaned up.
tests/suites/cli/display_clouds.sh
Outdated
exit 1 | ||
fi | ||
OUT=$(JUJU_DATA="${TEST_DIR}" juju clouds --all --format=json 2>/dev/null | jq '.[] | select(.defined != "built-in")') | ||
check_ge "${OUT}" "${EXPECTED}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like better to you check_contains
or diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg2m
61f8035
to
cea93dc
Compare
cea93dc
to
b4acd28
Compare
/merge |
1 similar comment
/merge |
#14488 ``` Merge branch '2.9' into develop # Conflicts: # .github/workflows/smoke.yml # apiserver/common/tools_test.go # apiserver/facades/client/application/application_unit_test.go # apiserver/facades/client/application/mock_test.go # apiserver/facades/client/application/package_test.go # apiserver/facades/client/cloud/cloudV2_test.go # apiserver/facades/client/cloud/cloud_test.go # caas/kubernetes/provider/application/application.go # cmd/juju/commands/upgradecontroller_test.go # cmd/juju/commands/upgrademodel.go # cmd/juju/commands/upgrademodel_test.go # cmd/juju/controller/kill.go # go.mod # go.sum # scripts/win-installer/setup.iss # snap/snapcraft.yaml # tests/suites/deploy/bundles/lxd-profile-bundle.yaml # tests/suites/deploy/bundles/telegraf_bundle.yaml # tests/suites/deploy/bundles/trusted_bundle.yaml # tests/suites/deploy/deploy_charms.sh # tests/suites/network/network_health.sh # tests/suites/ovs_maas/ovs_netplan_config.sh # tests/suites/spaces_ec2/juju_bind.sh # tests/suites/spaces_ec2/upgrade_charm_with_bind.sh # tests/suites/upgrade/streams.sh # upgrades/operations.go # upgrades/upgrade_test.go # version/version.go ``` Includes PRs: - #14424 - #14428 - #14430 - #14431 - #14427 - #14433 - #14434 - #14437 - #14439 - #14440 - #14442 - #14445 - #14446 - #14444 - #14448 - #14453 - #14436 - #14459 - #14462 - #14458 - #14418 - #14419 - #14463 - #14464 - #14455 - #14449 - #14465 - #14470 - #14473 - #14476 - #14468 - #14383 - #14483
…isplay_python_test #14506 This PR removes the old [cloud_display](https://github.com/juju/juju/blob/2.9/acceptancetests/assess_cloud_display.py) python tests which are now replaced by the new bash based counterpart [here](#14455) ## Checklist - [x] Code style: imports ordered, good names, simple structure, etc - [x] Comments saying why design decisions were made - ~[ ] Go unit tests, with comments saying what you're testing~ - [x] [Integration tests](https://github.com/juju/juju/tree/develop/tests), with comments saying what you're testing - ~[ ] [doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~ ## QA steps Not needed.
This is part of the effort to migrate python based tests to bash based tests for ease of maintenance and simplicity.
Checklist
[ ] Go unit tests, with comments saying what you're testing[ ] doc.go added or updated in changed packagesQA steps