diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 000000000..a6668feff --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,22 @@ +- project: + name: openstack/murano-dashboard + check: + jobs: + - murano-dashboard-sanity-check + +- job: + name: murano-dashboard-sanity-check + parent: legacy-dsvm-base + run: playbooks/legacy/murano-dashboard-sanity-check/run.yaml + post-run: playbooks/legacy/murano-dashboard-sanity-check/post.yaml + voting: false + timeout: 10800 + required-projects: + - openstack-infra/devstack-gate + - openstack/heat + - openstack/murano + - openstack/murano-dashboard + - openstack/python-heatclient + - openstack/python-muranoclient + - openstack/horizon + - openstack/heat-dashboard diff --git a/functional_tests/collect_results.sh b/functional_tests/collect_results.sh new file mode 100755 index 000000000..7fd97cba0 --- /dev/null +++ b/functional_tests/collect_results.sh @@ -0,0 +1,31 @@ +DEST=${DEST:-/opt/stack/new} +DASHBOARD_DIR=$DEST/murano-dashboard + +function create_artifacts_dir() { + dst="${WORKSPACE}/logs/artifacts" + mkdir -p "${dst}" +} + +function collect_screenshots() { + # Copy screenshots for failed tests + if [[ -d "$DASHBOARD_DIR/muranodashboard/tests/functional/screenshots/" ]]; then + mkdir -p "${WORKSPACE}/logs/artifacts/screenshots" + cp -Rv $DASHBOARD_DIR/muranodashboard/tests/functional/screenshots/* "${WORKSPACE}/logs/artifacts/screenshots/" + fi +} + +function generate_html_report() { + local xml_report="${WORKSPACE}/logs/test_report.xml" + local html_report="${WORKSPACE}/logs/test_report.html" + + if [[ -f "${WORKSPACE}/logs/test_report.xml" ]]; then + $(which python) "$DASHBOARD_DIR/functional_tests/generate_html_report.py" "${xml_report}" "${html_report}" + cp "${html_report}" "${WORKSPACE}/index.html" + fi +} + +function do_collect_results() { + create_artifacts_dir + collect_screenshots + generate_html_report +} diff --git a/functional_tests/env_pkg_prepare.sh b/functional_tests/env_pkg_prepare.sh new file mode 100755 index 000000000..f1013db33 --- /dev/null +++ b/functional_tests/env_pkg_prepare.sh @@ -0,0 +1,24 @@ +function prepare_packages() { + + sudo wget https://sourceforge.net/projects/ubuntuzilla/files/mozilla/apt/pool/main/f/firefox-mozilla-build/firefox-mozilla-build_46.0.1-0ubuntu1_amd64.deb/download -O firefox46.deb + sudo dpkg -i firefox46.deb + sudo rm -f firefox46.deb + + sudo apt-get update + sudo apt-get install -y \ + libpq-dev \ + python-dev \ + libxml2-dev \ + libxslt1-dev \ + libffi-dev \ + make \ + gcc \ + ntpdate \ + xvfb \ + zip \ + python-openssl \ + python-crypto \ + libgtk-3-0 \ + libasound2 \ + libdbus-glib-1-2 +} diff --git a/functional_tests/generate_html_report.py b/functional_tests/generate_html_report.py new file mode 100644 index 000000000..3037a0ca1 --- /dev/null +++ b/functional_tests/generate_html_report.py @@ -0,0 +1,164 @@ +#!/usr/bin/python +# Copyright (c) 2015 Mirantis, Inc. +# +# 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. +# + +from __future__ import with_statement +import jinja2 +import lxml.etree as et +import uuid +import sys +import os +import re + +if not __name__ == "__main__": + sys.exit(1) +if not len(sys.argv) >= 3: + sys.exit(1) +if not os.path.exists(sys.argv[1]): + sys.exit(1) + +LOG_LINE_PATTERN = "^(?P20[0-9]{2}\-[0-9]{2}\-[0-9]{2}) (?P