diff --git a/Makefile b/Makefile index ed84e3a..c50103a 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,10 @@ unittests: test: lint functional functional: build - @JUJU_REPOSITORY=$(JUJU_REPOSITORY) tox -e functional + @JUJU_REPOSITORY=$(JUJU_REPOSITORY) tox -e func + +functional31: build + @JUJU_REPOSITORY=$(JUJU_REPOSITORY) tox -e func31 build: @echo "Building charm to base directory $(JUJU_REPOSITORY)" @@ -40,5 +43,5 @@ clean: @$(RM) $(JUJU_REPOSITORY)/$(CHARM_NAME).charm # The targets below don't depend on a file -.PHONY: lint test functional build release clean help +.PHONY: lint test functional functional31 build release clean help diff --git a/test-requirements.txt b/tests/functional/requirements.txt similarity index 55% rename from test-requirements.txt rename to tests/functional/requirements.txt index 8ea7c1c..845ceb1 100644 --- a/test-requirements.txt +++ b/tests/functional/requirements.txt @@ -1,4 +1 @@ -# zaza -git+https://github.com/openstack-charmers/zaza.git#egg=zaza git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack - diff --git a/tests/__init__.py b/tests/functional/tests/__init__.py similarity index 100% rename from tests/__init__.py rename to tests/functional/tests/__init__.py diff --git a/tests/bundles/base.yaml b/tests/functional/tests/bundles/base.yaml similarity index 100% rename from tests/bundles/base.yaml rename to tests/functional/tests/bundles/base.yaml diff --git a/tests/bundles/bionic.yaml b/tests/functional/tests/bundles/bionic.yaml similarity index 100% rename from tests/bundles/bionic.yaml rename to tests/functional/tests/bundles/bionic.yaml diff --git a/tests/bundles/focal-juju3.yaml b/tests/functional/tests/bundles/focal-juju3.yaml similarity index 100% rename from tests/bundles/focal-juju3.yaml rename to tests/functional/tests/bundles/focal-juju3.yaml diff --git a/tests/bundles/focal.yaml b/tests/functional/tests/bundles/focal.yaml similarity index 100% rename from tests/bundles/focal.yaml rename to tests/functional/tests/bundles/focal.yaml diff --git a/tests/bundles/jammy-juju3.yaml b/tests/functional/tests/bundles/jammy-juju3.yaml similarity index 100% rename from tests/bundles/jammy-juju3.yaml rename to tests/functional/tests/bundles/jammy-juju3.yaml diff --git a/tests/bundles/jammy.yaml b/tests/functional/tests/bundles/jammy.yaml similarity index 100% rename from tests/bundles/jammy.yaml rename to tests/functional/tests/bundles/jammy.yaml diff --git a/tests/bundles/overlays/bionic.yaml.j2 b/tests/functional/tests/bundles/overlays/bionic.yaml.j2 similarity index 100% rename from tests/bundles/overlays/bionic.yaml.j2 rename to tests/functional/tests/bundles/overlays/bionic.yaml.j2 diff --git a/tests/bundles/overlays/focal-juju3.yaml.j2 b/tests/functional/tests/bundles/overlays/focal-juju3.yaml.j2 similarity index 100% rename from tests/bundles/overlays/focal-juju3.yaml.j2 rename to tests/functional/tests/bundles/overlays/focal-juju3.yaml.j2 diff --git a/tests/bundles/overlays/focal.yaml.j2 b/tests/functional/tests/bundles/overlays/focal.yaml.j2 similarity index 100% rename from tests/bundles/overlays/focal.yaml.j2 rename to tests/functional/tests/bundles/overlays/focal.yaml.j2 diff --git a/tests/bundles/overlays/jammy-juju3.yaml.j2 b/tests/functional/tests/bundles/overlays/jammy-juju3.yaml.j2 similarity index 100% rename from tests/bundles/overlays/jammy-juju3.yaml.j2 rename to tests/functional/tests/bundles/overlays/jammy-juju3.yaml.j2 diff --git a/tests/bundles/overlays/jammy.yaml.j2 b/tests/functional/tests/bundles/overlays/jammy.yaml.j2 similarity index 100% rename from tests/bundles/overlays/jammy.yaml.j2 rename to tests/functional/tests/bundles/overlays/jammy.yaml.j2 diff --git a/tests/bundles/overlays/local-charm-overlay.yaml.j2 b/tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 similarity index 100% rename from tests/bundles/overlays/local-charm-overlay.yaml.j2 rename to tests/functional/tests/bundles/overlays/local-charm-overlay.yaml.j2 diff --git a/tests/tests.yaml b/tests/functional/tests/tests.yaml similarity index 100% rename from tests/tests.yaml rename to tests/functional/tests/tests.yaml diff --git a/tests/tests_juju_local.py b/tests/functional/tests/tests_juju_local.py similarity index 100% rename from tests/tests_juju_local.py rename to tests/functional/tests/tests_juju_local.py diff --git a/tox.ini b/tox.ini index 73bddd1..03605df 100644 --- a/tox.ini +++ b/tox.ini @@ -5,17 +5,27 @@ skip_missing_interpreters = True [testenv] basepython = python3 -setenv = - PYTHONPATH = . - -[testenv:functional] -commands = - functest-run-suite --keep-faulty-model -deps = -r{toxinidir}/test-requirements.txt passenv = HOME - JUJU_REPOSITORY OS_* + JUJU_REPOSITORY + +setenv = + PYTHONPATH = . + +[testenv:func] +changedir = {toxinidir}/tests/functional +deps = + -r {toxinidir}/tests/functional/requirements.txt + git+https://github.com/openstack-charmers/zaza.git#egg=zaza +commands = functest-run-suite --keep-faulty-model {posargs} + +[testenv:func31] +changedir = {toxinidir}/tests/functional +deps = + -r {toxinidir}/tests/functional/requirements.txt + git+https://github.com/esunar/zaza.git@fix-normalise_action_results#egg=zaza[juju-31] +commands = functest-run-suite --keep-faulty-model {posargs} [testenv:func-smoke] commands =