From e1b0c3886ba5551d3fa8c79849d6a6406037c811 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 6 Dec 2017 09:07:47 -0600 Subject: [PATCH] Add base jobs for functional tests I keep copy-pasting these to projects from the shade repo. Let's make some base jobs people can more easily use. devstack-tox-functional runs devstack and a tox functional environment. devstack-tox-functional-consumer is the same, but runs devstack in pre. It's intended for projects for whom patches to the project won't actually impact the devstack deployment (shade, nodepool, gophercloud are all examples of such things) Change-Id: I84de60181cb88574e341ff83cd4857cce241f2dd --- .zuul.yaml | 54 +++++++++++++++++++++++++++++++++++++ playbooks/tox/post.yaml | 5 ++++ playbooks/tox/pre.yaml | 8 ++++++ playbooks/tox/run-both.yaml | 10 +++++++ playbooks/tox/run.yaml | 3 +++ 5 files changed, 80 insertions(+) create mode 100644 playbooks/tox/post.yaml create mode 100644 playbooks/tox/pre.yaml create mode 100644 playbooks/tox/run-both.yaml create mode 100644 playbooks/tox/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 7c53d45e94..a699dbaa7d 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -91,6 +91,60 @@ # ready yet. Until then this job should stay non-voting. voting: false +- job: + name: devstack-tox-base + parent: devstack + description: | + Base job for devstack-based functional tests that use tox. + + This job is not intended to be run directly. It's just here + for organizational purposes for devstack-tox-functional and + devstack-tox-functional-consumer. + post-run: playbooks/tox/post.yaml + vars: + tox_envlist: functional + tox_install_siblings: false + +- job: + name: devstack-tox-functional + parent: devstack-tox-base + description: | + Base job for devstack-based functional tests that use tox. + + Runs devstack, then runs the tox ``functional`` environment, + then collects tox/testr build output like normal tox jobs. + + Turns off tox sibling installation. Projects may be involved + in the devstack deployment and so may be in the required-projects + list, but may not want to test against master of the other + projects in their tox env. Child jobs can set tox_install_siblings + to True to re-enable sibling processing. + run: playbooks/tox/run-both.yaml + +- job: + name: devstack-tox-functional-consumer + parent: devstack + description: | + Base job for devstack-based functional tests for projects that + consume the devstack cloud. + + This base job should only be used by projects that are not involved + in the devstack deployment step, but are instead projects that are using + devstack to get a cloud against which they can test things. + + Runs devstack in pre-run, then runs the tox ``functional`` environment, + then collects tox/testr build output like normal tox jobs. + + Turns off tox sibling installation. Projects may be involved + in the devstack deployment and so may be in the required-projects + list, but may not want to test against master of the other + projects in their tox env. Child jobs can set tox_install_siblings + to True to re-enable sibling processing. + pre-run: + - playbooks/devstack.yaml + - playbooks/tox/pre.yaml + run: playbooks/tox/run.yaml + - project: name: openstack-dev/devstack check: diff --git a/playbooks/tox/post.yaml b/playbooks/tox/post.yaml new file mode 100644 index 0000000000..d9e299ff4d --- /dev/null +++ b/playbooks/tox/post.yaml @@ -0,0 +1,5 @@ +- hosts: all + roles: + - fetch-tox-output + - fetch-testr-output + - fetch-stestr-output diff --git a/playbooks/tox/pre.yaml b/playbooks/tox/pre.yaml new file mode 100644 index 0000000000..d7e4670a80 --- /dev/null +++ b/playbooks/tox/pre.yaml @@ -0,0 +1,8 @@ +- hosts: all + roles: + # Run bindep and test-setup after devstack so that they won't interfere + - role: bindep + bindep_profile: test + bindep_dir: "{{ zuul_work_dir }}" + - test-setup + - ensure-tox diff --git a/playbooks/tox/run-both.yaml b/playbooks/tox/run-both.yaml new file mode 100644 index 0000000000..e85c2eee96 --- /dev/null +++ b/playbooks/tox/run-both.yaml @@ -0,0 +1,10 @@ +- hosts: all + roles: + - run-devstack + # Run bindep and test-setup after devstack so that they won't interfere + - role: bindep + bindep_profile: test + bindep_dir: "{{ zuul_work_dir }}" + - test-setup + - ensure-tox + - tox diff --git a/playbooks/tox/run.yaml b/playbooks/tox/run.yaml new file mode 100644 index 0000000000..22f82096c7 --- /dev/null +++ b/playbooks/tox/run.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - tox