When running the tox tests, use the default version of Python 3. Instead
of having to update the Python 3 version as we move from
py34 -> py35 -> py36 -> py37 -> py38
Just use the default version of Python 3 on the system.
This will not affect what gets run in the gate, as the version is
explicitly specified when it runs there. This is for developers who run
the tests locally.
Change-Id: Iab9cd250dafb42f775f50bec2c69eaa2daaab574
Pep8 job currently fails complaining about I202 in a bunch of
modules. This change fixes the genuine errors in the module
import order, and adds I202 to the skip list so that we don't
have to add noqa comments everywhere we can not satisfy the
check. After we split out the tempest plugin, we'll remove
I202 from the ignore list and add noqa comments in the places
where it will still be needed.
Change-Id: Ia170a41d35dea8c9eda2b36c907dbc518169a824
Recent update brought os-testr 1.0.0 that already uses stestr test
runner instead of testrepository.
This patch migrates those places using testrepository to using stestr.
Change-Id: I793617e042b38aea4cb177b51b6a7ba4a9268f3c
Update test-requirements.txt to use latest versions of:
* flake8-import-order
* hacking
Enable the following off-by-default checks:
* [H204] Use assert(Not)Equal to check for equality.
* [H205] Use assert(Greater|Less)(Equal) for comparison.
Fix code that failed H204 and H205. In this case the fix was to add:
# noqa
As we want to ensure that these particular tests are calling the
desired comparison operators.
Change-Id: If9cba62c832e301ac81320f9142e91319f0e40a9
When Python 3.6 is used by default (the case for F26), the build fails:
TypeError: '<' not supported between instances of 'NoneType' and 'str'
It is reported as bug 1714025, let's use Python 2 until it's fixed.
Change-Id: I8c2ba5b587b2919a22ff1d0f078c511d90de0f91
Related-Bug: #1714025
Newer operating systems, like Fedora 26, ship with Python 3.6 now. So
they can do a Python 3 test, add 'py36' to the default envlist.
Change-Id: I9bbca0d18c346fe0cfcb9878cd35632dbd998fb0
This patch does the following:
* Adds a configuration folder to contain automated generated config
files for Ironic.
* Adds `oslo_config.sphinxconfiggen` to the extensions list.
* Adds `oslo_policy.sphinxpolicygen` to the extensions list.
* Adds ironic-policy-generator.conf
This is important for Ironic to be included in the list of services
on https://docs.openstack.org/pike/configuration/
Change-Id: I51a7204ce00be2588e427c1951e8be7dc7a22647
Closes-bug: #1706176
It is a long known issue that tests for py3 can not be run after the
tests for py2 were, unless times.dbm is removed.
Related-Bug: #1229445
Change-Id: I32b62e6d870364554ec20c1acce88fa59b85881d
Specify 'ironic' as the name of the application for the flake8-import-order
plugin. That way it knows that imports of ironic should come after external
libraries.
Change-Id: I3e6fb237b9846e8de1a071f3a659c23c44bc7f75
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.
Change-Id: I821fd7467f6c5cc1487149297f26e4ad539cf25d
We mock out driver libraries in unit tests if they are not installed,
which leads to a periodic break in unit tests when they are actually
installed in the environment. This is sometimes a real break and
sometimes just a bad test, but at any rate it slows down packagers
and actual users.
Add a new tox target that runs unit tests with these installed,
so that we can put something in CI and stop breaking this.
Partial-Bug: #1626106
Change-Id: I81ce147c8958bb89b316c3c28fc9bce172f93873
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. So we can drop py34 environment from tox.
Change-Id: I5e4ed5b4e8e90266813c047d6502d2e7f9b7eb59
Use hacking 0.12.0
Use the new checks that are available:
[H106] Don’t put vim configuration in source files.
[H203] Use assertIs(Not)None to check for None.
[H904] Delay string interpolations at logging calls.
Fix code so tests pass.
Change-Id: I902e999687b066800e18fafd091571bf718b15f4
Depends-On: I2aa44b62f900d4dfd67701b01eadd0523fbfaf07
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.
Note: this copy from 1be35ff039d67c50866f2556ef847b048cbf3578
Change-Id: Iac2fc6fdbf9596209ab44fa2274bd66620043a49
Before bashate was only running on the devstack/ directory. Have it
now run on the entire project for *.sh files.
Fix issues detected by bashate.
Also check the files:
devstack/files/hooks/qemu
devstack/lib/ironic
These files were located by doing:
$ find openstack/ironic/ -not \( -type d -name .?\* -prune \) \
-type f -not -name '*.sh' | xargs file | grep -i "shell script"
Change-Id: I238b7ab650781143fe8231e01250ab56120ff94f
This installs the basic directories and content pointing to the current
Ironic Installation Guide. Simply having this in our repo will not lead
to it being published, this is only the first step. Having these items
in our repository is a good first step to building out our install
guide.
Change-Id: I6a0e69bd3b6f5074ae61505f82f27bcf9df84bab
Partial-bug: #1612278
Implements more fine-grained policy support within our API service,
following the oslo policy-in-code spec, while maintaining compatibility
with the previous default policy.json file. An empty policy.json file is
included, along with a sample file listig all supported policy settings
and their default values.
A new tox target "genpolicy" has been added to ease automation of
sample policy file generation.
All calls to policy.enforce() have been replaced with with
policy.authorize() to avoid silent failures when a rule is undefined,
because enforce() does not raise() if the target rule does not exist.
NOTE: policy.enforce() is not removed by this patch, but a deprecation
warning will be logged if it this method is invoked.
Updates unit test coverage for the new authorize() method, as well as
more general unit test updates for some of the new rules.
Partial-bug: #1526752
Change-Id: Ie4398f840601d027e2fe209c17d854421687c7b7
Since we're running python 3.5 tests now, we should also be
running thme when running all tests with just `tox`.
Change-Id: I6ec077878906fd48e9e4dc654c63da3dbc83173b
oslo_config provide a utility for generating sample config files,
which provide more detail about opts, like Minimum/Maximum value
and Allowed values.
So drop Ironic's "generate_sample.sh" which was copied from
oslo-incubator long time ago.
Add a new entry point "ironic" under oslo.config.opts namespace to
explore config options to oslo-config-generator.
After this patch, new config options of Ironic code should register
with ironic/conf/opts.py. New external libraries should
register with tools/config/ironic-config-generator.conf
There is a bug #1554657 with oslo-config about deprecated_group.
This bug have impact of some configs from keystonemiddleware
and oslo.messaging in ironic.conf.sample
So currently, deprecated option should always add the deprecated_group
even it didn't alter the group, otherwise the deprecated group value will
be 'DEFAULT'.
Update etc/ironic/ironic.conf.sample via running 'tox -egenconfig'.
Closes-Bug: #1564195
Change-Id: If7721e98e69b6f54f1ee04a07477396b86583371
This updates the API root documentation, which was non-existent,
and the Node documentation significantly, replacing many of the samples
and adding more verbiage to each property.
It's not perfect, but this is vastly more correct than the current docs.
Change-Id: Iaeb1c80ac0655fc0d73fa495ed43e3c02b345495
This currently gives a warning about the 'rm' command not being
installed in the venv. Whitelist bash and run rm under bash (like we do
with other external commands) to squash this warning.
Closes-Bug: #1581778
Change-Id: Id26926ad7a75b94f0f57ea3c2083312c66663b34
Per this email[0], it's time to migrate our API docs into our tree.
This copies the sphinx extension from nova into our tree as well, which
will be later split into its own python module. At that time we can cut
over to the module and drop it from our tree.
The conf.py and the tox environment are also cribbed from nova.
[0] http://lists.openstack.org/pipermail/openstack-dev/2016-May/093765.html
Change-Id: I683cc4d6459d77c42951a06247b6f9ff8f8456bd
This will force pip install to use the upper-constraints.txt specified
version of pip modules. When you don't do this, you are out on the
bleeding edge and become unstable everytime some python library in the
wide world changes in a way that you don't expect.
Post jobs are not yet compatible with the upper-constraints file, so
override the install_command there to skip upper-constraints.
Blatantly cribbed from the equivalent trove patch:
https://review.openstack.org/#/c/298850
Change-Id: I73aa8cf37adc36db2c56a8f29ea165775a83dc7f
Closes-Bug: #1563038
This patch is enabling the D000 error (duplicated target names) in doc8
and fixing the occurrences of this error in the docs.
Change-Id: Iac048d213e0571b99696ec708f5c07d6e1bebb19
This patch is enabling the doc8 style checker for the *.rst files in
Ironic.
Since this patch is just the first stab at enabling this new check two
errors are currently being ignored by doc8 because of the number of
occurrences in our docs:
* D000 - Duplicated target names. We do have many links with generic
names scattered around the docs (e.g "see", "link")
* D001 - Line's too long
These errors will be fixed in a following patch.
Change-Id: I32fb5a3104b9773c55a80a84dd81e49c567c76ac
This makes tox use a simple wrapper around flake8 like
Nova, which can be told to restrict the check to only
files changed in the current command. This can be invoked
in a simple manner with 'tox -epep8 -- -HEAD'. Since most
commits only touch a handful of files, this will usually
be far faster than checking all source files.
To check an entire branch for bisectability it can be
automated via
git rebase -i master -x 'tox -epep8 -- -HEAD'
Change-Id: I75b1cfe3198b1217f8b25877714a4af47ae7069f
This removes 'bashate' from the envlist in tox.ini because it doesn't
cause bashate to be run. Rather, it causes 'tox' to run the unit
tests :-(
'tox pep8' will invoke bashate.
Change-Id: I235ed7b20b45f2052f0ca0e9e4d96e379667b567
Ironic remove oslo incubator (ironic/openstack/*), so removes
them in flake8 too.
A follow-patch on d7741ea1eebde2fb9966dd53372eb8655bdb12ac
Co-Authored-By: Tan Lin <lin.tan@intel.com>
Change-Id: I9d8fd28f53e8b4bc289a1015e464585b8bdeebd9
This patch allows flake8 to run against the scripts under tools/ and
devstack/tools directories.
It also fix the current pep8 errors where it's needed.
Change-Id: I3f447564dd528c6efdee10a4a13f1ff1d7e1c3b1
Apparently # is treated as a comment inside the string and as
consequence the rest of the command gets stripped. This patch drops
those comments from the bashate command.
This patch also moves the bashate command to its own script under
tools/.
Change-Id: Ic44bb64419ca1465f69c91fd579e8c84d69f84b8
Closes-Bug: #1527562
In order to save gate resources we could just run bashate as part of the
the pep8 command.
The tox bashate command is removed and bashate is added as a dependency
in the test-requirements.txt file.
Change-Id: I75df4103c0154c5424b8781c1db3480336a5e1d2
This patch is fixing the syntax errors/warnings in the shell scripts
under devstack/tools and add that directory to the tox bashate command.
Change-Id: I957a88f5b7009fe92078eb3d53e225943d28a539
Partial-Bug: #1526518
Now that we copied the devstack code to our tree we need to ensure that
the bash scripts we have are correct. This patch is adding a tox command
(bashate) that will check the syntax of the shell scripts under
the devstack/ directory.
The scripts under devstack/tools/ are not being checked, that's because
they weren't check when the code was in devstack as well and there's
loads to fix. It will be fixed in a following patch.
Change-Id: I8f66492081e0fd10e1de057febb9324a81411c7a
Partial-Bug: #1526518
This patch applies the instruction in [1] to ensure that the release
notes render properly and without warnings by adding "-W" to the
sphinx-build line in tox.ini so that Sphinx can treat warnings as
errors.
[1] [openstack-dev] [release] better linting of release notes
http://lists.openstack.org/pipermail/openstack-dev/2015-November/080521.html
Change-Id: I64c05014e88a48b6336ce92c87da47dbe34b20d8
Mostly cargo-culted from I9549e6b491b26232f4dac900b0bf05f10eb0e30a.
Note that reno automatically inserts version numbers; liberty.rst is
sufficient for intermediate release models.
Change-Id: Ic700d719242b17532b0b43a68b7eff507cb3a43c
After the move to os-testr the 'tox -epy34' unit tests will fail when
LANG=C is set in the environment.
Set LC_ALL=en_US.UTF-8 in the testenv to solve the issue. This is
in-line with our curent method of running the unit tests in US English
so that logging, messages, and exceptions can be validated by unit
tests.
Closes-Bug: #1501415
Change-Id: Ifefdd67c9e5edf22f3b7a1fce56f21c788ac9ead