UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>
Change-Id: Ia9bee740acbe81eb9b7adf3b3df15e20e955ca12
Add the description for pep8, docs, pdf-docs, releasenotes, api-ref.
Change the pdf-docs and releasenotes's packages dependency with the
test docs requirement.
Story: 2008360
Change-Id: Ifcb28a340733b90329970be0078118d523b64bd3
Tox trying to install latest versions for building docs which may
not be supported by stable and lower branches, so should be
restricted by respective version's upper-constraints.txt
Change-Id: Ic2d0f0a49ff279fe7322a9c6b3a179b5e8e04708
Python 3.8 is now our highest level supported python runtime.
This updates the default tox target environments to swap out py37 for
py38 to make sure local development testing is covering this version.
This does not impact zuul jobs in any way, nor prevent local tests
against py37. It just changes the default if none is explicitly provided.
refer: https://governance.openstack.org/tc/reference/runtimes/victoria.html
Change-Id: I381f8ab89246e37af988ab7bf616914e5de7d20b
Introduce the json file check, cherry-pick patches check, and use flake8
shell instead of flake8 command.
Change-Id: I94e1554028535a361cb9f9e6e73c15702e459e4f
Since we dropped support for python 2 [1], we no longer need to use the
mock library, which existed to backport py3 functionality into py2.
Which must be done by saying::
from unittest import mock
...because if you say::
import mock
...you definitely will not be getting the standard library mock.
That will always import the third party mock library.
This commit adds hacking check N366 to enforce the former.
This check can be removed in the future (and we can start saying
``import mock`` again) if we manage to purge these transitive
dependencies. I'm not holding my breath.
[1]https://review.opendev.org/#/c/688593/
Change-Id: I79b0a084b8a99c54ce175a520e039e5572c5165a
ignore_basepython_conflict flag is introduced in that version so we need
to raise it if using that flag.
Change-Id: Ie40535ebe42504aceb7c15efbce52038ce3f9b3b
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found:
E117 over-indented
E501 line too long
E741 ambiguous variable name 'l'
W605 invalid escape sequence
Blacklist:
W503 line break before binary operator
W504 line break after binary operator
Update local hacking checks for new flake8.
Change-Id: I5d11a1f87d9547d9b6a27bf1f79cd69e0f73c741
- Add a new pdf-docs environment to enable PDF build.
- sphinxcontrib-svg2pdfconverter is used to handle SVG properly.
- maxlistdepth=10 in latex_elements is needed to handle
deeper levels of nesting.
- Specify openany in extraclassoptions to skip blank pages
(oneside is also specified to use the same page layout
for even and odd pages)
- tocdepth is set to 2 for better PDF TOC
- printindex and makeindex are set to empty in latex_elements
to avoid an empty "Index" section in PDF
- Sample config/policy files are skipped in the PDF document
as inline sample files cause LaTeX error [1] and direct links
in PDF doc is discouraged. Note that sample-config and sample-policy
need to be excluded to avoid the LaTeX error [1] and
:orphan: is specified in those files.
[1] https://github.com/sphinx-doc/sphinx/issues/3099
Change-Id: I70100a71114e1d75833e6c783086325baa0e3fd2
Py37 job always reports timeout error recently.
Please see [1] [2] [3].
At first it was suspected that the error was reported
because of the patch [4].
Therefore, Feng Shaohe's patch [5] revoked the merge,
and at this time, disappeared at py37 timeout.
But in fact, this problem is just hidden.
After removing this setting, the job of py37
is actually running on the environment of python 3.6
(community CI default version is 3.6), please see [6]
for detailed reasons.
Therefore, this patch exposes the hidden py37 timeout problem,
and at the same time, found method test_apply_patch_fpga_arq_monitor_job
, think it is the reason of the timeout. The reason I can find
this method is based on the the troubleshooting of tox -epy37 log.
After commenting out this method, I found that tox -epy37 can run
normally and there is no longer a timeout problem.
If you want to test, please ensure that you have a local
python3.7 environment, not 3.6, and execute rm .tox / -rf.
Then execute tox -epy37.
Therefore, the best way is to comment out this method and
restore py37 job at the same time.
If a friend discovers further reasons and solution, this method
can be restored, please refer to [7].
What went wrong in this method?
It is because in the deep call of this method, ThreadWork of
the thread pool will be used, which under Python3.7 will block
the execution of unit tests. For specific reasons, please see
[8] [9].
Reference:
[1]. https://review.opendev.org/#/c/702578/
[2]. https://review.opendev.org/#/c/703049/
[3]. https://review.opendev.org/#/c/703253/
[4]. https://review.opendev.org/#/c/696397/
[5]. https://review.opendev.org/#/c/706911/
[6]. http://eavesdrop.openstack.org/irclogs/%23openstack-infra/%23openstack-infra.2020-02-12.log.html#t2020-02-12T16:46:18
[7]. deed9c822e
[8]. https://review.opendev.org/#/c/707045/5//COMMIT_MSG
[9]. c61dd8c376/cyborg/objects/extarq/ext_arq_job.py (L41)
Change-Id: I09db889fe665c6246ec9503af92c909e7d0da24f
Cyborg now does not have a code security check, which may connive at
possible security issues. For example, shell-related operations for drivers
may be insecure. Current "sudo lspci -nnn -D" in huawei ascend driver code[0]
is insecure, but there is no any job/test that can check the potential security
issues. So this patch introduces bandit as a code security check.
[0]:https://github.com/openstack/cyborg/blob/master/cyborg/accelerator/drivers/aichip/huawei/ascend.py#L69
Change-Id: Ia1f9acbbd176180cb5fe97b1a2eee5f98a95dea6
Automatic envs (pyXX) will only use the python version appropriate to
that env and ignore basepython inherited from [testenv] if we set
ignore_basepython_conflict.
The lack thereof was causing pep8 jobs in the gate to output lines like:
pep8: skipped tests
congratulations :)
/usr/local/lib/python3.6/dist-packages/tox/config/__init__.py:582: UserWarning: conflicting basepython version (set 3.6, should be 3.7) for env 'py37';resolve conflict or set ignore_basepython_conflict
proposed_version, implied_version, testenv_config.envname
...despite the fact that the job was actually running.
Change-Id: Icb5281756d77117fb28139b9cc720b055e481290
Python 2.7 support has been dropped. Last release of Cyborg to support
py2.7 is OpenStack Train. The minimum version of Python now
supported by Cyborg is Python 3.6.
Depends-On: https://review.opendev.org/#/c/691766/
Change-Id: Ie87ef7727b50d8d5ca43f0283c5688199c35412e
In this U version, Improve UT for important Cyborg module is
an important task.
It is necessary to add openstack-cover-jobs to zuul. This way
we can easily view the unit test coverage of each file.
such as nova:
https://github.com/openstack/nova/blob/master/.zuul.yaml#L374
Change-Id: I854a51a2105628c5e5e9c30282e0f4b259c33ed3
This patch will first fix pep8 error in cyborg/*.py, but except
the sub dir, like cyborg/api*、cyborg/cmd/*...., these code will
be fixed in the follow patch.
This patch does two things:
1. Add Forbidden class in cyborg/common/excpetion.py and modify
NotAuthorized class、HTTPForbidden class.
For the cyborg/context.py, There is no exception called Forbidden
in the cyborg library. I guess this part of the code is referenced
to nova[1]. However, in the nova library [2], they define a Forbidden
class, so we can also defined class Forbidden in cyborg/common/exception.py,
and import it in the format of pep8.
At the same time, the content defined by NotAuthorized and
HTTPForbidden is inconsistent with the effect it wants to
achieve, so NotAuthorized and HTTPForbidden are modified here.
2. Adjust the import order in cyborg/quota.py.
[1]. https://github.com/openstack/nova/blob/master/nova/context.py#L300
[2]. https://github.com/openstack/nova/blob/master/nova/exception.py#L162
Change-Id: Ia7b22272412b5e5fe6a5fa0cdf06fff7870bc07d
Add an bindep.txt file containing a cross-platform list of
dependencies needed for running included tox-based tests. Also include a
tox environment for convenience calling the bindep[*] utility to list
any missing system requirements.
Cyborg requires package 'pciutils' because it is required for running
'lspci' command, this patch also add it.
[*] http://docs.openstack.org/infra/bindep/
Change-Id: If8eca0bcc187aed9fb2ef6794171a1acbc202079
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: Id0b8c3aed2cf11a4adfcfedf1e99ac070804b58f
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: I1e860339c2fad9e86c0a2cacf344a6ff94325873