186 Commits

Author SHA1 Message Date
Andreas Jaeger
37a83c1ede pep8: Enable E226
Enable
"E226 missing whitespace around arithmetic operator"

And fix problems encountered.

Change-Id: I90cbf6220f487a0808e13cd3998c8127be563498
2020-04-30 16:42:53 +02:00
Andreas Jaeger
7f770b95b8 Update pep8 rules
Remove E402 from flake8 list, issues are fixed or addressed with noqa.
Remove E305 as comment, the warning is enabled.
Enable E241 and fix all problems

Change-Id: Ifd2bbce98be4206908da769df686a370328c7ee1
2020-04-30 16:33:43 +02:00
Hervé Beraud
c9eaca9e59 Prepare the six and python 2.7 support dropping
With python 3 the input function is safe.
The six dropping will re-introduce the usage of the input function
and bandit checks will fails.

We drop python 2.7 support so we ignore the bandit check B322 [1] before
starting to drop six support.

[1] https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b322-input

Change-Id: Ie956a65ebc4c781c5e661e8021f674833be8b323
2020-04-22 12:23:44 +02:00
Zuul
d4c7e27a7e Merge "Fix hacking warnings" 2020-04-18 23:00:18 +00:00
Zuul
c83e37f26c Merge "Update hacking for Python3" 2020-04-18 12:44:22 +00:00
Andreas Jaeger
57eb87149f Fix hacking warnings
Fix some warnings found by hacking and enable them again.

Change-Id: Ia09de4d0fda752a009b9246b4e6d485601cd9562
2020-04-16 06:43:27 +00:00
Andreas Jaeger
a27dc56f52 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Update local hacking checks for new flake8.

Ignore new warnings, they will be fixed in followup.

Remove hacking and friends from lower-constraints, they are not needed
to be installed at run-time.

Add Pygments to lower-constraints to pass requirements-check.

Change-Id: I20da1309e4d65707130fe517f013d3ed625bf94c
2020-04-16 08:41:49 +02:00
Pavlo Shchelokovskyy
31ea2fcde1 Fix genconfig tox env
we no longer keep configuration for in-repo integration tests in the
repo, relying on heat-tempest-plugin instead.

As a result, currently the `tox -egenconfig` is broken as it tries to
generate config sample calling non-existing config.py module.

Change-Id: I48685d7c791d98db83a7cbcf4ef926ee25ca62a4
2020-04-09 09:12:09 +00:00
Andreas Jaeger
97db901658 [ussuri][goal] Finish dropping python 2.7 support
OpenStack is dropping the py2.7 support in ussuri cycle.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

This change cleans up:
* remove old requirements
* remove universal wheel building, we don't need this for py3
* cleanup setup.py
* tox.ini: move basepython around; remove install_command since the
  default is fine and constraints should be in deps; add
  ignore_basepython_conflict

Change-Id: Ife0a696ca62be21d3d93c5d8279a412578f62697
2020-02-06 18:58:12 +01:00
Zuul
28ce9f3ad4 Merge "tox: Keeping going with docs" 2019-12-20 05:26:43 +00:00
Zuul
55d7b1327a Merge "PDF documentation build" 2019-12-05 06:20:45 +00:00
Zane Bitter
e0dbb3f7fa Drop Python2 support
Change-Id: I6f248dfd82502ef225ba755246c2de385d30f4b2
2019-11-06 16:55:41 +08:00
caoyuan
eb10545b37 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. Add whitelist_externals to fix the warning

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

Change-Id: I47683ab1313981a8202afe6b3fe1779d40340452
2019-11-01 11:30:12 +08:00
matthew-fuller
debff05779 PDF documentation build
This change provides the necessary modifications to enable
building of pdf documentation. The resources.py extension
required modification to:
  - prevent attributes from being rendered as stray \items
    outside of a list environment
  - prevent update policies from being rendered as stray
    \items outside of a list environment
  - remove the 'Note:' admonition around the 'Not implemented'
    message when it applies to a sub-property, such as a list.
    The admonition was not rendered as a list item, causing the
    build to fail due to an empty list.

Change-Id: Id4e533430600b5ff03fd63cdc09b9a00741b8e4e
2019-10-01 08:57:22 -07:00
Andreas Jaeger
208cdfea39 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: I69a41aa850c87e92bf5c3e7fed32e0e961a3c6d3
2019-07-22 18:55:34 +02:00
Elod Illes
d116b21696 Add local bindep.txt
As it was announced [1] global bindep-fallback.txt was removed and now
projects need to have a local bindep.txt to be able to install binary
dependencies for testing.

In test jobs the script tools/test-setup.sh is called which requires
mysql and postgres servers and clients to be installed.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html

Change-Id: If9befe4115c64c2fda52321002ba5fe1124eaf7c
2019-06-26 17:48:15 +02:00
ZhongShengping
f66dac5c63 Update Python 3 test runtimes for Train
This goal is to implement the process set out in the 2018-10-24 Python
Update Process TC resolution[1], for the Train cycle to ensure unit
testing is in place for all of the Tested Runtimes for Train[2].
In practice, this generally means adding unit tests for Python 3.7 and dropping
unit tests for Python 3.5. Using the Zuul template for Train will ensure that
all projects that support Python3 will be tested against the agreed runtime
versions, and make it easier to update them in future.

[1]https://governance.openstack.org/tc/resolutions/20181024-python-update-process.html
[2]https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I62abb218bb314345dd7da1cbf9133d10db9696ff
Depends-On: https://review.opendev.org/#/c/641878/
2019-05-09 17:35:06 +08:00
Zuul
38e43a0071 Merge "Dropping the py35 testing" 2019-05-04 16:01:58 +00:00
Rabi Mishra
86e41a8a8f Fix upper-constraints.txt url
Wrong link used in commit 203bce9cd7449ef09a8777a4761f71518da3ed72.

Change-Id: I90cf7584830afccdd0028b0ed7e5061e67430815
2019-04-24 08:52:03 +05:30
ricolin
203bce9cd7 Switch to use opendev.org
Our cgit instance will be going away and opendev.org is the new
preferred URL for browsing our git repos. Redirects will exist for the
foreseeable future, but it's more efficient to just go directly to the
new locations.

Change-Id: Ic5fa1a8436f57836ad37b752a0cca1cd4f3a21a7
2019-04-22 09:36:50 +05:30
Ghanshyam Mann
132457d447 Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I9ab70c74eeff509410d90f4305af116d83420f45
2019-04-14 21:54:27 +00:00
Rabi Mishra
87b4a92a62 Fix lower-constraints tox env to use proper constraints
- Bumps some of the lower constraints
- Fixes common/endpoint_utils.py to fallback to use auth_uri.

Change-Id: Ief0868d5feef3ee6b0689c6be27649ff009fbbcc
2019-04-10 09:11:56 +05:30
Doug Hellmann
8ae5f8657b change the dist name to 'openstack-heat'
We are updating all Python projects to publish artifacts to PyPI. The
name "heat" is already taken there by another project, and they have
rejected our request to claim the name. We therefore need to change the
dist name used to package heat. We have some other projects publishing
using an "openstack-" prefix, so I propose using the name
"openstack-heat". This will not change the imports or anything else
about how the code works, just how it is packaged.

Add a grenade plugin for upgrading between the packages with different
names so that we can clean up the old version of the code and avoid
discovering the heat plugins multiple times in different locations.

Change-Id: I59b55cffd9e648f842eb286b936f09c5b55a76db
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-11-01 11:54:05 -04:00
Nguyen Van Trung
d60514f86e Don't quote {posargs} in tox.ini
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')

Change-Id: Iccbd680731592abab4980a51aa97c60d6ef95005
2018-10-09 10:13:15 +07:00
Zuul
fc2e49d834 Merge "Support py36 for test in tox" 2018-09-05 21:33:23 +00:00
ricolin
7991199542 Support py36 for test in tox
Ubuntu Artful and  Fedora 26 already ship Python 3.6 by default
(And Bionic and F28 have been released since then.). Considering
better support of python3 with system, we should enable py36 for test
environment.

You can find some discussion in:
http://lists.openstack.org/pipermail/openstack-dev/2018-June/131193.html

Depends-On: https://review.openstack.org/#/c/597267

Change-Id: I0187e862c0b74dbb836d36e7062ccc9e47a51cc2
2018-08-29 04:38:22 +00:00
Dao Cong Tien
e8824a2c93 Adds doc8 check to pep8
This patch adds doc8 check for .rst files to pep8.
Files that fail doc8 check are also fixed.

Ignore D001 of doc8 check. This requires lot of changes and
should be done in a separated patch.

Change-Id: I7732abc55ec27026efbf56663ba02ff27e8ec847
2018-07-26 14:57:58 +07:00
Zuul
bea5084ea8 Merge "Docs: Eliminate warnings in docs generation" 2018-07-23 16:43:14 +00:00
Zuul
f08a2f0134 Merge "fix tox python3 overrides" 2018-07-04 14:09:51 +00:00
Zane Bitter
76ec5af884 Docs: Eliminate warnings in docs generation
Fix all of the existing sphinx warnings, and treat warnings as errors in
future.

Change-Id: I084ef65da1002c47c7d05a68d6f0268b89a36a7a
Depends-On: https://review.openstack.org/553639
Depends-On: https://review.openstack.org/559348
2018-06-21 16:38:47 -04:00
Doug Hellmann
55d1f4006c 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: I6dde50de599eb3b6b001cbc044929c64df044575
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-13 15:00:48 -04:00
Zane Bitter
8f76a10cae tox: Don't delete Python3 .pyc files
Python3 is smarter than Python2 about when to make use of .pyc files, so
there's no need to remove them before running unit tests just in case the
developer has switched branches.[1] To save recompiling before every test
run, disable this behaviour for Python3.

Also, use a consistent find command in all of the environments where we do
this.

[1] https://www.python.org/dev/peps/pep-3147/#case-3-pycache-foo-magic-pyc-with-no-source

Change-Id: Iabaa4a697329e7538fab93541f41fc208e591382
2018-03-28 21:36:37 -04:00
Doug Hellmann
337d83ccde add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I72fd5f8c87133713cd272de210b7e957880f48f9
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 12:40:31 -04:00
ricolin
e82bb7f330 Create doc/requirements.txt
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html

Refer to:
http://lists.openstack.org/pipermail/openstack-dev/2017-November/124815.html

Change-Id: Ifdfdaacad8574fcfcac9c1b52b0bed6fed4f8411
2018-03-16 00:38:09 +08:00
rabi
f91686c3a7 Fix coverage run with tox -ecover
We removed .testr.conf in 93746a9b2895d44fd105ba26ae77ddffbe2db167
and tox -ecover fails with error.

Change-Id: I31b00afffe38ab5c7591ba54c959349716df7c48
2018-02-07 12:50:07 +05:30
Zuul
04be5a736e Merge "Remove CloudWatch API" 2018-01-31 19:29:03 +00:00
rabi
6d55417f80 Remove CloudWatch API
This patch removes the API, the next set of patches in the
series would remove stack watch service and related
WatchRule implementation.

Change-Id: I8b0472be862907298c8da51f435b5d8b19610ec3
Partial-Bug: #1743707
2018-01-28 09:11:17 +05:30
ricolin
41cc012b34 Allow run tests for both tempest plugin and regression tests
Regression tests will be maintained in-tree. See categries list:
https://etherpad.openstack.org/p/heat-integration-test-categories

We will seperate tests to tempest plugin or in-tree base on conditions
of each tests. So we need to rework on framework for integration tests.
This patch propose following changes:
* This partially reverts commit fff6518e69d19c7946942d1bd7c68e2b76c15966
* Allow running heat tempest plugin and heat regression tests.
* iniset configs to both heat_integrationtests.conf and tempest.conf

Change-Id: Ief31dc961bc108e2863119598dfb16581a38e9cf
Depends-On: I5e9325766ce166e62c731330c462c030cb1e11fc
Co-Authored-By: Zane Bitter <zbitter@redhat.com>
2018-01-19 13:26:25 -05:00
rabi
93746a9b28 Use stestr for unit tests
Change-Id: Ifaf3991e1c9400683e9c98185b86cb39ac3d318d
2017-12-15 12:39:37 +05:30
ricolin
b171490450 [policy in code] Part 1 Base framework
This adds the basic framework for registering and using default policy
rules. Rules should be defined and returned from a module in
heat/policies/, and then added to the list in heat/policies/__init__.py.

new policy wrapers `registered_identified_stack` and
`registered_policy_enforce` has been added for policy enforcement of
registered rules with same parameter as `identified_stack` and
`policy_enforce` besides set `is_registered_policy` flag to true.
This flag will decide to use new policy framework or not.

Now we can use `tox -e genpolicy` to check and generate policy file.

Change-Id: I7a232b3ea7ce0f69a5b7ffa278ceace7a76b666f
Partially-Implements: bp policy-in-code
2017-11-21 16:23:11 +08:00
yushangbin
bcc6000093 Remove install-guide env which is no longer effective
The install-guide directory was moved to doc/source directory when
migrating docs.

Change-Id: I312c45314f4e6e86a7f7b74f747eb0bed6d60759
2017-07-31 17:01:11 +08:00
ricolin
d9df974d7d Enable DeprecationWarning in test environments
Many deprecations are triggered early (on imports, for example).
To make sure all DeprecationWarning messages are emitted we enable
them via the PYTHONWARNINGS environment variable.
If we didn't setup this variable, the default action will be not
showing any python deprecation warning.

Change-Id: I78d1c68e51ee0833fd1ff0e9548c41bb9d1239a8
2017-05-17 05:22:45 +00:00
Ihar Hrachyshka
3ae6afa449 Remove subunit-trace fork
This makes tox use the latest version of the tool from os-testr repo,
which contains some valuable changes, like the one making the gate fail
if for some reason no tests are executed because all of them are
skipped.

Change-Id: If88be4b310d746ccc885e3d0c1db8a4dfabb2a28
2017-04-06 11:42:05 -07:00
Jenkins
7c908e220d Merge "Remove bandit.yaml in favor of default config" 2017-03-20 16:29:11 +00:00
Jenkins
df0df78975 Merge "Fix api-ref build with Sphinx 1.5" 2017-03-17 10:10:01 +00:00
Eric Brown
dc5cf45d4b Remove bandit.yaml in favor of default config
Latest g-r version of bandit does not require a bandit.yaml. This
removes the bandit.yaml and skips the same tests that were not
run as defined by the profile before. This patch also puts running
of bandit within the pep8 testenv, consistent with other projects.

Change-Id: I7db8bc460e2051c635dc7b3fd4b152ece80c7a0c
2017-03-10 15:35:48 -08:00
gengchc2
21bf937a4b Remove support for py34 for heat
The gating on python 3.4 is restricted to <= Mitaka. This is due
to the change from Ubuntu Trusty to Xenial, where only python3.5
is available. There is no need to continue to keep these settings.

Change-Id: Ic7b3fb3ff7b68cf280e36335aa9cacd644cc877a
2017-03-10 06:22:01 +00:00
Andreas Jaeger
6529a2ebd7 Fix api-ref build with Sphinx 1.5
Sphinx 1.5 is more picky about some code, it complaints if code-blocks
are not valid json and also about too short underlines.

Fix one json file, fix underlines, change code-blocks to none so that
Sphinx 1.5 builds this again.

Enable treating warnings as errors to avoid regressions. Note that with
current tools there are no double stanza warnings anymore.

Change-Id: I58d1452ffddf091d56dcfad8140caba084800a0e
2017-03-07 09:34:00 +00:00
Zane Bitter
6555455cbc Revert "Using os-testr to get better report"
This reverts commit d7f2d4f23eba13eea6c314bf5fde34df7a4df912.

ostestr spews what is IMHO an unmanageable amount of mostly worthless data when running tests - at least one line per test, of which there are 6351 at last count. There doesn't seem to be an option to quiet it down, so just revert it.

Change-Id: I7b12dc249e3e7041ab6f0ef36b3e5f0b082aeb7d
2017-02-20 20:51:24 +00:00
Aaron-DH
d7f2d4f23e Using os-testr to get better report
As a wrapper of testr, os-testr uses subunit-trace
for output and builds some helpful extra
functionality around testr

Reference link:
http://docs.openstack.org/developer/os-testr/index.html

Change-Id: I5eb1ea062334c06f5e95ef54367e427b98a17bac
2017-02-17 13:17:21 +08:00