From 4e52f9f81d8938b0d4357546b77f132637fd3562 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Tue, 17 May 2022 19:12:54 +0100 Subject: [PATCH] Migrate charm charmhub for stable/wallaby - start from stable/wallaby branch - Do charmcraft, osci, zuul changes - Modify libs to point to stable/wallaby for: - charmhelpers - charms.openstack (as needed) - zaza & zaza.openstack.tests - Remove unsupported test bundles - migration bundles to charmhub.io (ch: prefix + channels) - Build on 20.04 amd64 - Run on 20.04 amd64, s390x, ppc64el, arm64 Change-Id: Ib8d0ffa7df07a75c9258794c18e80c785912cae7 --- .gitignore | 1 + .gitreview | 2 +- .zuul.yaml | 2 +- build-requirements.txt | 7 +++ charmcraft.yaml | 30 +++++++++++ metadata.yaml | 1 + osci.yaml | 22 ++------ rename.sh | 13 +++++ requirements.txt | 1 + src/build.lock | 12 ++--- src/metadata.yaml | 4 -- src/test-requirements.txt | 8 ++- src/tests/bundles/bionic-rocky.yaml | 50 ----------------- src/tests/bundles/bionic-stein.yaml | 50 ----------------- src/tests/bundles/bionic-train.yaml | 50 ----------------- src/tests/bundles/bionic-ussuri.yaml | 50 ----------------- src/tests/bundles/focal-ussuri.yaml | 74 -------------------------- src/tests/bundles/focal-victoria.yaml | 19 ++++--- src/tests/bundles/focal-wallaby.yaml | 19 ++++--- src/tests/bundles/focal-xena.yaml | 74 -------------------------- src/tests/bundles/groovy-victoria.yaml | 74 -------------------------- src/tests/bundles/hirsute-wallaby.yaml | 74 -------------------------- src/tests/bundles/impish-xena.yaml | 74 -------------------------- src/tests/tests.yaml | 21 ++------ src/wheelhouse.txt | 4 +- test-requirements.txt | 3 +- tox.ini | 45 ++++++++++++---- 27 files changed, 137 insertions(+), 647 deletions(-) create mode 100644 build-requirements.txt create mode 100644 charmcraft.yaml create mode 120000 metadata.yaml create mode 100755 rename.sh delete mode 100644 src/tests/bundles/bionic-rocky.yaml delete mode 100644 src/tests/bundles/bionic-stein.yaml delete mode 100644 src/tests/bundles/bionic-train.yaml delete mode 100644 src/tests/bundles/bionic-ussuri.yaml delete mode 100644 src/tests/bundles/focal-ussuri.yaml delete mode 100644 src/tests/bundles/focal-xena.yaml delete mode 100644 src/tests/bundles/groovy-victoria.yaml delete mode 100644 src/tests/bundles/hirsute-wallaby.yaml delete mode 100644 src/tests/bundles/impish-xena.yaml diff --git a/.gitignore b/.gitignore index 98c9c5a..b620cbb 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ trusty .testrepository __pycache__ .stestr +*.charm diff --git a/.gitreview b/.gitreview index d1bbb56..7e6060c 100644 --- a/.gitreview +++ b/.gitreview @@ -3,4 +3,4 @@ host=review.opendev.org port=29418 project=openstack/charm-barbican.git -defaultbranch=stable/21.10 +defaultbranch=stable/wallaby diff --git a/.zuul.yaml b/.zuul.yaml index fd20909..8cd637f 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,4 +1,4 @@ - project: templates: - - openstack-python3-charm-jobs + - openstack-python3-wallaby-jobs - openstack-cover-jobs diff --git a/build-requirements.txt b/build-requirements.txt new file mode 100644 index 0000000..b6d2452 --- /dev/null +++ b/build-requirements.txt @@ -0,0 +1,7 @@ +# NOTES(lourot): +# * We don't install charmcraft via pip anymore because it anyway spins up a +# container and scp the system's charmcraft snap inside it. So the charmcraft +# snap is necessary on the system anyway. +# * `tox -e build` successfully validated with charmcraft 1.2.1 + +cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. diff --git a/charmcraft.yaml b/charmcraft.yaml new file mode 100644 index 0000000..dc055bd --- /dev/null +++ b/charmcraft.yaml @@ -0,0 +1,30 @@ +type: charm + +parts: + charm: + build-packages: + - tox + - git + - python3-dev + override-build: | + apt-get install ca-certificates -y + tox -e build-reactive + override-stage: | + echo "Copying charm to staging area: $CHARMCRAFT_STAGE" + NAME=$(ls $CHARMCRAFT_PART_BUILD/build/builds) + cp -r $CHARMCRAFT_PART_BUILD/build/builds/$NAME/* $CHARMCRAFT_STAGE/ + override-prime: | + # For some reason, the normal priming chokes on the fact that there's a + # hooks directory. + cp -r $CHARMCRAFT_STAGE/* . + +bases: + - build-on: + - name: ubuntu + channel: "20.04" + architectures: + - amd64 + run-on: + - name: ubuntu + channel: "20.04" + architectures: [amd64, s390x, ppc64el, arm64] diff --git a/metadata.yaml b/metadata.yaml new file mode 120000 index 0000000..0768683 --- /dev/null +++ b/metadata.yaml @@ -0,0 +1 @@ +src/metadata.yaml \ No newline at end of file diff --git a/osci.yaml b/osci.yaml index 8a73554..53814c2 100644 --- a/osci.yaml +++ b/osci.yaml @@ -1,23 +1,9 @@ - project: templates: - - charm-unit-jobs - # using overridden, shorter functional list because the charm does - # already in the tests.yaml - # - charm-functional-jobs - check: - jobs: - - impish-xena: - voting: false - - hirsute-wallaby - - groovy-victoria - - focal-xena: - voting: false - - focal-wallaby - - focal-victoria - - focal-ussuri - - bionic-ussuri - - bionic-train - - bionic-stein + - charm-unit-jobs-py38 + - charm-victoria-functional-jobs + - charm-wallaby-functional-jobs vars: needs_charm_build: true charm_build_name: barbican + build_type: charmcraft diff --git a/rename.sh b/rename.sh new file mode 100755 index 0000000..d0c35c9 --- /dev/null +++ b/rename.sh @@ -0,0 +1,13 @@ +#!/bin/bash +charm=$(grep "charm_build_name" osci.yaml | awk '{print $2}') +echo "renaming ${charm}_*.charm to ${charm}.charm" +echo -n "pwd: " +pwd +ls -al +echo "Removing bad downloaded charm maybe?" +if [[ -e "${charm}.charm" ]]; +then + rm "${charm}.charm" +fi +echo "Renaming charm here." +mv ${charm}_*.charm ${charm}.charm diff --git a/requirements.txt b/requirements.txt index a68620f..e182e8a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 # Build requirements +pyparsing<3.0.0 # cffi needs pyparsing < 3.0.0. cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. charm-tools==2.8.3 diff --git a/src/build.lock b/src/build.lock index aacfa86..f0a6646 100644 --- a/src/build.lock +++ b/src/build.lock @@ -180,17 +180,11 @@ "vcs": null, "version": "1.1.1" }, - { - "type": "python_module", - "package": "Tempita", - "vcs": null, - "version": "0.4" - }, { "type": "python_module", "package": "charms.openstack", "url": "git+https://github.com/openstack/charms.openstack.git", - "branch": "refs/heads/stable/21.10", + "branch": "stable/wallaby", "version": "10627ee5f991c268f174d6d100e218a0e1867af1", "vcs": "git" }, @@ -210,8 +204,8 @@ "type": "python_module", "package": "charmhelpers", "url": "git+https://github.com/juju/charm-helpers.git", - "branch": "refs/heads/stable/21.10", - "version": "26efcd0da51d580f68ead2ca13c38f58766f8a14", + "branch": "stable/wallaby", + "version": "f8f822d5e908b1ac5694815c2d5522b6533e04f8", "vcs": "git" }, { diff --git a/src/metadata.yaml b/src/metadata.yaml index 4167a2b..7f340ad 100644 --- a/src/metadata.yaml +++ b/src/metadata.yaml @@ -8,11 +8,7 @@ description: | tags: - openstack series: -- bionic - focal -- groovy -- hirsute -- impish subordinate: false requires: shared-db: diff --git a/src/test-requirements.txt b/src/test-requirements.txt index bd0c1a8..e86b74f 100644 --- a/src/test-requirements.txt +++ b/src/test-requirements.txt @@ -5,5 +5,9 @@ # # Functional Test Requirements (let Zaza's dependencies solve all dependencies here!) -git+https://github.com/openstack-charmers/zaza.git@stable/21.10#egg=zaza -git+https://github.com/openstack-charmers/zaza-openstack-tests.git@stable/21.10#egg=zaza.openstack +git+https://github.com/openstack-charmers/zaza.git@stable/wallaby#egg=zaza +git+https://github.com/openstack-charmers/zaza-openstack-tests.git@stable/wallaby#egg=zaza.openstack + +# Need tox to be available from tox... inception yes, but its a workaround for now +tox + diff --git a/src/tests/bundles/bionic-rocky.yaml b/src/tests/bundles/bionic-rocky.yaml deleted file mode 100644 index e99f5e3..0000000 --- a/src/tests/bundles/bionic-rocky.yaml +++ /dev/null @@ -1,50 +0,0 @@ -series: bionic - -machines: - '0': - constraints: mem=3072M - '1': - '2': - '3': - -applications: - - mysql: - charm: cs:~openstack-charmers/percona-cluster - num_units: 1 - to: - - '0' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: cloud:bionic-rocky - to: - - '1' - - barbican: - series: bionic - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: cloud:bionic-rocky - debug: true - to: - - '2' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '3' - -relations: -- - mysql:shared-db - - keystone:shared-db -- - mysql:shared-db - - barbican:shared-db -- - keystone:identity-service - - barbican:identity-service -- - rabbitmq-server:amqp - - barbican:amqp diff --git a/src/tests/bundles/bionic-stein.yaml b/src/tests/bundles/bionic-stein.yaml deleted file mode 100644 index bbac7f4..0000000 --- a/src/tests/bundles/bionic-stein.yaml +++ /dev/null @@ -1,50 +0,0 @@ -series: bionic - -machines: - '0': - constraints: mem=3072M - '1': - '2': - '3': - -applications: - - mysql: - charm: cs:~openstack-charmers/percona-cluster - num_units: 1 - to: - - '0' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: cloud:bionic-stein - to: - - '1' - - barbican: - series: bionic - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: cloud:bionic-stein - debug: true - to: - - '2' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '3' - -relations: -- - mysql:shared-db - - keystone:shared-db -- - mysql:shared-db - - barbican:shared-db -- - keystone:identity-service - - barbican:identity-service -- - rabbitmq-server:amqp - - barbican:amqp diff --git a/src/tests/bundles/bionic-train.yaml b/src/tests/bundles/bionic-train.yaml deleted file mode 100644 index 78b84ee..0000000 --- a/src/tests/bundles/bionic-train.yaml +++ /dev/null @@ -1,50 +0,0 @@ -series: bionic - -machines: - '0': - constraints: mem=3072M - '1': - '2': - '3': - -applications: - - mysql: - charm: cs:~openstack-charmers/percona-cluster - num_units: 1 - to: - - '0' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: cloud:bionic-train - to: - - '1' - - barbican: - series: bionic - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: cloud:bionic-train - debug: true - to: - - '2' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '3' - -relations: -- - mysql:shared-db - - keystone:shared-db -- - mysql:shared-db - - barbican:shared-db -- - keystone:identity-service - - barbican:identity-service -- - rabbitmq-server:amqp - - barbican:amqp diff --git a/src/tests/bundles/bionic-ussuri.yaml b/src/tests/bundles/bionic-ussuri.yaml deleted file mode 100644 index 75a8507..0000000 --- a/src/tests/bundles/bionic-ussuri.yaml +++ /dev/null @@ -1,50 +0,0 @@ -series: bionic - -machines: - '0': - constraints: mem=3072M - '1': - '2': - '3': - -applications: - - mysql: - charm: cs:~openstack-charmers/percona-cluster - num_units: 1 - to: - - '0' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: cloud:bionic-ussuri - to: - - '1' - - barbican: - series: bionic - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: cloud:bionic-ussuri - debug: true - to: - - '2' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '3' - -relations: -- - mysql:shared-db - - keystone:shared-db -- - mysql:shared-db - - barbican:shared-db -- - keystone:identity-service - - barbican:identity-service -- - rabbitmq-server:amqp - - barbican:amqp diff --git a/src/tests/bundles/focal-ussuri.yaml b/src/tests/bundles/focal-ussuri.yaml deleted file mode 100644 index f839902..0000000 --- a/src/tests/bundles/focal-ussuri.yaml +++ /dev/null @@ -1,74 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -series: &series focal - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers/mysql-router - barbican-mysql-router: - charm: cs:~openstack-charmers/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '3' - - barbican: - series: *series - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: *openstack-origin - debug: true - to: - - '4' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '5' - -relations: - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'barbican:shared-db' - - 'barbican-mysql-router:shared-db' - - - 'barbican-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'keystone:identity-service' - - 'barbican:identity-service' - - - - 'rabbitmq-server:amqp' - - 'barbican:amqp' diff --git a/src/tests/bundles/focal-victoria.yaml b/src/tests/bundles/focal-victoria.yaml index e44e3c4..54fc684 100644 --- a/src/tests/bundles/focal-victoria.yaml +++ b/src/tests/bundles/focal-victoria.yaml @@ -1,3 +1,5 @@ +local_overlay_enabled: False + variables: openstack-origin: &openstack-origin cloud:focal-victoria @@ -17,12 +19,14 @@ machines: applications: keystone-mysql-router: - charm: cs:~openstack-charmers/mysql-router + charm: ch:mysql-router + channel: 8.0/edge barbican-mysql-router: - charm: cs:~openstack-charmers/mysql-router + charm: ch:mysql-router + channel: 8.0/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -30,18 +34,20 @@ applications: - '0' - '1' - '2' + channel: 8.0/edge keystone: - charm: cs:~openstack-charmers/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin to: - '3' + channel: wallaby/edge barbican: series: *series - charm: ../../../barbican + charm: ../../../barbican.charm num_units: 1 options: openstack-origin: *openstack-origin @@ -50,10 +56,11 @@ applications: - '4' rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 to: - '5' + channel: 3.8/edge relations: diff --git a/src/tests/bundles/focal-wallaby.yaml b/src/tests/bundles/focal-wallaby.yaml index 4b380fb..d6d2f30 100644 --- a/src/tests/bundles/focal-wallaby.yaml +++ b/src/tests/bundles/focal-wallaby.yaml @@ -1,3 +1,5 @@ +local_overlay_enabled: False + variables: openstack-origin: &openstack-origin cloud:focal-wallaby @@ -17,12 +19,14 @@ machines: applications: keystone-mysql-router: - charm: cs:~openstack-charmers/mysql-router + charm: ch:mysql-router + channel: 8.0/edge barbican-mysql-router: - charm: cs:~openstack-charmers/mysql-router + charm: ch:mysql-router + channel: 8.0/edge mysql-innodb-cluster: - charm: cs:~openstack-charmers/mysql-innodb-cluster + charm: ch:mysql-innodb-cluster num_units: 3 options: source: *openstack-origin @@ -30,18 +34,20 @@ applications: - '0' - '1' - '2' + channel: 8.0/edge keystone: - charm: cs:~openstack-charmers/keystone + charm: ch:keystone num_units: 1 options: openstack-origin: *openstack-origin to: - '3' + channel: wallaby/edge barbican: series: *series - charm: ../../../barbican + charm: ../../../barbican.charm num_units: 1 options: openstack-origin: *openstack-origin @@ -50,10 +56,11 @@ applications: - '4' rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server + charm: ch:rabbitmq-server num_units: 1 to: - '5' + channel: 3.8/edge relations: diff --git a/src/tests/bundles/focal-xena.yaml b/src/tests/bundles/focal-xena.yaml deleted file mode 100644 index 5b3be16..0000000 --- a/src/tests/bundles/focal-xena.yaml +++ /dev/null @@ -1,74 +0,0 @@ -variables: - openstack-origin: &openstack-origin cloud:focal-xena - -series: &series focal - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers/mysql-router - barbican-mysql-router: - charm: cs:~openstack-charmers/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '3' - - barbican: - series: *series - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: *openstack-origin - debug: true - to: - - '4' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '5' - -relations: - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'barbican:shared-db' - - 'barbican-mysql-router:shared-db' - - - 'barbican-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'keystone:identity-service' - - 'barbican:identity-service' - - - - 'rabbitmq-server:amqp' - - 'barbican:amqp' diff --git a/src/tests/bundles/groovy-victoria.yaml b/src/tests/bundles/groovy-victoria.yaml deleted file mode 100644 index e5924db..0000000 --- a/src/tests/bundles/groovy-victoria.yaml +++ /dev/null @@ -1,74 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -series: &series groovy - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers/mysql-router - barbican-mysql-router: - charm: cs:~openstack-charmers/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '3' - - barbican: - series: *series - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: *openstack-origin - debug: true - to: - - '4' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '5' - -relations: - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'barbican:shared-db' - - 'barbican-mysql-router:shared-db' - - - 'barbican-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'keystone:identity-service' - - 'barbican:identity-service' - - - - 'rabbitmq-server:amqp' - - 'barbican:amqp' diff --git a/src/tests/bundles/hirsute-wallaby.yaml b/src/tests/bundles/hirsute-wallaby.yaml deleted file mode 100644 index e58716e..0000000 --- a/src/tests/bundles/hirsute-wallaby.yaml +++ /dev/null @@ -1,74 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -series: &series hirsute - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers/mysql-router - barbican-mysql-router: - charm: cs:~openstack-charmers/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '3' - - barbican: - series: *series - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: *openstack-origin - debug: true - to: - - '4' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '5' - -relations: - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'barbican:shared-db' - - 'barbican-mysql-router:shared-db' - - - 'barbican-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'keystone:identity-service' - - 'barbican:identity-service' - - - - 'rabbitmq-server:amqp' - - 'barbican:amqp' diff --git a/src/tests/bundles/impish-xena.yaml b/src/tests/bundles/impish-xena.yaml deleted file mode 100644 index 8232092..0000000 --- a/src/tests/bundles/impish-xena.yaml +++ /dev/null @@ -1,74 +0,0 @@ -variables: - openstack-origin: &openstack-origin distro - -series: &series impish - -machines: - '0': - constraints: mem=3072M - '1': - constraints: mem=3072M - '2': - constraints: mem=3072M - '3': - '4': - '5': - -applications: - - keystone-mysql-router: - charm: cs:~openstack-charmers/mysql-router - barbican-mysql-router: - charm: cs:~openstack-charmers/mysql-router - - mysql-innodb-cluster: - charm: cs:~openstack-charmers/mysql-innodb-cluster - num_units: 3 - options: - source: *openstack-origin - to: - - '0' - - '1' - - '2' - - keystone: - charm: cs:~openstack-charmers/keystone - num_units: 1 - options: - openstack-origin: *openstack-origin - to: - - '3' - - barbican: - series: *series - charm: ../../../barbican - num_units: 1 - options: - openstack-origin: *openstack-origin - debug: true - to: - - '4' - - rabbitmq-server: - charm: cs:~openstack-charmers/rabbitmq-server - num_units: 1 - to: - - '5' - -relations: - - - - 'keystone:shared-db' - - 'keystone-mysql-router:shared-db' - - - 'keystone-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'barbican:shared-db' - - 'barbican-mysql-router:shared-db' - - - 'barbican-mysql-router:db-router' - - 'mysql-innodb-cluster:db-router' - - - - 'keystone:identity-service' - - 'barbican:identity-service' - - - - 'rabbitmq-server:amqp' - - 'barbican:amqp' diff --git a/src/tests/tests.yaml b/src/tests/tests.yaml index a4e9009..a6273d4 100644 --- a/src/tests/tests.yaml +++ b/src/tests/tests.yaml @@ -1,23 +1,10 @@ charm_name: barbican -smoke_bundles: -- focal-ussuri +smoke_bundles: [] gate_bundles: -- impish-xena -- groovy-victoria -- focal-xena -- focal-wallaby - focal-victoria -- focal-ussuri -- bionic-ussuri -- bionic-train -- bionic-stein -dev_bundles: -- hirsute-wallaby -- bionic-rocky +- focal-wallaby +dev_bundles: [] tests: - zaza.openstack.charm_tests.barbican.tests.BarbicanTest tests_options: - force_deploy: - - hirsute-wallaby - - groovy-victoria - - impish-xena + force_deploy: [] diff --git a/src/wheelhouse.txt b/src/wheelhouse.txt index 0d74803..972cd90 100644 --- a/src/wheelhouse.txt +++ b/src/wheelhouse.txt @@ -1,5 +1,5 @@ psutil -git+https://github.com/openstack/charms.openstack.git@stable/21.10#egg=charms.openstack +git+https://github.com/openstack/charms.openstack.git@stable/wallaby#egg=charms.openstack -git+https://github.com/juju/charm-helpers.git@stable/21.10#egg=charmhelpers +git+https://github.com/juju/charm-helpers@stable/wallaby#egg=charmhelpers diff --git a/test-requirements.txt b/test-requirements.txt index 4afbb28..2325b90 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,6 +3,7 @@ # choices of *requirements.txt files for OpenStack Charms: # https://github.com/openstack-charmers/release-tools # +pyparsing<3.0.0 # cffi needs pyparsing < 3.0.0. cffi==1.14.6; python_version < '3.6' # cffi 1.15.0 drops support for py35. setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 @@ -34,7 +35,7 @@ mock>=1.2; python_version >= '3.6' nose>=1.3.7 coverage>=3.6 -git+https://github.com/openstack/charms.openstack.git@stable/21.10#egg=charms.openstack +git+https://github.com/openstack/charms.openstack.git@stable/wallaby#egg=charms.openstack # # Revisit for removal / mock improvement: # diff --git a/tox.ini b/tox.ini index 22159df..e22fe48 100644 --- a/tox.ini +++ b/tox.ini @@ -37,11 +37,24 @@ setenv = VIRTUAL_ENV={envdir} passenv = http_proxy https_proxy INTERFACE_PATH LAYER_PATH JUJU_REPOSITORY install_command = {toxinidir}/pip.sh install {opts} {packages} +allowlist_externals = + charmcraft + bash + tox + rename.sh deps = -r{toxinidir}/requirements.txt [testenv:build] basepython = python3 +deps = -r{toxinidir}/build-requirements.txt +commands = + charmcraft clean + charmcraft -v build + {toxinidir}/rename.sh + +[testenv:build-reactive] +basepython = python3 commands = charm-build --log-level DEBUG --use-lock-file-branches -o {toxinidir}/build/builds src {posargs} @@ -55,32 +68,44 @@ basepython = python3 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} -[testenv:py35] -basepython = python3.5 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - [testenv:py36] basepython = python3.6 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} -[testenv:py37] -basepython = python3.7 -deps = -r{toxinidir}/test-requirements.txt -commands = stestr run --slowest {posargs} - [testenv:py38] basepython = python3.8 deps = -r{toxinidir}/test-requirements.txt commands = stestr run --slowest {posargs} +[testenv:py39] +basepython = python3.9 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + +[testenv:py310] +basepython = python3.10 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run --slowest {posargs} + [testenv:pep8] basepython = python3 deps = flake8==3.9.2 charm-tools==2.8.3 commands = flake8 {posargs} src unit_tests +[testenv:func-target] +# Hack to get functional tests working in the charmcraft +# world. We should fix this. +basepython = python3 +passenv = HOME TERM CS_* OS_* TEST_* +deps = -r{toxinidir}/src/test-requirements.txt +changedir = {toxinidir}/src +commands = + bash -c "if [ ! -f ../*.charm ]; then echo 'Charm does not exist. Run tox -e build'; exit 1; fi" + tox --version + tox -e func-target {posargs} + [testenv:cover] # Technique based heavily upon # https://github.com/openstack/nova/blob/master/tox.ini