Adds bandit configuration template and exclude some of
tests that we don't want to fix for the moment.
Keeping job unvoted so that we can keep an eye on possible
issues while not breaking gate.
Change-Id: I092d686ba38723d7951e8f06415f28cc809ad365
Story: 2005791
Task: 33563
the imagebuild/common/generate_upper_constraints.sh
is currently failing as the curl command in this file does not
handle redirects.
Instead of allowing redirects, use the proper current link to the
upper constraints file.
Change-Id: I92c5bfa65ba149687f61172c2a89ff38660a58cf
According to Openstack summit session [1] stestr is maintained project
to which all Openstack projects should migrate.
Let's switch it then.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Also adjust requiremenst to past the gate checks.
Change-Id: If7a0ebd9cca26cb67eb2ec9036d0aa2693fdffbf
Signed-off-by: Chuck Short <chucks@redhat.com>
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: I3c8e5c663a3fd881430f84fc502e46192de77fc7
W503 according to the [1] pycodestyle docs is not supposed to be
enabled. But it is.
W503 is something we will likely never enable as it is a personal
style decision and can change depending on the code. There is no one
right answer. Interestingly there is also a W504 which is the opposite
check.
[1] http://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
Change-Id: I1025f21a57837e97280f82baba50fdd823a190cc
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: I8d773d4ee3d0835fb2a9183fe2154e82db085bd5
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Curly quotes usually input from Chinese input method.
When read from english context, it makes some confusion.
Change-Id: Ife984be980a4235d9b14152143e2b3540e414751
Don't create *.pyc files during unit/functional tests as they just add
cruft during tox runs.
This is similar to what we already do in openstack/ironic
Change-Id: Id4364519903db20308f78f2aaeca3ad2d37b298a
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: I005d85b7d8f84f5471db3c3da279c5cf9cf13d4e
The Zuul v3 job is looking for the log files from the release notes
in: .tox/releasenotes/log/ but we had then in .tox/venv/log/
Fix it to where the Zuul v3 job expects it to be.
Also updated the 'docs' job, even though job isn't failing. If the job
did fail, with current setup, no log files would be copied which would
make debugging more difficult. This change will make it so the log
files are copied.
Change-Id: I5c036db1a9e94ca28e26fd7b45475d52223f5f0e
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.
Inspired by the patch of the same name in openstack/ironic
Change-Id: I2c1b271550629437627f3f62b6f33e2beb2b3c4b
Enable the following off-by-default checks:
* [H204] Use assert(Not)Equal to check for equality.
* [H205] Use assert(Greater|Less)(Equal) for comparison.
* [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in
mock.patch/mock.patch.object calls
Increase the version of hacking in test-requirements so that can use new
off-by-default checks.
No changes to code were required.
Change-Id: I98aa484dc5414ee49c281dfd40e44b3c613d53e0
On some platforms using ’ instead of ' causes problems for
tox to be run. This patch fixes this at the same time not
causing any readability issues.
Change-Id: Icf8e4a9aa42dce64afb0d15ca7ff005478dbbfa7
Uses oslo_debug_helper to run up the tests in single-threaded
mode so that pdb works.
Examples:
# Run all tests.
tox -e debug
# Run a specific test or set of tests.
tox -e debug module.to.my.test
Change-Id: I272f6aa34bafcd7ac2d2828cbd6dd48e0e615b79
Specify 'ironic_python_agent' as the name of the application for the
flake8-import-order plugin. That way it knows that imports of
ironic_python_agent should come after external libraries.
Change-Id: Id39d558a51aeb97d96633afea28676634547d0d7
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: I946457e9079ce0b54c7fe0ad554d024a1c61dce0
The old generate_sample.sh is broken already as it refers to
non-existing openstack/common path.
Let's use oslo-config-generator as many other OpenStack projects do.
Also, where applicable, option descriptions are updated with the
corresponding kernel parameters to set those options durig pxe boot.
Change-Id: Id4a0df30ea573d52f3b359f357fe8f4a29751939
Updated file tox.ini allows to check code style in all ".sh" files
included in Ironic Python Agent. Checking can be invoked by calling either
"tox" or "tox -e pep8".
Change-Id: Ie76605737c7db10a064f2aebfda388372a4c0591
Closes-Bug: #1625215
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: If22ad272c332f30624ce10861408d377908b152b
Depends-On: I2aa44b62f900d4dfd67701b01eadd0523fbfaf07
This patch forces the use of the en_US locale for tests run.
This is done to avoid tests failing due to message translation.
For example:
When asserting if the message of an exception is correct, those are
usually hardcoded in the tests.
Change-Id: Ia8068b454f1461f17994733afc57337f4b017460
Since we're running python 3.5 tests now, we should also be
running them when running all tests with just `tox`.
Change-Id: I3f57abcbeaa3550f49d56f08140a34d6989885c9
This prevents the pep8 to check python files that are
in the tinyipa tinyipabuild and tinyipafinal folders
Change-Id: Ieea899d618d5225403ceafae60359d5cb4d9c6c5
This configures tox to use upper-constraints for everything, except
environments used for post jobs (as constraints aren't supported there
yet).
This also doesn't enable constraints for our image builds, as it isn't
possible to pass an environment variable into the Dockerfile to allow
folks to choose their own constraints file (and we don't want to force
people to rely on git.o.o for building images).
Change-Id: I285855c6386f59e9dd352473aa28463109818c90
ironic-python-agent coverage was broken, tox -ecover printed error
messages. This change fixes the coverage command to work reliably, and
adds the directory generated by the job to gitignore.
Change-Id: I36656c17c13b5b4bce8e7eca2ec0f12c1bf76f29
This commit switches the tox command to use ostestr instead of calling
testr through setup.py. The primary advantage here is that it uses the
subunit-trace output filter. ostestr primarily exists as a replacement
for pretty_tox.sh bash scripts which spread like a plague through
OpenStack projects after Nova copied it from Tempest. (although ostestr
also provides some other useful features) Granted ironic wasn't using
that, but this commit makes the switch to enable getting the
subunit-trace output which is generally useful.
Note that this dramatically increases output while running tests.
However, test failures are still at the bottom of the output, so it
shouldn't cause much pain, if any.
Also remove requirements.txt from tox.ini deps
This is redundant, per lifeless email:
http://lists.openstack.org/pipermail/openstack-dev/2015-July/069663.html
Change-Id: Ia9e3000ddfe02979c26807ae5d130bfd2730c5e1
This adds additional functional tests for the commands API.
It also restructures the current functional test to run in
sequence as a monolithic test to preserve IPA state and test
order between test runs. The time to wait for IPA to start
was increased due to an intermittent race condition that
occurs with the larger test suite.
Partial-Bug: 1492036
Change-Id: Iff9b41fb531d34225d702b9bfd39826e3c7195ad
Bring ironic-python-agent in line with the other ironic projects.
Stop ignoring all E12* errors except E129
Stop ignoring E711
Change-Id: Icb9bc198473d1b5e807c20869eb2af7f4d7ac360
This uses the doc8 style checker to check that document files
conform to certain requirements, as documented at
https://pypi.python.org/pypi/doc8.
The README was modified because it had several lines that were
were longer than 79 characters, and some links were fixed.
Change-Id: Ia21b680ec227357ada58326fea104696561475d5
Moved tests/extensions to tests/unit/extensions, otherwise they
wouldn't have run. Renamed the files in tests/unit/extensions to be
prefixed with 'test_', to match the rest of the test files. Did a
general clean up of tox.ini so we have standard whitespace.
Change-Id: I5615bfbf2d6ff4a4bc3e66e71c2472b0d1e3a2d7
Starts up an agent in a thread and then runs functional tests against
it.
Add the first functional test of the API: a simple test of the
commands API.
Co-Authored-By: Mario Villaplana <mario.villaplana@gmail.com>
Change-Id: If4ad611929d388a2a9454224646cb296bd0ba0ce
Remove the specification in tox.ini that _ is a builtin so that
it will no longer assume that _ does not need to be imported.
This helps ensure that the _ from i18n is used.
Activating this check did not flag any violations.
Change-Id: Id555b593cff19d7c741b4233182837def685317a
This patch add Python 3 support for IPA. We still need to enable it on
gate to avoid code breaking the support from sneaking in.
Partial-Bug: #1474896
Depends-On: I5a774eaa8d978f4d50faca4dc1b03a87fb194ce2
Change-Id: If47c0797b63d2914b3c47aba62ec5201301b6c33
All other openstack projects use docs environment, use the same
name for ironic-python-agent as well.
Change-Id: I3315e111bd5994d2af2a7a2d0079a09e3d4e4d8b
This adds and configures a sphinx doc builder. This is based on the code
in Ironic to build documentation.
The goal is for this to contain development documentation relevant to
hacking on the agent, including how to make custom HardwareManagers.
Change-Id: Ib6cecb9959f4ad5c71440fb37827b996582a9545
The current script used to inject the IPA container into CoreOS is
not pep8 compliant, has requirements that are not in
global-requirements, and never has tests run. Now requirement on
plumbum is removed, script is pep8 compliant, flake8 runs against the
script when tests are run.
Closes-bug: #1337551
Change-Id: I14d3e46e60c4e072f34f80dc50d7214079953f49
PyPy has been failing locally for a month or two. On Ubuntu 14.04:
"No module named _bsddb", on 12.04: "Not a .py file:
/data/dev/work/ironic-python-agent/.tox/pypy/build/setuptools/
setuptools/cli-32.exe"
PyPy isn't enabled as a job in the gate yet (even non-voting). Until
we sort the gate out and fix the above errors, we should remove it
from the default tox runlist.
Change-Id: I34c0a72edebc296b79c6058e64ffb98f60979bcb
Also fixes tests that were broken on PyPy.
Co-Authored-By: Jim Rollenhagen <jim@jimrollenhagen.com>
Change-Id: I2554aa844b040c4c74cbf287dccb06d816a39dbe