summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Adding pre-commitHervé Beraud2020-09-151-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Stop to use the __future__ module.4.3.0Hervé Beraud2020-06-021-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: Ia9cdcfb75cc91dc5f93f02d07ad389c8c7d622fe
* tools: Default to Python 3Stephen Finucane2019-12-182-2/+2
| | | | | | | It's nearly 2020. This should be the default now. Change-Id: Ia43fb5bf3c7eede7a8f1cf254cd6de8dace25bd8 Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
* Invoke correct python version in shell scripts3.9.0Thomas Goirand2019-12-182-8/+10
| | | | | | | | | | | | 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
* Avoid tox_install.sh for constraints supportAndreas Jaeger2017-12-011-30/+0
| | | | | | | | | | | 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
* Add Constraints supportTony Breeds2016-12-201-0/+30
| | | | | | | | | | | | 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 cross-test venvDoug Hellmann2015-06-161-1/+1
| | | | | | | Always rebuild the environment where the test is running in case the requirements list for the project has changed. Change-Id: I02148398389656d7cf5b811d94ebbbdc32c417fa
* Fix argument handling in oslo_run_cross_testsDoug Hellmann2015-06-041-12/+20
| | | | | | | | 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
* Force rebuild egg-info before running cross testsDoug Hellmann2015-02-231-0/+1
| | | | | | | Sometimes we don't get the latest version of the source list if we don't force it to be rebuilt. Change-Id: Ia80a71762a3824bc6c9a63a834e54100b649bd66
* Restore missing module for pre-release test scriptDoug Hellmann2015-02-201-1/+1
| | | | | | | Restore a module missing from the pre-release test script so the version in oslotest is usable. Change-Id: I300318c9e051204677824d52afaa211a91e97bc0
* Move the script for running pre-releases into oslotestDoug Hellmann2015-01-301-0/+211
| | | | | | | 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
* Publish cross-test runner as part of oslotestDoug Hellmann2015-01-301-3/+33
| | | | | | | | 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
* Fix for mktemp failure on osxDavanum Srinivas2014-12-191-1/+1
| | | | | Closes-Bug: #1404422 Change-Id: I445c2a24850059897b4e76ff29ef77f3baf84021
* Add an extra parameter for test directory in debugger scriptSteve Martinelli2014-09-291-4/+24
| | | | | | | | | | | | 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
* Drop .sh extension from oslo_debug_helper.shSteve Martinelli2014-09-181-0/+0
| | | | | | | | 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
* Add documentation for running oslo_debug_heler.shSteve Martinelli2014-08-251-10/+0
| | | | | | | Removed inline comments from the shell file and added them to the developer docs. Change-Id: Iac0f969165883e173389a42e1bd1b0bc5d513553
* Add pdb support to tox with debug helper shell scriptSteve Martinelli2014-08-251-0/+30
| | | | | | | | | | | | | | | | | 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>
* Import run_cross_tests.sh from oslo-incubator1.0.0Doug Hellmann2014-03-271-4/+6
| | | | | | | | | | Replace the local version of run_cross_tests.sh with the version in oslo-incubator. Depends on https://review.openstack.org/#/c/83411/ and https://review.openstack.org/#/c/83412/ Change-Id: I3d3e25f92ab6337432b54967a381662f32902a6d
* Add tool to run cross-project testsDoug Hellmann2014-02-271-0/+68
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