From 8ac7e261d81a47cef8bb307bee8b0c720b31adda Mon Sep 17 00:00:00 2001 From: Travis Truman Date: Wed, 2 Mar 2016 12:25:43 -0500 Subject: [PATCH] Adding Vagrantfile for local developer testing This Vagrantfile attempts to replicate the gate check testing to the extent possible to allow developers to run all tests locally in a Vagrant environment prior to submitting changes for review. Contributor documentation updated to demonstrate usage of the Vagrantfile. Change-Id: Iaf6cd27730521db648338cb297f8282b1eb71d05 --- .gitignore | 3 +++ CONTRIBUTING.rst | 22 ++++++++++++++++++++-- Vagrantfile | 9 +++++++++ run_tests.sh | 0 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 Vagrantfile mode change 100644 => 100755 run_tests.sh diff --git a/.gitignore b/.gitignore index 9ffa62a..63ae8eb 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,6 @@ releasenotes/build # Test temp files tests/plugins + +# Vagrant testing artifacts +.vagrant diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 8504750..b5da8fe 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -28,11 +28,29 @@ the workflow documented at: "http://docs.openstack.org/infra/manual/developers.h Pull requests submitted through GitHub will be ignored and closed without regard. +If you wish to test your changes locally prior to submitting them for review +you can use the ``Vagrantfile`` included in the root of this repository. It +aims to replicate the gate check testing that will be done by OpenStack CI +once your review has been submitted. + +To run tests: + +.. code-block:: shell-session + + # vagrant up + +The Vagrant box will run all tests and report status in the output. If you +need to iterate through a fix/test cycle, tests can be re-run in a running +Vagrant box with: + +.. code-block:: shell-session + + # vagrant provision Extra ----- -Tags: +Tags: If it's a bug that needs fixing in a branch in addition to Master, add a '\-backport-potential' tag (eg ``juno-backport-potential``). There are predefined tags that will autocomplete. Status: @@ -45,7 +63,7 @@ Importance: Style guide ----------- -When creating tasks and other roles for use in Ansible please create then using the YAML dictionary format. +When creating tasks and other roles for use in Ansible please create then using the YAML dictionary format. Example YAML dictionary format: .. code-block:: yaml diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 0000000..f989614 --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,9 @@ +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/trusty64" + config.vm.provision "shell", inline: <<-SHELL + sudo su - + cd /vagrant + apt-get update + ./run_tests.sh + SHELL +end diff --git a/run_tests.sh b/run_tests.sh old mode 100644 new mode 100755