Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.
Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.
pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)
For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks
Change-Id: Icd2a9bded756b2bcba1fb7da6abe48503fd9b2d6
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
It's nearly 2020. This should be the default now.
Change-Id: Ia43fb5bf3c7eede7a8f1cf254cd6de8dace25bd8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The oslotest shell scripts were using /usr/bin/python by default, and did
take into account the $PYTHON variable, so one could choose to use
Python 3 instead of Python 2.
This patch looks if a $PYTHON variable exists. If not, then it sets it
to "python" by default, otherwise, it uses whatever exists, so it is now
possible to do PYTHON=python3 oslo_debug_helper for starting tests.
Change-Id: I6df0ac0d84fd964251a1af9e27dadb954a2ad691
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.
This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.
Change-Id: Iafae5f3111c968a4ec2adf63e447459f3ccc41ae
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.
This change adds constraints support by also adding a helper script to
edit the constraints to remove oslotest.
Change-Id: I21e2d0555334a1bd7ad8aa37796f599292b30ed0
Always rebuild the environment where the test is running in case the
requirements list for the project has changed.
Change-Id: I02148398389656d7cf5b811d94ebbbdc32c417fa
If there are no arguments the shift call fails, aborting before we can
report the proper usage instructions. Update the script to check the
argument count before trying to do anything with them.
Change-Id: I3eb7cdf96dcbe6368e2ad0fbc9d0514798292e8e
Rather than maintaining the pre-release runner in oslo-incubator, put it
in oslotest where it can be installed with the rest of the library.
Change-Id: Idd58bfe3950d01725e239608f263dab5a0c9c908
Move the latest version of run_cross_test.sh from the incubator here to
oslotest and rename it so we can publish it as a tool that comes with
oslotest instead of syncing it into the other projects.
Change-Id: I1aec3bda9e46b1667cfd7b68aa2d654327d1c8fb
The `python-*client`'s usually give back the full package name
i.e. python-keystoneclient, and the script assumes thats where
the tests are, but most clients have their tests under just
*client, or in this case keystoneclient.
Oslo projects have a similar issue.
Change the debug script to accept an optional argument that can
be used to override the guesstimated value.
Change-Id: If0a25ae7ab9f854f87271a377dd228e2ebfb107f
To be compliant with Debian policy on naming binary files, the
shell file should not have a .sh extension.
Change-Id: I4549c6942b1367c7e490e48ed275ff6a3bcddfa5
Closes-Bug: #1370488
The Keystone team has been using a home brewed `debug_helper.sh`
file to run tests with pdb support, it's now being also used by
pycadf too. As noted by bnemec [1] we should move this to oslo.
[1] https://bugs.launchpad.net/pycadf/+bug/1354192
To run any test in particular, run tox with -e debug:
`tox -e debug`
It also supports passing in a specific test module, class or case.
The shell file runs testtools underneath the covers to get pdb
support.
Change-Id: Idb715bc137459a2f6d16ac3f65c718a567df49ff
Co-Authored-By: Brant Knudson <bknudson@us.ibm.com>
Provide a script for the devstack-gate hook to run tests to
ensure that changes in this project do not break unit tests
in consuming projects.
See https://review.openstack.org/#/c/76381 for the script
addition in the gate configuration.
Change-Id: I08d8380183c2128c62fa0ca52306950d8076f3c2