Add tox tests to .zuul.yaml

This patch set adds tox tests to .zuul.yaml

Prometheus scrapers are not running in the airship-shipyard
and hence removed to prevent airship-shipyard-ubuntu job
from failing.

Change-Id: Ib805946ea76664b7448e02b4c7e4adb40c4dbaf2
This commit is contained in:
anthony.lin 2018-05-23 15:38:31 +08:00
parent ca9866e533
commit b87569abe8
10 changed files with 242 additions and 9 deletions

View File

@ -16,10 +16,9 @@
- airship-shipyard-linter
- airship-shipyard-ubuntu:
voting: false
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
- airship-shipyard-tox-py35
- airship-shipyard-pep8
- airship-shipyard-image
gate:
jobs:
- airship-shipyard-linter
@ -29,19 +28,24 @@
# - ^.*\.rst$
# - ^doc/.*$
# - ^releasenotes/.*$
- airship-shipyard-tox-py35
- airship-shipyard-pep8
- airship-shipyard-image
- job:
name: airship-shipyard-linter
description: |
Lints all files by checking them for whitespace.
run: tools/gate/playbooks/zuul-linter.yaml
nodeset: openstack-helm-single-node
- job:
name: airship-shipyard
name: airship-shipyard-base
roles:
- zuul: openstack/openstack-helm-infra
vars:
zuul_osh_infra_relative_path: ../openstack-helm-infra/
timeout: 7200
timeout: 3600
pre-run:
- tools/gate/playbooks/osh-infra-upgrade-host.yaml
- tools/gate/playbooks/osh-infra-deploy-docker.yaml
@ -51,8 +55,76 @@
post-run: tools/gate/playbooks/osh-infra-collect-logs.yaml
required-projects:
- openstack/openstack-helm-infra
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
- job:
name: airship-shipyard-ubuntu
parent: airship-shipyard
parent: airship-shipyard-base
nodeset: openstack-helm-single-node
- job:
name: airship-shipyard-tox-base
description: |
Base job for running airship-shipyard tests. Runs tests
against Docker image generated from source code.
roles:
- zuul: openstack/openstack-helm-infra
timeout: 3600
pre-run:
- tools/gate/playbooks/osh-infra-upgrade-host.yaml
- tools/gate/playbooks/osh-infra-deploy-docker.yaml
run: tools/gate/playbooks/run-tests.yaml
required-projects:
- openstack/openstack-helm-infra
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
- job:
name: airship-shipyard-tox-py35
description: |
Run tox-based tests for the Airship Shipyard project under
cPython version 3.5.
parent: airship-shipyard-tox-base
nodeset: openstack-helm-single-node
vars:
tox_envlist: py35
- job:
name: airship-shipyard-pep8
description: |
Run pep8 tests for the Airship Shipyard project under
cPython version 3.5.
parent: airship-shipyard-tox-base
nodeset: openstack-helm-single-node
vars:
tox_envlist: pep8
- job:
name: airship-shipyard-image-base
description: |
Base job for running airship-shipyard image related jobs.
roles:
- zuul: openstack/openstack-helm-infra
timeout: 3600
pre-run:
- tools/gate/playbooks/osh-infra-upgrade-host.yaml
- tools/gate/playbooks/osh-infra-deploy-docker.yaml
run: tools/gate/playbooks/run-image.yaml
required-projects:
- openstack/openstack-helm-infra
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ^releasenotes/.*$
- job:
name: airship-shipyard-image
description: |
Run shipyard-image build.
parent: airship-shipyard-image-base
nodeset: openstack-helm-single-node

View File

@ -21,10 +21,8 @@
- helm-release-status
- describe-kubernetes-objects
- gather-pod-logs
- gather-prom-metrics
tags:
- gather-host-logs
- helm-release-status
- describe-kubernetes-objects
- gather-pod-logs
- gather-prom-metrics

1
tools/gate/playbooks/roles Symbolic link
View File

@ -0,0 +1 @@
../roles/

View File

@ -0,0 +1,21 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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.
- hosts: all
gather_facts: False
become: yes
roles:
- build-images
tags:
- build-images

View File

@ -0,0 +1,20 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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.
- hosts: all
gather_facts: False
roles:
- run-tests
tags:
- run-tests

View File

@ -0,0 +1,57 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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.
- name: set zuul_site_mirror_fqdn from env var if not defined
when: zuul_site_mirror_fqdn is not defined
set_fact:
zuul_site_mirror_fqdn: "{{ lookup('env','zuul_site_mirror_fqdn') }}"
# NOTE(portdirect): Until https://github.com/ansible/ansible/issues/21433 is
# resolved, we build with a shell script to make use of the host network.
- name: Build Airship-Shipyard Image
block:
# NOTE(portdirect): We do this to ensure we are feeding the docker build
# a clean path to work with.
- name: Airship-Shipyard image build path
shell: cd "{{ work_dir }}"; pwd
register: airship_shipyard_path
vars:
zuul_airship_shipyard_relative_path: ../airship-shipyard
work_dir: "{{ zuul.project.src_dir }}/{{ zuul_airship_shipyard_relative_path | default('') }}"
- name: Airship-Shipyard image build path
shell: |-
set -ex;
docker build \
--network host \
--force-rm \
--label zuul \
-f images/shipyard/Dockerfile \
--build-arg ctx_base=src/bin \
{% if zuul_site_mirror_fqdn is defined and zuul_site_mirror_fqdn %}
--build-arg UBUNTU_URL="http://{{ zuul_site_mirror_fqdn }}/ubuntu/" \
--build-arg ALLOW_UNAUTHENTICATED="true" \
--build-arg PIP_INDEX_URL="http://{{ zuul_site_mirror_fqdn }}/pypi/simple" \
--build-arg PIP_TRUSTED_HOST="{{ zuul_site_mirror_fqdn }}" \
{% endif %}
.
args:
chdir: "{{ airship_shipyard_path.stdout }}"
executable: /bin/bash
- name: Register Shipyard Image ID
shell: |-
set -e;
echo $( docker images --filter label=zuul | awk '{print $3}' | head -2 | tail -1 )
register: shipyard_image_id

View File

@ -0,0 +1,15 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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.
- include: airship-shipyard.yaml

View File

@ -0,0 +1,15 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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.
- include: tox-tests.yaml

View File

@ -0,0 +1,20 @@
# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# 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.
- name: Run Tox Tests
shell: |
set -xe;
tox -e {{ tox_envlist }}
args:
chdir: "{{ zuul.project.src_dir }}"

14
tox.ini
View File

@ -29,3 +29,17 @@ whitelist_externals=
commands=
tox -c {toxinidir}/src/bin/shipyard_airflow/tox.ini
tox -c {toxinidir}/src/bin/shipyard_client/tox.ini
[testenv:py35]
whitelist_externals=
tox
commands=
tox -c {toxinidir}/src/bin/shipyard_airflow/tox.ini -e py35
tox -c {toxinidir}/src/bin/shipyard_client/tox.ini -e py35
[testenv:pep8]
whitelist_externals=
tox
commands=
tox -c {toxinidir}/src/bin/shipyard_airflow/tox.ini -e pep8
tox -c {toxinidir}/src/bin/shipyard_client/tox.ini -e pep8