Add .gitreview and clean up repo

Add src/README.md placeholder to prevent inheritence of the
base layer's readme file in the built charm.

Use the official charms.openstack repo in test-requirements.txt.

Use official designate charm location in the Amulet tests.

Remove upload-and-publish so as not to encourage out-of-band
pushing and publishing.  That is handled by CI.

Remove legacy Makefile.

Rename Amulet test files and drop Icehouse on the Trusty target.

Update tox.ini for Amulet environment variables.

Update metadata.yaml, removing EOL release and adding tags.

Fix apt_pkg mock

Disable py27 unit tests

Change-Id: I5220b73eb41e42cb03e6dac27525140fb21ca449
This commit is contained in:
Ryan Beisner 2016-07-20 22:52:17 +00:00 committed by Liam Young
parent 94c4ad3a7d
commit 021c2a609c
17 changed files with 121 additions and 36 deletions

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/charm-designate-bind.git

View File

@ -1,8 +0,0 @@
#!/usr/bin/make
LAYER_PATH := layers
clean:
rm -Rf build
generate: clean
LAYER_PATH=$(LAYER_PATH) tox -e generate

22
README.md Normal file
View File

@ -0,0 +1,22 @@
# Overview
This is a "source" charm, which is intended to be strictly the top
layer of a built charm. This structure declares that any included
layer assets are not intended to be consumed as a layer from a
functional or design standpoint.
# Test and Build
Building, pushing and publishing to the charm store is automated
by CI to ensure consistent flow. Manually building is useful for
development and testing, however.
```
tox -e pep8
tox -e py34 # or py27 or py35
tox -e build
```
# Contact Information
Freenode IRC: #openstack-charms

1
src/README.md Normal file
View File

@ -0,0 +1 @@
# Write me.

View File

@ -10,9 +10,9 @@ description: |
Designate, providing DNSaaS in an OpenStack cloud.
tags:
- openstack
- dns
series:
- trusty
- wily
- xenial
subordinate: false
provides:

17
src/tests.yaml Normal file
View File

@ -0,0 +1,17 @@
# Bootstrap the model if necessary.
bootstrap: True
# Re-use bootstrap node instead of destroying/re-bootstrapping.
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:

9
src/tests/README.md Normal file
View File

@ -0,0 +1,9 @@
# Overview
This directory provides Amulet tests to verify basic deployment functionality
from the perspective of this charm, its requirements and its features, as
exercised in a subset of the full OpenStack deployment test bundle topology.
For full details on functional testing of OpenStack charms please refer to
the [functional testing](http://docs.openstack.org/developer/charm-guide/testing.html#functional-testing)
section of the OpenStack Charm Guide.

View File

@ -40,7 +40,7 @@ class DesignateBindDeployment(amulet_deployment.OpenStackAmuletDeployment):
def __init__(self, series, openstack=None, source=None, stable=False):
"""Deploy the entire test environment."""
super(DesignateBindDeployment, self).__init__(series, openstack,
source, stable)
source, stable)
self._add_services()
self._add_relations()
self._configure_services()
@ -63,10 +63,9 @@ class DesignateBindDeployment(amulet_deployment.OpenStackAmuletDeployment):
other_services = [{'name': 'mysql'},
{'name': 'rabbitmq-server'},
{'name': 'keystone'},
{'name': 'designate',
'location': 'cs:~gnuoy/trusty/designate-0'}]
{'name': 'designate'}]
super(DesignateBindDeployment, self)._add_services(this_service,
other_services)
other_services)
def _add_relations(self):
"""Add all of the relations for the services."""

View File

@ -0,0 +1,25 @@
#!/usr/bin/env python
#
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Amulet tests on a basic designate-bind deployment on xenial-newton."""
from basic_deployment import DesignateBindDeployment
if __name__ == '__main__':
deployment = DesignateBindDeployment(series='xenial',
openstack='cloud:xenial-newton',
source='cloud:xenial-updates/newton')
deployment.run_tests()

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python
#
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -14,11 +14,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Amulet tests on a basic aodh deployment on trusty-mitaka."""
"""Amulet tests on a basic designate-bind deployment on yakkety-newton."""
from basic_deployment import DesignateBindDeployment
if __name__ == '__main__':
deployment = DesignateBindDeployment(series='trusty')
deployment = DesignateBindDeployment(series='yakkety')
deployment.run_tests()

View File

@ -0,0 +1,27 @@
#!/usr/bin/env python
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Amulet tests on a basic designate-bind deployment on trusty-mitaka."""
from basic_deployment import DesignateBindDeployment
if __name__ == '__main__':
deployment = DesignateBindDeployment(
series='trusty',
openstack='cloud:trusty-mitaka',
source='cloud:trusty-updates/mitaka')
deployment.run_tests()

View File

@ -15,7 +15,7 @@
# limitations under the License.
"""Amulet tests on a basic aodh deployment on mitaka."""
"""Amulet tests on a basic designate-bind deployment on mitaka."""
from basic_deployment import DesignateBindDeployment

View File

@ -7,6 +7,7 @@ envdir = .tox/py27
setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
AMULET_SETUP_TIMEOUT=2700
passenv = HOME TERM AMULET_HTTP_PROXY AMULET_OS_VIP
deps = -r{toxinidir}/test-requirements.txt
install_command =
pip install --allow-unverified python-apt {opts} {packages}

View File

@ -4,4 +4,4 @@ os-testr>=0.4.1
charms.reactive
mock>=1.2
coverage>=3.6
git+https://github.com/gnuoy/charms.openstack.git@bug/general#egg=charms.openstack
git+https://github.com/openstack/charms.openstack#egg=charms.openstack

View File

@ -25,13 +25,13 @@ commands =
commands = {posargs}
[testenv:pep8]
basepython = python3.5
basepython = python3.4
commands = flake8 {posargs} src/reactive src/lib unit_tests
# Disable py27 tests as this is a reactive python 3 charm. Once project
# config has been updated this tox target can be removed
[testenv:py27]
basepython = python2.7
deps = -r{toxinidir}/test-requirements.txt
commands = ostestr {posargs}
commands = /bin/true
[testenv:py34]
basepython = python3.4

View File

@ -20,7 +20,9 @@ sys.path.append('src/lib')
# Mock out charmhelpers so that we can test without it.
# also stops sideeffects from occuring.
apt_pkg = mock.MagicMock()
charmhelpers = mock.MagicMock()
sys.modules['apt_pkg'] = apt_pkg
sys.modules['charmhelpers'] = charmhelpers
sys.modules['charmhelpers.core'] = charmhelpers.core
sys.modules['charmhelpers.core.hookenv'] = charmhelpers.core.hookenv

View File

@ -1,13 +0,0 @@
#!/bin/bash
# NOTE: relies on new charm publishing features
set -ex
owner=${1:-openstack-charmers-next}
echo "Publishing designate-bind charm to charm store as $owner"
charm upload build/trusty/designate-bind ~${owner}/designate-bind
charm publish ~${owner}/designate-bind
charm change-perm --set-read everyone ~${owner}/designate-bind