Commit Graph

51 Commits

Author SHA1 Message Date
Takashi Kajinami b9b15d89cf tox: Drop envdir
tox now always recreates an env although the env is shared using envdir
options.
~~~
$ tox -e genpolicy
genpolicy: recreate env because env type changed from
{'name': 'genconfig', 'type': 'VirtualEnvRunner'} to
{'name': 'genpolicy', 'type': 'VirtualEnvRunner'}
~~~

According to the maintainer of tox, this functionality is not intended
to be supported.
https://github.com/tox-dev/tox/issues/425#issuecomment-1011944293

Change-Id: I63264b8c11ceea4b312b251c9a28f4a246592733
2024-02-03 00:04:59 +09:00
Takashi Kajinami e62823d134 Bump hacking
... because hacking 3.0.x is too old. pylint is also bumped to resolve
conflicting dependencies. The new version is currently used in neutron.
The pylint setting is imported from neutron with one additional
disablement to ignore the following error.

ovsdbapp/schema/open_vswitch/helpers.py:47:14: R1732: Consider using
'with' for resource-allocating operations (consider-using-with)

Change-Id: I41b4524ff13b8d46d2e0c76f09b5ec47601bd955
2024-01-27 23:14:24 +09:00
Anton Vazhnetsov dd56fd5bea venv: unit tests don't work for 'hardware_vtep'
If OVN and OVS are not installed on the system, but cloned into '.venv',
the 'OvsVtepVenvFixture' class is not instantiated correctly and all
unit tests fail.

Closes-bug: 2037568

Change-Id: Id26004b57cb02900faed5dabeee8956ff9c66b54
2023-09-27 23:56:49 +03:00
Terry Wilson ee28e381fb Use OVN's OVS submodule for functional tests
The OVN tree for several years has had an OVS submodule that pulls
in the version of OVS it is guaranteed to work with. There is
currently a patch in OVS master that breaks the build of OVN main
so switch to using the submodule.

Change-Id: I61195cd3ebf8a5015890d3ba3988c3d9795ee817
2023-04-03 15:46:39 -05:00
Rodolfo Alonso Hernandez 2ed1280148 [CI] Set the default OS_TEST_PATH in the stestr conf file
Set the default OS_TEST_PATH in the stestr configuration file. Any
other test environment can overwrite this variable in the "setenv"
section.

Change-Id: I51564920cec916031aaebf8151b015a3d87e9471
2023-03-16 15:29:18 +01:00
Rodolfo Alonso Hernandez 149d7db4a7 Update tox.ini for tox4
Change-Id: I7ec80abf6bda33ad3f074309f64491ee4af1c71b
2023-01-23 16:28:52 +01:00
Zuul d26be1cdcd Merge "vtep: add support for 'hardware_vtep' schema" 2022-07-20 15:08:43 +00:00
Ghanshyam Mann 8dc5192650 Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: Ie57cd00b241d810528d51c5afbef604db841b0ce
2022-04-30 20:27:33 -05:00
Anton Vazhnetsov 06d25c2980 vtep: add support for 'hardware_vtep' schema
Added support for the "hardware_vtep" schema. The ``HwVtepApiIdlImpl`` class provides interaction with "hw_vtep.db".

Closes-Bug: 1960513

Change-Id: I37138e91f9dd3e42908ac1e7e7c123323177a8e8
2022-03-30 15:05:19 +03:00
Rodolfo Alonso Hernandez dfc2c0ef9e Move linters dependencies to tox.ini
That fixes some dependency clashes in py36 job when installing
"pylint" with "astroid" library.

Closes-Bug: #1955724
Change-Id: I7cc4b779c68fe21d6ca50b6c76cdd2b6edaa7ea2
2021-12-22 02:11:49 +00:00
Terry Wilson c33512ad2a Capture test run logging
Clean up test run output by hiding the logging for passing tests.

Change-Id: I66450aec8a352097b9362b186e14d1c46d1bdb15
2021-11-24 17:23:51 -06:00
Zuul 7fb76fedf5 Merge "Use py3 as the default runtime for tox" 2021-11-18 15:24:58 +00:00
Flavio Fernandes ba55cc2a67 Fix docs job
Sphinx 4.0.0 added a new dependency [0] which is causing the job to fail
at the moment.

This patch fix the problem by adding UC to the docs jobs.

[0] https://www.sphinx-doc.org/en/master/changes.html (LaTeX: add
tex-gyre font dependency)

Change-Id: I501659d48b1cf2d64cea8dc80ade7a068e37e904
Signed-off-by: Flavio Fernandes <flaviof@redhat.com>
2021-05-13 15:39:43 -04:00
zhangboye 0d732ee5e6 Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update
this at each new cycle.

Change-Id: I45e0dcc6c215d0fb5f4e0d39298e8f5839f20e13
2021-04-20 16:59:33 +08:00
wangzihao 26f24cf228 Drop py37 and add py38 test
Drop python3.7 and add python3.8 from setup.cfg and tox.ini, since Wallaby's python
supported runtimes are python 3.6 ~ python 3.8[1] ,python 3.7 still in use but not test [2]:

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2021-January/019648.html

Change-Id: Id68d7015f97b7c2bb903bb7015998347e19980ea
2021-01-14 02:20:08 +00:00
zhouxinyong 7ced5efa15 Remove all usage of six library
Convert all code to not require six library and instead
use python 3.x logic.

Change-Id: I8721dedf8d77073225ebeec9525776bce15bd002
2020-04-02 13:06:11 -04:00
zhouxinyong e6c2f1fed1 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fixed related code warnings and updated .pylintrc.

Change-Id: I5e82d29e0d6f09b98bebdd5dbcc34b01512b28ef
2020-04-01 10:06:32 -04:00
Flavio Fernandes 5d70d45f2d Make ovndir configurable
Change tools/setup-ovs.sh to take an OVS_BRANCH env
variable to use a specific branch.

Also, make OvsOvnVenvFixture work with an ovndir before
or after OVN repository split.

Change-Id: I9994c6e914bdb1deb5952c193e521f83ad74363d
Closes-Bug: 1856676
Signed-off-by: Flavio Fernandes <flaviof@redhat.com>
2020-01-16 06:13:59 -05:00
Bernard Cafarelli b22a6a09fb
Drop python 2 support and testing
This is part of Ussuri goal tracked for Neutron stadium at:
https://etherpad.openstack.org/p/neutron-train-zuulv3-py27drop

Change-Id: I46894fefe681d7e84343a633a803c87e1e88cfb6
2019-12-17 15:52:08 +01:00
Terry Wilson 6bfd219ec9 Default testenv to basepython = python3
Change-Id: Ifa6ebc07d4edaa8d92cb5f3a8ae9c4ffead38974
2019-10-04 13:50:48 -05:00
Zuul 92627f4de9 Merge "Fix building OVS after python2 removal" 2019-10-04 11:44:08 +00:00
Terry Wilson d5420ab5d2 Fix building OVS after python2 removal
Switch functional to use python3 to install python3-based
dependencies, which the OVS build checks for. Also, remove
the py36 test

Change-Id: I2d9599d7050a15f459e6845a112ffc9948b2a7bd
2019-10-03 21:54:01 +00:00
Zuul 4310bd2a06 Merge "PDF documentation build" 2019-09-26 11:59:36 +00:00
Zuul 65f3d4a1df Merge "Update Zuul jobs: Enable docs publishing" 2019-09-26 11:59:36 +00:00
Terry Wilson 54ee85113a Handle the ovs/ovn split
This is the bare minimum to run against ovs/ovn master after the
split. It should be updated to handle running against system-
installed OVN.

Change-Id: I264200ae016e3928fb4aff3bdcc7c1a94f91cae4
2019-09-20 13:24:05 -05:00
Akihiro Motoki 8bfddd3c1c PDF documentation build
README.rst and doc/source/index.rst are modified a bit
to fit both HTML and PDF docs.

Change-Id: I128a45eddfe9de06c4961555ddd79a62723338c1
Story: 2006099
Task: 35138
2019-09-05 09:17:29 +02:00
Andreas Jaeger ac3d3de9ec Update Zuul jobs: Enable docs publishing
Start publishing docs with using the proper template.

For this, add also a doc/requirements.txt file and move docs
requirements there. Update tox.ini for this and use the modern way to
invoke sphinx-build for building.
Remove obsolete sectoins from setup.cfg.
Update the conf.py files and remove unused lines
with newer openstackdocstheme - and require newer theme.

Fix indents in CONTRIBUTING.rst so that the formatting works nicely.

Also, use lower-constraints template instead of individual jobs.

Change-Id: Ia1a7030878f12ca0b8184363173eada929ece3bd
2019-09-05 09:17:05 +02:00
Zuul c3f1bd3465 Merge "Add Python 3 Train unit tests" 2019-07-29 23:28:26 +00:00
Corey Bryant 5a9b9e22f2 Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I1c658ddb1e4470dcf1f547747c9f90fdb08ad438
Story: #2005924
Task: #34225
2019-07-05 13:56:16 -04:00
caoyuan bcafa4bf3e Update the UPPER_CONSTRAINTS_FILE for tox
1. Update the UPPER_CONSTRAINTS_FILE for tox[1]
2. Remove unncessary "=="
3. Update some URLs to latest

[1]: http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I447fa8594a7f11d5d8ed455353020b6871f596e5
2019-06-27 20:40:14 +08:00
Yunxiang Tao b6c55cd4c5 Replace openstack repository by opendev
Change-Id: I89b3f71615a73e93623c24251d4fa3d0c89661c8
2019-05-31 19:36:23 -07:00
Rodolfo Alonso Hernandez 048473da01 Add missing tox environment "functional-py36"
Change-Id: Ie64fdfd35c0ba0a575aa399c9bd6993ec7202c29
Closes-Bug: #1825877
2019-04-22 17:50:28 +00:00
Zuul 5c14460e73 Merge "fix tox python3 overrides" 2018-08-23 16:41:42 +00:00
Terry Wilson f4855dd66f Check for oslo library usage
Occasionally oslo library usage sneaks in, so add a coding check
that checks for ^oslo\. in requirements.txt. We currently still
use oslo.test, so don't check test-requirements.txt. This should
fail to pass tests until I34357d5a594330d07f5cad372859d98efb5d3fde
merges.

Change-Id: I53108584ee47a7f1b6c7df90c49f95725cec69f9
2018-08-23 09:03:54 -05:00
Doug Hellmann 665666c031 fix tox python3 overrides
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: I2a995f93b7e2a4a3ad40856773ce3ba7c6666720
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Signed-off-by: Chuck Short <chucks@redhat.com>
Depends-on: Ia7412f8ec97cae2e0c8eda84eb38822a110c1a65
2018-08-22 14:51:43 -04:00
Terry Wilson b4f90d0490 Pass posargs to pylint, not flake8
Change-Id: If422de964c6c597480d83ea38b6ab5929e485736
2018-08-22 16:03:28 +00:00
Vu Cong Tuan f631143f3c Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: I32db99af179412f46b02ced9eaf61049cbffcdb0
2018-07-10 16:23:46 +07:00
Doug Hellmann 74aa241b53 add lower-constraints job
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: Ic1f4de4b5f36cfe5bd5e578507e320918d1078f9
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-12 06:47:49 +00:00
Lucas Alvares Gomes da9da9201d TOX/pep8: Enforce the use of python2
The toos/debug_venv.py does not work well with PY3, this patch is
modifying the tox "pep8" job to enforce the use of python2 instead of
the default interpreter in the host OS.

Related error:

./tools/debug_venv.py:41:24: E901 SyntaxError: invalid syntax
    raise e.args[0][0], e.args[0][1], e.args[0][2]

Change-Id: I9b7e8110bf14df9448c7d0f731a605daa2fa864b
2018-03-08 16:53:53 +00:00
Andreas Jaeger 163ee83ce8 Avoid tox_install.sh for constraints support
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.

tox_install.sh was also building ovs for functional test. Move this into
tools/setup-ovs.sh and call it from functional tox environment.

Change-Id: I5857c8ae3e945328c0f24bda37629ce7e0faefa7
2017-12-20 21:25:28 +01:00
Terry Wilson ed2184fad8 Add ability to debug OVS virtual environments
When writing tests, it is useful to be able to look at the database
being modified. Since we use OVS virtual environments and delete
them when the test ends, this is difficult to do.

This patch adds the ability to pass KEEP_ENV=1 when running tox to
keep the virtual environment around and adds tools/debug_venv to
launch an OVS sandbox using the OVS virtual environment.

Change-Id: Idbec2d544d913ffa8888a050b8a53d016c0315f2
2017-07-13 19:51:31 +00:00
Terry Wilson 4bde2d5237 Add OVN Northbound API for LS, LSP, and DHCP
This patch implments the ovn-nbctl API for the Logical_Switch,
Logical_Switch_Port, and DHCP_Options commands. Additional patches
will implement logical router and load balancer functionality.

As a convenience, the add/list/get commands return a special
read-only version of an ovs.db.idl.Row object called a RowView.
This object can be compared to a Row for equality and hashing. This
saves having to return uuids and then look them up. This behavior
differs from the Open_vSwitch schema implementation. This wrapper
serves both to keep people from modifying returned values outside of
a transaction and as an interface for any future backend to implement.

In addition, an ovs virtual environment fixture based on ovs-sandbox
is added to set up a sandboxed ovs/ovn install for running functional
tests.

Change-Id: I93689158467ff73a1b02588510d168b50ed6292a
2017-07-03 23:19:46 -05:00
Jenkins 9faeb2fdbf Merge "The python 3.5 is added" 2017-06-30 14:51:49 +00:00
Arundhati Surpur 8c3a850803 The python 3.5 is added
In setup.cfg file the python 3.4 support is removed and added 3.5
In tox.ini the python 3.5 is added

Change-Id: I0dd1992369bc7eef4d78876f34df76a74b5de843
2017-06-30 10:37:53 -04:00
Jenkins e864508815 Merge "Enable pylint 1.4.5" 2017-06-30 10:23:31 +00:00
Dong Jun 15d956380b Enable pylint 1.4.5
This patch enables pylint 1.4.5 checking in ovsdbapp.
Script tools/coding-checks.sh is copied from neutron and adapted for
ovsdbapp.
.pylintrc is also copied from neutron, message options that do not
need to be suppressed have been removed.
This patch also adjusts code to fit pylint 1.7.1

Change-Id: If27c9a13798f20f3c22ca62a38cb93e7ad602a18
2017-06-30 09:54:53 +08:00
Dong Jun 62becbbd71 Remove ignoring _ builtin usage for pep8
We did not use it.

Change-Id: I0d5d67ab047b1de609eb4cc85627c79eced1a57c
2017-06-26 16:53:26 +08:00
Jakub Libosvar f03b87e66a Fix all broken jobs
This patch consists of two squashed patches:

First patch copies in tox_install.sh from oslo libraries. The script
removes ovsdbapp from upper-constraints.txt as we want to install
code from the repository and not from pip.

Second patch is squashed from abandoned Iff59bbf41d166a0918a217cb72a37c547c6506b9.
Issue there was that code uses 'sudo' for running ovs-vsctl but the tests
user is not member of sudoers. It sets the Manager prior to executing
the tests. As ovsdbapp isn't supposed to depend on oslo, there is not
guaranteed way running process with ovsdbapp code will have root
privileges. Hence the Manager should be configured before application
using ovsdbapp is started.

Closes-bug: #1674937

Change-Id: I634ae2eeab7b68a81cb7208f0650705ac5a9a9ef
2017-03-23 08:52:07 +00:00
Terry Wilson e95b895b31 Add some bridge and port functional tests
Change-Id: Iaeb71bc4dff3f076d913d6bf0b34e0dd19dc9b93
2017-03-17 15:06:15 -05:00
Terry Wilson e299f86d06 Fix pep8/cookiecutter test running 2017-02-24 15:32:17 -05:00