Update to classic charms to build using charmcraft in CI

This update is to ensure that the Zuul Canonical CI builds the charm
before functional tests and ensure that that artifact is used for the
functional tests.  This is to try to ensure that the charm that gets
landed to the charmhub is the same charm that was tested with.

Change-Id: I563a3af2895ddf2eb5d8e61006eb8eb2cb8d8d37
This commit is contained in:
Alex Kavanagh 2022-02-15 16:25:32 +00:00 committed by Corey Bryant
parent c9f0cb051c
commit acb1842832
11 changed files with 73 additions and 42 deletions

1
.gitignore vendored
View File

@ -5,6 +5,7 @@ bin
tags tags
*.sw[nop] *.sw[nop]
*.pyc *.pyc
*.charm
precise/ precise/
trusty/ trusty/
xenial/ xenial/

7
build-requirements.txt Normal file
View File

@ -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.

View File

@ -6,6 +6,7 @@ parts:
source: . source: .
prime: prime:
- actions/* - actions/*
- charmhelpers/*
- files/* - files/*
- hooks/* - hooks/*
- lib/* - lib/*

View File

@ -4,3 +4,7 @@
- charm-unit-jobs-py39 - charm-unit-jobs-py39
- charm-xena-functional-jobs - charm-xena-functional-jobs
- charm-yoga-functional-jobs - charm-yoga-functional-jobs
vars:
needs_charm_build: true
charm_build_name: heat
build_type: charmcraft

13
rename.sh Executable file
View File

@ -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

View File

@ -13,11 +13,6 @@ setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb
requests>=2.18.4 requests>=2.18.4
# Newer mock seems to have some syntax which is newer than python3.5 (e.g.
# f'{something}'
mock>=1.2,<4.0.0; python_version < '3.6'
mock>=1.2; python_version >= '3.6'
stestr>=2.2.0 stestr>=2.2.0
# Dependency of stestr. Workaround for # Dependency of stestr. Workaround for

View File

@ -65,7 +65,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '3' - '3'
channel: latest/edge channel: yoga/edge
rabbitmq-server: rabbitmq-server:
charm: ch:rabbitmq-server charm: ch:rabbitmq-server
@ -83,7 +83,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '5' - '5'
channel: latest/edge channel: yoga/edge
nova-cloud-controller: nova-cloud-controller:
charm: ch:nova-cloud-controller charm: ch:nova-cloud-controller
@ -94,7 +94,7 @@ applications:
network-manager: Neutron network-manager: Neutron
to: to:
- '6' - '6'
channel: latest/edge channel: yoga/edge
nova-compute: nova-compute:
charm: ch:nova-compute charm: ch:nova-compute
@ -105,7 +105,7 @@ applications:
enable-live-migration: "False" enable-live-migration: "False"
to: to:
- '7' - '7'
channel: latest/edge channel: yoga/edge
placement: placement:
charm: ch:placement charm: ch:placement
@ -115,7 +115,7 @@ applications:
debug: "True" debug: "True"
to: to:
- '8' - '8'
channel: latest/edge channel: yoga/edge
neutron-gateway: neutron-gateway:
charm: ch:neutron-gateway charm: ch:neutron-gateway
@ -124,7 +124,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '9' - '9'
channel: latest/edge channel: yoga/edge
neutron-api: neutron-api:
charm: ch:neutron-api charm: ch:neutron-api
@ -135,14 +135,14 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '10' - '10'
channel: latest/edge channel: yoga/edge
neutron-openvswitch: neutron-openvswitch:
charm: ch:neutron-openvswitch charm: ch:neutron-openvswitch
channel: latest/edge channel: yoga/edge
heat: heat:
charm: ../../../heat charm: ../../heat.charm
num_units: 2 num_units: 2
constraints: mem=2048 constraints: mem=2048
options: options:

View File

@ -65,7 +65,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '3' - '3'
channel: latest/edge channel: yoga/edge
rabbitmq-server: rabbitmq-server:
charm: ch:rabbitmq-server charm: ch:rabbitmq-server
@ -83,7 +83,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '5' - '5'
channel: latest/edge channel: yoga/edge
nova-cloud-controller: nova-cloud-controller:
charm: ch:nova-cloud-controller charm: ch:nova-cloud-controller
@ -94,7 +94,7 @@ applications:
network-manager: Neutron network-manager: Neutron
to: to:
- '6' - '6'
channel: latest/edge channel: yoga/edge
nova-compute: nova-compute:
charm: ch:nova-compute charm: ch:nova-compute
@ -105,7 +105,7 @@ applications:
enable-live-migration: "False" enable-live-migration: "False"
to: to:
- '7' - '7'
channel: latest/edge channel: yoga/edge
placement: placement:
charm: ch:placement charm: ch:placement
@ -115,7 +115,7 @@ applications:
debug: "True" debug: "True"
to: to:
- '8' - '8'
channel: latest/edge channel: yoga/edge
neutron-gateway: neutron-gateway:
charm: ch:neutron-gateway charm: ch:neutron-gateway
@ -124,7 +124,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '9' - '9'
channel: latest/edge channel: yoga/edge
neutron-api: neutron-api:
charm: ch:neutron-api charm: ch:neutron-api
@ -135,14 +135,14 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '10' - '10'
channel: latest/edge channel: yoga/edge
neutron-openvswitch: neutron-openvswitch:
charm: ch:neutron-openvswitch charm: ch:neutron-openvswitch
channel: latest/edge channel: yoga/edge
heat: heat:
charm: ../../../heat charm: ../../heat.charm
num_units: 2 num_units: 2
constraints: mem=2048 constraints: mem=2048
options: options:

View File

@ -65,7 +65,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '3' - '3'
channel: latest/edge channel: yoga/edge
rabbitmq-server: rabbitmq-server:
charm: ch:rabbitmq-server charm: ch:rabbitmq-server
@ -83,7 +83,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '5' - '5'
channel: latest/edge channel: yoga/edge
nova-cloud-controller: nova-cloud-controller:
charm: ch:nova-cloud-controller charm: ch:nova-cloud-controller
@ -94,7 +94,7 @@ applications:
network-manager: Neutron network-manager: Neutron
to: to:
- '6' - '6'
channel: latest/edge channel: yoga/edge
nova-compute: nova-compute:
charm: ch:nova-compute charm: ch:nova-compute
@ -105,7 +105,7 @@ applications:
enable-live-migration: "False" enable-live-migration: "False"
to: to:
- '7' - '7'
channel: latest/edge channel: yoga/edge
placement: placement:
charm: ch:placement charm: ch:placement
@ -115,7 +115,7 @@ applications:
debug: "True" debug: "True"
to: to:
- '8' - '8'
channel: latest/edge channel: yoga/edge
neutron-gateway: neutron-gateway:
charm: ch:neutron-gateway charm: ch:neutron-gateway
@ -124,7 +124,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '9' - '9'
channel: latest/edge channel: yoga/edge
neutron-api: neutron-api:
charm: ch:neutron-api charm: ch:neutron-api
@ -135,14 +135,14 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '10' - '10'
channel: latest/edge channel: yoga/edge
neutron-openvswitch: neutron-openvswitch:
charm: ch:neutron-openvswitch charm: ch:neutron-openvswitch
channel: latest/edge channel: yoga/edge
heat: heat:
charm: ../../../heat charm: ../../heat.charm
num_units: 2 num_units: 2
constraints: mem=2048 constraints: mem=2048
options: options:

View File

@ -65,7 +65,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '3' - '3'
channel: latest/edge channel: yoga/edge
rabbitmq-server: rabbitmq-server:
charm: ch:rabbitmq-server charm: ch:rabbitmq-server
@ -83,7 +83,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '5' - '5'
channel: latest/edge channel: yoga/edge
nova-cloud-controller: nova-cloud-controller:
charm: ch:nova-cloud-controller charm: ch:nova-cloud-controller
@ -94,7 +94,7 @@ applications:
network-manager: Neutron network-manager: Neutron
to: to:
- '6' - '6'
channel: latest/edge channel: yoga/edge
nova-compute: nova-compute:
charm: ch:nova-compute charm: ch:nova-compute
@ -105,7 +105,7 @@ applications:
enable-live-migration: "False" enable-live-migration: "False"
to: to:
- '7' - '7'
channel: latest/edge channel: yoga/edge
placement: placement:
charm: ch:placement charm: ch:placement
@ -115,7 +115,7 @@ applications:
debug: "True" debug: "True"
to: to:
- '8' - '8'
channel: latest/edge channel: yoga/edge
neutron-gateway: neutron-gateway:
charm: ch:neutron-gateway charm: ch:neutron-gateway
@ -124,7 +124,7 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '9' - '9'
channel: latest/edge channel: yoga/edge
neutron-api: neutron-api:
charm: ch:neutron-api charm: ch:neutron-api
@ -135,14 +135,14 @@ applications:
openstack-origin: *openstack-origin openstack-origin: *openstack-origin
to: to:
- '10' - '10'
channel: latest/edge channel: yoga/edge
neutron-openvswitch: neutron-openvswitch:
charm: ch:neutron-openvswitch charm: ch:neutron-openvswitch
channel: latest/edge channel: yoga/edge
heat: heat:
charm: ../../../heat charm: ../../heat.charm
num_units: 2 num_units: 2
constraints: mem=2048 constraints: mem=2048
options: options:

12
tox.ini
View File

@ -37,10 +37,20 @@ setenv = VIRTUAL_ENV={envdir}
install_command = install_command =
{toxinidir}/pip.sh install {opts} {packages} {toxinidir}/pip.sh install {opts} {packages}
commands = stestr run --slowest {posargs} commands = stestr run --slowest {posargs}
allowlist_externals = juju allowlist_externals =
charmcraft
rename.sh
passenv = HOME TERM CS_* OS_* TEST_* passenv = HOME TERM CS_* OS_* TEST_*
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
[testenv:build]
basepython = python3
deps = -r{toxinidir}/build-requirements.txt
commands =
charmcraft clean
charmcraft -v build
{toxinidir}/rename.sh
[testenv:py35] [testenv:py35]
basepython = python3.5 basepython = python3.5
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt