summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f0cb2dd)
This patch updates Dockerfile to use Ubuntu 20.04 as base for building
and testing charms.
This patch updates stage-test script to execute testing for charms.
Tests will be executed only for charms modified by the review.
This patch updates tox configuration for charms setting the python
interpreter to python3.8.
Change-Id: Ib9046b78d6520188cc51ac776fe60ea16479f11c
Signed-off-by: Dario Faccin <dario.faccin@canonical.com>
# devops-stages/stage-build.sh
#
# devops-stages/stage-build.sh
#
ARG APT_PROXY
RUN if [ ! -z $APT_PROXY ] ; then \
ARG APT_PROXY
RUN if [ ! -z $APT_PROXY ] ; then \
debhelper \
dh-make \
git \
debhelper \
dh-make \
git \
python3-all \
python3-dev \
python3-setuptools
python3-all \
python3-dev \
python3-setuptools
-RUN python3 -m easy_install pip==21.0.1
-RUN pip3 install tox==3.22.0
+RUN python3 -m easy_install pip==21.3.1
+RUN pip install tox==3.24.5
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8
-if [ $(git diff --name-only origin/$GERRIT_BRANCH -- installers/charm/ |wc -l) -eq 0 ]; then
- exit 0
-fi
-
CURRENT_DIR=`pwd`
# Execute tests for charms
CHARM_PATH="./installers/charm"
CURRENT_DIR=`pwd`
# Execute tests for charms
CHARM_PATH="./installers/charm"
-CHARM_NAMES="keystone lcm mon nbi ng-ui pla pol prometheus ro grafana mongodb-exporter mysqld-exporter kafka-exporter"
+CHARM_NAMES="osm-lcm osm-mon osm-nbi osm-ng-ui osm-pol osm-ro keystone prometheus grafana vca-integrator-operator"
for charm in $CHARM_NAMES; do
for charm in $CHARM_NAMES; do
- cd $CHARM_PATH/$charm
- TOX_PARALLEL_NO_SPINNER=1 tox --parallel=auto
- cd $CURRENT_DIR
+ if [ $(git diff --name-only "origin/${GERRIT_BRANCH}" -- "installers/charm/${charm}" | wc -l) -ne 0 ]; then
+ echo "Running tox for ${charm}"
+ cd "${CHARM_PATH}/${charm}"
+ TOX_PARALLEL_NO_SPINNER=1 tox -e lint --parallel=auto
+ cd "${CURRENT_DIR}"
+ fi
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
def _on_get_debug_mode_information_action(self, event: ActionEvent) -> None:
"""Handler for the get-debug-mode-information action event."""
if not self.debug_mode.started:
def _on_get_debug_mode_information_action(self, event: ActionEvent) -> None:
"""Handler for the get-debug-mode-information action event."""
if not self.debug_mode.started:
- event.fail(
- "debug-mode has not started. Hint: juju config mon debug-mode=true"
- )
+ event.fail("debug-mode has not started. Hint: juju config mon debug-mode=true")
# Action events
self.on.get_debug_mode_information_action: self._on_get_debug_mode_information_action,
}
# Action events
self.on.get_debug_mode_information_action: self._on_get_debug_mode_information_action,
}
- for relation in [
- self.on[rel_name] for rel_name in ["mongodb", "prometheus", "keystone"]
- ]:
+ for relation in [self.on[rel_name] for rel_name in ["mongodb", "prometheus", "keystone"]]:
event_handler_mapping[relation.relation_changed] = self._on_config_changed
event_handler_mapping[relation.relation_changed] = self._on_config_changed
- event_handler_mapping[
- relation.relation_broken
- ] = self._on_required_relation_broken
+ event_handler_mapping[relation.relation_broken] = self._on_required_relation_broken
for event, handler in event_handler_mapping.items():
self.framework.observe(event, handler)
for event, handler in event_handler_mapping.items():
self.framework.observe(event, handler)
if missing_relations:
relations_str = ", ".join(missing_relations)
one_relation_missing = len(missing_relations) == 1
if missing_relations:
relations_str = ", ".join(missing_relations)
one_relation_missing = len(missing_relations) == 1
- error_msg = (
- f'need {relations_str} relation{"" if one_relation_missing else "s"}'
- )
+ error_msg = f'need {relations_str} relation{"" if one_relation_missing else "s"}'
logger.warning(error_msg)
raise CharmError(error_msg)
logger.warning(error_msg)
raise CharmError(error_msg)
environment = {
# General configuration
"OSMMON_GLOBAL_LOGLEVEL": self.config["log-level"],
environment = {
# General configuration
"OSMMON_GLOBAL_LOGLEVEL": self.config["log-level"],
- "OSMMON_OPENSTACK_DEFAULT_GRANULARITY": self.config[
- "openstack-default-granularity"
- ],
+ "OSMMON_OPENSTACK_DEFAULT_GRANULARITY": self.config["openstack-default-granularity"],
"OSMMON_GLOBAL_REQUEST_TIMEOUT": self.config["global-request-timeout"],
"OSMMON_COLLECTOR_INTERVAL": self.config["collector-interval"],
"OSMMON_EVALUATOR_INTERVAL": self.config["evaluator-interval"],
"OSMMON_GLOBAL_REQUEST_TIMEOUT": self.config["global-request-timeout"],
"OSMMON_COLLECTOR_INTERVAL": self.config["collector-interval"],
"OSMMON_EVALUATOR_INTERVAL": self.config["evaluator-interval"],
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
all_path = {[vars]src_path} {[vars]tst_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
all_path = {[vars]src_path} {[vars]tst_path} {[vars]lib_path}
[testenv]
all_path = {[vars]src_path} {[vars]tst_path} {[vars]lib_path}
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/lib:{[vars]src_path}
PYTHONBREAKPOINT=ipdb.set_trace