Convert percona-cluster to Zaza

Convert amulet tests to zaza.
Add additional tests for new cold boot actions.
Use multi-model tests.yaml for different tests for bionic and xenial.

Change-Id: I5dadefa6092acecdaae194370a81b05a69b09909
This commit is contained in:
David Ames
2019-07-12 16:20:43 -07:00
parent b8c2213dfb
commit 257c58f373
14 changed files with 116 additions and 57 deletions

View File

@@ -27,3 +27,6 @@ git+https://github.com/juju/charm-helpers.git#egg=charmhelpers
# NOTE: workaround for 14.04 pip/tox
pytz
pyudev # for ceph-* charm unit tests (not mocked?)
git+https://github.com/openstack-charmers/zaza.git#egg=zaza;python_version>='3.0'
git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack

View File

@@ -0,0 +1 @@
bionic.yaml

14
tests/bundles/bionic.yaml Normal file
View File

@@ -0,0 +1,14 @@
series: bionic
relations:
- - keystone:shared-db
- percona-cluster:shared-db
applications:
percona-cluster:
series: bionic
charm: ../../../percona-cluster
num_units: 1
keystone:
charm: cs:~openstack-charmers-next/keystone
num_units: 1
options:
token-expiration: 60

1
tests/bundles/disco-ha.yaml Symbolic link
View File

@@ -0,0 +1 @@
disco.yaml

14
tests/bundles/disco.yaml Normal file
View File

@@ -0,0 +1,14 @@
series: disco
relations:
- - keystone:shared-db
- percona-cluster:shared-db
applications:
percona-cluster:
series: disco
charm: ../../../percona-cluster
num_units: 1
keystone:
charm: cs:~openstack-charmers-next/keystone
num_units: 1
options:
token-expiration: 60

View File

@@ -0,0 +1 @@
ha.yaml

View File

@@ -0,0 +1 @@
ha.yaml

View File

@@ -0,0 +1,14 @@
relations:
- - percona-cluster
- hacluster
applications:
percona-cluster:
num_units: 3
options:
min-cluster-size: 3
hacluster:
charm: cs:~openstack-charmers-next/hacluster
num_units: 0
options:
cluster_count: 3

View File

@@ -0,0 +1,21 @@
#applications:
# percona-cluster:
# options:
# vip: {{ OS_VIP00 }}
relations:
- - percona-cluster
- hacluster
applications:
percona-cluster:
num_units: 3
options:
vip: {{ OS_VIP00 }}
min-cluster-size: 3
hacluster:
charm: cs:~openstack-charmers-next/hacluster
num_units: 0
options:
cluster_count: 3

View File

@@ -0,0 +1 @@
ha.yaml

View File

@@ -0,0 +1 @@
xenial.yaml

14
tests/bundles/xenial.yaml Normal file
View File

@@ -0,0 +1,14 @@
series: xenial
relations:
- - keystone:shared-db
- percona-cluster:shared-db
applications:
percona-cluster:
series: xenial
charm: ../../../percona-cluster
num_units: 1
keystone:
charm: cs:~openstack-charmers-next/keystone
num_units: 1
options:
token-expiration: 60

View File

@@ -1,18 +1,20 @@
# Bootstrap the model if necessary.
bootstrap: True
# Re-use bootstrap node.
reset: True
# Use tox/requirements to drive the venv instead of bundletester's venv feature.
virtualenv: False
# Leave makefile empty, otherwise unit/lint tests will rerun ahead of amulet.
makefile: []
# Do not specify juju PPA sources. Juju is presumed to be pre-installed
# and configured in all test runner environments.
#sources:
# Do not specify or rely on system packages.
#packages:
# Do not specify python packages here. Use test-requirements.txt
# and tox instead. ie. The venv is constructed before bundletester
# is invoked.
#python-packages:
reset_timeout: 600
charm_name: "percona-cluster"
tests:
- bionic_model:
- zaza.openstack.charm_tests.mysql.tests.PerconaClusterColdStartTest
- zaza.openstack.charm_tests.mysql.tests.PerconaClusterCharmTests
- zaza.openstack.charm_tests.mysql.tests.PerconaClusterScaleTests
- xenial_model:
- zaza.openstack.charm_tests.mysql.tests.PerconaClusterCharmTests
- zaza.openstack.charm_tests.mysql.tests.PerconaClusterScaleTests
configure:
- zaza.model.block_until_all_units_idle
target_deploy_status:
gate_bundles:
- bionic_model: bionic-ha
- xenial_model: xenial-ha
# Disco disabled until hacluster issues are resolved.
# - disco-ha
smoke_bundles:
- bionic_model: bionic-ha
dev_bundles:

49
tox.ini
View File

@@ -14,7 +14,7 @@ install_command =
pip install {opts} {packages}
commands = stestr run {posargs}
whitelist_externals = juju
passenv = HOME TERM AMULET_* CS_API_*
passenv = HOME TERM AMULET_* CS_API_* OS_*
deps = -r{toxinidir}/test-requirements.txt
[testenv:py35]
@@ -71,49 +71,20 @@ omit =
basepython = python3
commands = {posargs}
[testenv:func27-noop]
# DRY RUN - For Debug
basepython = python2.7
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:func]
basepython = python3
commands =
bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy
functest-run-suite --keep-model
[testenv:func27]
# Charm Functional Test
# Run all gate tests which are +x (expected to always pass)
basepython = python2.7
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:func-smoke]
basepython = python3
commands =
bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" --no-destroy
functest-run-suite --keep-model --smoke
[testenv:func27-smoke]
# Charm Functional Test
# Run a specific test as an Amulet smoke test (expected to always pass)
basepython = python2.7
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:func-dev]
basepython = python3
commands =
bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic --no-destroy
[testenv:func27-dfs]
# Charm Functional Test
# Run all deploy-from-source tests which are +x (may not always pass!)
basepython = python2.7
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dfs-*" --no-destroy
[testenv:func27-dev]
# Charm Functional Test
# Run all development test targets which are +x (may not always pass!)
basepython = python2.7
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy
functest-run-suite --keep-model --dev
[flake8]
ignore = E402,E226