Commit Graph

45 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 97a3e26e01 Update tox.ini to work with 4.0
With tox release of 4.0, some parameters were deprecated and are ignored now
which causes tox failures. One of the most spread issues we have is using
`whitelist_externals` isntead of `allowlist_externals`


Change-Id: I4967f301398621ae6e7b47b22d9a4d52037f6a3b
2022-12-27 17:53:12 +01:00
Jonathan Rosser 9468f9aad2 Do not set PYTHONPATH for tox tests
We are now much clearer about the setting of ansible_python_interpreter
and even though ansible is executing inside the venv it should
be deploying against the host with ansible, not the venv.

Depends-On: https://review.opendev.org/735289
Change-Id: I583f2236acbc02b33e6fc192faa8cee62cd10b89
2020-06-16 09:26:22 +01:00
Andreas Jaeger 57672cbdf5 Cleanup py27 support
This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove setup.* files, these are not needed for this repo
- Cleanup */source/conf.py to remove now obsolete content.
- Remove install_command from tox.ini, the default is fine,
  move constraints into deps, cleanup a bit
- Enable warnings for docs building
- Correct ansible search/match tests for ansible 2.9

Depends-On: https://review.opendev.org/726645
Change-Id: Ia5aaa8f41172fe200d1d7ce0c7b6f26f7834e38a
2020-05-10 17:38:52 +00:00
Jonathan Rosser 7a216dd962 Move all tox environments to python3
Change-Id: Ifc091d499523b19c4d8821dab83e9e2a2ea12e0a
2020-04-25 09:17:30 +00:00
melissaml 964d418ba5 tox: Keeping going with docs
1. Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

2. Remove the unnecessary blank line for tox.ini

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Id99c8c66f156dadc9912eaf3ddcb28413094a359
2019-12-05 17:35:52 +08:00
Dmitriy Rabotyagov 13e3edf9c1 PDF Documentation Build tox target
This patch adds a `pdf-docs` tox target that will build
PDF versions of our docs. As per the Train community goal:

  https://governance.openstack.org/tc/goals/selected/train/pdf-doc-generation.html

Add sphinxcontrib-svg2pdfconverter to doc/requirements.txt
to convert our SVGs.

Change-Id: Ie582a8d9d1a9fcd5a9766c351c9edb58ade47fd0
Story: 2006105
2019-10-17 19:21:35 +03:00
pengyuesheng 03089fa08e Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: Iff688aa9c3f56d901d95e25c5139dc34cc3253d5
2019-09-26 10:11:05 +08:00
melissaml a02e4a9a51 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I26e544c0d2a9eb740174a1d4c486b2fb583461dd
2019-05-06 20:06:29 +08:00
huang.zhiping c52fe44cb2 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: Ia3f91544b5f60592c44a2970e983df8bbe829e3a
2018-09-30 12:06:18 +00:00
Doug Hellmann a474fbc020 fix tox python3 overrides
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.

We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.

We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.

Change-Id: I0af955e386a4050a49a35f411094e24a11f66ca8
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-09-26 18:42:17 -04:00
Jesse Pretorius 9b47901f60 Use the TESTING_BRANCH env var for constraints
The TESTING_BRANCH environment variable is provided by the
run_tests.sh script and is derived from the .gitreview file.

This ensures that once the master branch becomes a stable
branch, the constraints from the stable branch in the
integrated repository will automatically get used once the
.gitreview file is updated.

To ensure that the required environment variables are present
we export them appropriately in run_tests.sh and modify the
tox configuration to pass them into the tox test.

Change-Id: I096778341f2022de5604e9624eff23a6e4c5f9a8
Needed-By: https://review.openstack.org/579371
2018-08-16 15:26:27 +01:00
Heba Naser e147b5ca51 Use tests repo for common role test requirements
Using tox for requirements management requires in-repo
requirements files for all our repositories. Rather than
do that, we make use of the tests repo to capture our
common requirements and use this to install them.

This reduces our review requirement rate and simplifies
maintenance for us for the tox config. It also makes it
usable with 'Depends-On', which is marvellous!

The tox requirements definitions for docs/releasenotes
builds are left in-place as those are standard entries
across the community. If that changes at some point, we
can re-assess those entries too.

Depends-On: https://review.openstack.org/579208
Change-Id: I483410dc4415b880a781215b171616aecb8f6a18
2018-07-02 09:12:41 -04:00
Jesse Pretorius 0b4558baeb Remove tests-repo-clone.sh
Now that run_tests.sh handles the tests repo clone, we can
remove the use of the older tests-repo-clone.sh script.

Change-Id: I2da0609609e8f70671b0499f0a5911746985c917
2018-03-28 10:11:44 +01:00
Jesse Pretorius 96b29e4908 tox.ini: Expose USER environment variable to execution environment
In order to allow the use of the environment variable which informs
Ansible which user executed the playbook, we pass the USER env var
into the environment that tox builds.

Change-Id: Ic67117a2a0b20dfcad01686276d91fa66a196fe0
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-03-15 17:56:30 +00:00
ZhongShengping 3f26fc8b72 Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html

For more detials information, please refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Change-Id: Ia599971891c354ff7b0fbce0c78845946502ea3b
2018-03-09 12:01:25 +08:00
Jesse Pretorius 25c35db744 Ensure that role tests pin pip/setuptools/wheel
Currently the role tests use whatever versions of pip,
setuptools and wheel are already installed on the host.

When a version of these tools changes it often causes
problems for our testing.

This will ensure that we use a known good set of pins
which is maintained in the general SHA bumping process.

Change-Id: Ic87ed4f9f3d60f05d3c1d9828a6b63f5c5626138
2017-06-04 11:18:39 +01:00
Jesse Pretorius 578b1f7dd9 Use zuul-cloner for tests repo in OpenStack-CI
When executing the tests repo clone in OpenStack-CI,
use zuul-cloner instead of git to enable cross-repo
testing. This ensures that if a dependent patch from
the tests repo is noted using 'Depends-On: <change-id>'
in the commit message, that patch will be included.

Change-Id: I87314f8c46554a9b6856078bda61c4775e20243b
Depends-On: Idce7abebf32f24c356a27e099fbca954d917402b
2017-05-04 16:49:39 +01:00
Markos Chandras 0fd42e3dc0 tox.ini: Set PYTHONPATH when executing tox tests
Ansible seems to override the default PYTHONPATH so set PYTHONPATH
explicitely to point to the virtualenv location so that ansible modules
can import the LXC module.

Link: https://github.com/ansible/ansible/blob/devel/lib/ansible/executor/module_common.py#L154
Related-Bug: 1682108
Change-Id: Ia87fdc30e200bf81992d6cf1dc3f49c64e900c2d
2017-04-18 16:34:44 +01:00
gecong1973 fda7f9b8d7 Use https instead of http for git.openstack.org
TrivialFix

Change-Id: I0e594d483deaea63e1e5b59f51b8041e829b69b2
2017-02-06 11:46:46 +08:00
gecong1973 6b9ef8571c Delete deprecated Hacking in tox.ini
Some hacking have been removed,so we can delete them.
More details:
     https://github.com/openstack-dev/hacking/blob/master/setup.cfg

Change-Id: I3b960e6341d238ef597e6e229d5cf1d2b3a23a0d
2016-12-06 08:59:38 +08:00
Jesse Pretorius 3f093b6366 Use upper constraints for all tox targets
With the implementation of https://review.openstack.org/388087 all
tox targets may now use upper constraints.

Change-Id: I61c36be4184c15e484007d85511ed072125f5ede
2016-10-19 07:40:44 +01:00
Jesse Pretorius 24d25538a7 Use centralised Ansible test scripts
This patch consumes the centralised Ansible test scripts
implemented in https://review.openstack.org/381853

Change-Id: Ie7ad735d16af74922cbc712f59e343bba3050e61
2016-10-05 12:12:23 +01:00
Jesse Pretorius e2652adca9 Remove install_test_packages variable
With https://review.openstack.org/381479 merged, setting this
variable in tox.ini via an extra var is unnecessary.

Change-Id: I313a4d69ee6e165238d5b459cacda3b29f800c8a
2016-10-04 11:39:37 +01:00
Jesse Pretorius 9af76a5f42 Use centralised test scripts
This patch consumes the test scripts implemented by
https://review.openstack.org/375061 to ensure that
the tests and test preparation is consistent and
more maintainable.

Change-Id: I8ad59bdb2dab0e79bc73d7e4cdb63ef49cbdddba
2016-09-27 16:47:07 +01:00
Kevin Carter f5ae22d4a0 Update testing bits for consistency
Change-Id: I18e29d81723536cb43fc404f345dc0aaf168178c
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-09-17 17:07:48 -04:00
Jesse Pretorius 101498fda5 Compress test execution logs
The volume of logs we collect in CI jobs are extensive. This
patch ensures that the logs collected are compressed to reduce
the space taken in CI systems.

PYTHONUNBUFFERED is also set to ensure that the console log
from the CI jobs is recorded in the exact order of execution.

Change-Id: Ied2a2f817a88a1326d446fe77a0f666a63a6e3d2
Related-Bug: #1620849
2016-09-09 10:18:50 +01:00
Kevin Carter cef267ceab Enable log collection after functional testing
This change enables log collection within the gate so that further analysis
on gate tasks can be performed post build. This is very useful when
debugging problems.

Change-Id: Ibf510274bc065d5db37781601941e2a2f5d833a5
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-29 21:33:57 -05:00
Jesse Pretorius 5c58449026 Make all linting tests use upper-constraints
As per [1] all linting tests can now use upper-constraints. This patch
removes all instances of the install_command override relating to lint
testing which were needed to negate the use of upper-constraints.

[1] http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: Id2996bfb7c7b2b34714ec56bf264afc759f1060b
2016-08-20 16:03:47 +01:00
Jenkins 9b3a6e2536 Merge "Ansible 2.1.1 role testing" 2016-08-17 04:56:50 +00:00
Travis Truman b8860f2026 Ansible 2.1.1 role testing
Change-Id: I9ca11d1e42a259f03220b47b52b0c89635696036
2016-08-11 15:29:36 -05:00
Jean-Philippe Evrard 590cdde13b Include ansible commands for ansible linting
The plugin repo needs to be cloned for ansible-lint to
understand ansible plugins. The commands currently
reside in tox.ini under the ansible section and are not
currently included. This commit fixes that error.

Change-Id: If46565f2e58de9e3d228377c5b10e6d4bf4b3aa1
2016-08-11 18:08:08 +01:00
Jesse Pretorius 4c0c29037d Ensure that doc linting is included in the linters test
The 'docs' tox target executes the doc8 lint test which may result in
failures when testing documentation builds, but OpenStack-CI does not
execute that tox target.

In order to ensure that we catch all standard documentation syntax
errors and prevent them from merging, this patch includes the docs
target in the 'linters' chain of tests.

Fixes for any failures which result from executing this test are also
included in the patch.

Change-Id: Ifb66e109667ae14f56f83a91301b0595319a24ca
2016-07-25 22:53:11 +01:00
Jesse Pretorius 470e83c14f Use plugins repo version of the human_log callback plugin
With the implementation of https://review.openstack.org/321331 the
human_log callback plugin is now part of the plugins repo.

This patch removes the retrofitted version in tox in favor of using
the version from the plugins repo instead.

Change-Id: I8e20ac8ffc64265057e2c52e8e162943c9ba8038
2016-07-15 14:00:52 +01:00
Jesse Pretorius d38f6a14a5 Implement doc8 checks for docs
In order to prepare for the move of detailed configuration
content from the install guide to the roles, doc8 checks
are being implemented in the roles to ensure that any new
content submitted is properly checked.

Change-Id: Ibeed486250a1a6d0323d8469d6432b7e3575cb6b
Partially-Implements: blueprint osa-install-guide-overhaul
2016-07-13 12:54:10 +01:00
Jesse Pretorius 18c0e96244 Update tox configuration
In order to prepare for implementing requirements management by the
OpenStack requirements management process, and to improve the
reliability and effectiveness of test execution, this patch implements
some changes to the tox configuration:

- The minimum tox version is increased in order to be able to use
  constraints for the python packages.
- The OpenStack upper-constraints are used when preparing the test
  venv for the linters checks.
- Any proxy environment variables set on the test host are passed
  into the venv to enable testing from behind a proxy.
- The environment variables used by Ansible tests are moved into
  a new venv called 'ansible' and this environment is inherited
  by all Ansible-related tests.
- The docs test will clean-up an existing build directory before
  executing the docs build.
- The releasenotes build cannot use upper-constraints at this point,
  so it doesn't.
- The Ansible role download will no longer ignore errors so that any
  problems discovered will result in a failed test.
- The human readable logging callback plugin is implemented for
  functional testing.
- The ansible test requirements are moved into tox.ini to ensure
  compliance for requirements.txt/test-requirements.txt for the
  global-requirements management contract.
- The ~/.ansible directory as a whole is not deleted. Instead only
  the plugins and roles folders are deleted to ensure that zuul's
  Ansible artifacts are left in-place.
- The ansible-lint version is updated to support execution against a
  folder, and the test now executes against the entire role to ensure
  that it captures all applicable files for lint testing.

This is a combined port of the following:
- https://review.openstack.org/323507
- https://review.openstack.org/338193
- https://review.openstack.org/332443
- https://review.openstack.org/338193
- https://review.openstack.org/339493

Change-Id: I6e90dab524c3e6ae34af26dcbd49f3d669da3a65
2016-07-08 13:33:32 +01:00
Jesse Pretorius aca3d5e01d Make the LXC cache prep use the host package source config
Currently the container cache preparation process uses a pre-prepared
LXC base image which includes its own package repository configuration.

This presents a few problems:
- The first packages installed will make use of the base image's
  package repo configuration, resulting in a bypass of local mirrors
  to install the first set of packages.
- A set of vars need to be set in order to have the containers use a
  local mirror, otherwise it'll use the mirrors set in the role's vars
  files. This is counterintuitive.

Another problem introduced by I95c210c83ca968d11ba6f6a36b634bb798fa291f
as a result of the package repository vars moving from the role defaults
to the vars files is that the precedence has changed. The change in
precedence means that a task which sets a fact can't be used to override
the defaults set in the vars file. This method is used in all the role
tests to ensure that the OpenStack-CI repositories can be discovered from
the host and then used.

This patch changes the image cache preparation process to ensure that
the container package repository configuration matches the host
configuration. This is simpler and more intuitive.

Additionally the copy task from the deployment host into the container
cache is set to assume the same destination in the container as the
source (to reduce configuration verbosity), appropriately sets the
leading '0' for the mode (to prevent unexpected surprises), and
appropriately quotes the variable (to ensure forward compatibility
with Ansible 2.0).

Finally, the use of lxc_container_caches in the test configuration
has been removed as it is no longer used.

Change-Id: I420382fd3bbbb5fcae90ae0c6160233202a1a51a
2016-05-18 18:14:17 +01:00
Travis Truman 5889c8f4af Linting task should lint this role and all dependencies
This is a common pattern in many other independent role
repositories and should be consistent across all of them.

Change-Id: I8ca656ceebf04aade2b3e9a677cf2ccd2c52f388
2016-05-04 09:49:20 -04:00
Jesse Pretorius 57d5aa5c08 Add reno scaffolding for release notes management
Change-Id: Id3ef5367da6d2cc18a1622505e2b5a8d560a217c
2016-04-09 19:18:46 +01:00
Kevin Carter fe999d1715 Resolve bad assumptions about the base OS
The change moves several tasks around and adds packages to the install
process which were previously assumed to be present on the base OS.

This also updates the lxc-net-bridge template to be more configurable
to address issues where the base OS is more minimal than previously
expected.

Change-Id: I3c8225124a5f18db81259e1d52d0168ef52c3c17
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-03-04 21:04:11 +00:00
Jesse Pretorius 76cc8fd362 Update tox config and add bashate E006, E040 exceptions
This patch updates the tox.ini the same bashate exceptions as are
currently in the OpenStack-Ansible playbook repo.

It also ensures that the linters and all lint targets work
appropriately and normalises the tox.ini configuration to use
uniform formatting.

The use of ansible.cfg is removed as there is no way of being
certain which paths can be used without reverting to an ugly
sed hack in the commands. This is why it is preferred to make
use of environment variables which make use of tox's default
substitutions instead. It's a more reliable way of achieving
the goal for the purpose of gating and testing.

The switch to using a git clone instead of ansible-galaxy to
download the plugins is due to the path spec not being able to
work in Ansible 2.x. [1]

[1] https://github.com/ansible/ansible/issues/13563

Change-Id: I1df29fe1f9c2ee2e5370c4dd9f733ae2c697608e
2016-02-12 11:36:17 +00:00
Jesse Pretorius 90c9d9fa0d Revise all lint tests and add consolidated 'linters' tox environment
OpenStack-Infra has requested that lint tests be pipelined into the 'linters'
tox target in order to make more efficient use of nodepool resources.

This patch:

- Ensures that a complete set of lints tests is available in individual
  tox targets.
- Adds a 'linters' target which executes all the other lints tests.

Change-Id: I5c844b8f9e8bdfd10dc1a9a799b0e55c45a5a42f
2016-02-03 13:30:16 +00:00
Paul Belanger a918e83486 Switch to testenv:functional
This brings our tox.ini files inline with other OpenStack projects.

Change-Id: Ied8a032326141df5e1a7cb0c790f6db738da1efe
Depends-On: I376e51824c46f9b5eb4a4cff01aaa176632087dd
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2015-12-18 15:41:47 -05:00
Jesse Pretorius d1a5d45c78 Merge bashate/pep8 lint jobs in common job
Instead of launching two separate build jobs in our CI infrastructure,
one for bashate and one for pep8, launch a single one. While the jobs
are short, the setup of the images takes a long time, so this is
friendlier to our CI infrastructure.

Use the pep8 environment as common lint target and merge the bashate job
into it.

This patch also renamed dev-requirements to test-requirements to bring it
into line with all other OpenStack projects.

Change-Id: I7268b76b48c95e110f141e678d8ad87e0be6b057
2015-12-15 10:35:49 +00:00
Jesse Pretorius f7f29d93d0 Update run_tests to be more complete
This patch updates the run_tests convenience script to make it
execute all test environments using tox, but also ensures that
all the correct pre-requisites are in place before doing so.

Change-Id: I7c269971f453a79787c3b9fc8d56f513bf2d91da
2015-12-09 13:45:20 +00:00
Kevin Carter eb9f3d858b IRR for lxc_host
The change moves the role out from the main repo lxc_host
repository and into its own standalone repository.

Items within this change:
  * The role has been updated to ensure it runs standalone.
  * Tests added to the role within tox.
  * Functional tests added to the role that can either be run
    via the run_tests.sh script or using tox.
  * dev requirements have been updated for testing usecases.
  * Docs added to both the README.rst file as well as the docs
    folder.

Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2015-11-03 04:22:57 -06:00