Commit Graph

53 Commits

Author SHA1 Message Date
Takashi Kajinami 6723b3e1f8 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: I4a130d3b3d6ec1ca4d564ba7c17f6ce0486847d2
2024-02-02 23:57:41 +09:00
Rodolfo Alonso Hernandez 6dfd5da306 Docs build: Add requirements.txt to deps
Since we use usedevelop=True, as a result os-ken
installation happens at 'develop-inst' phase and it installs
requirements from requirements.txt without considering
tox constraints. This can lead to issue where broken
requirements are installed in docs job and as a result
it will fail.

In order to get constraints be considered for this case, add
requirements.txt to deps for docs env.

Change-Id: Id2975423df7d7c643f10f25e64d61d3680fcb38b
2023-03-01 23:53:57 +01:00
Rodolfo Alonso Hernandez 5f986ac16d Fix tox.ini for tox4
Change-Id: I58447f29a8435ad49ecb70c7e04c272d0d83e3b2
2023-02-15 21:35:44 +00:00
niuke b5a7202735 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: I19bcaf52e8e37c77e7b9d3b8088c29a9429def44
2022-08-18 06:48:46 +00:00
Rodolfo Alonso Hernandez 2495ebdff9 Remove "nose" library
The library "nose", used for unit testing, is removed. This library
is in maintenance mode and is not compatible with Python3.10 [1].

Now all checks are implemented using "unittest". The methods are not
loaded in realtime into the test case execution; instead of this, this
patch uses "testscenarios.WithScenarios", that allows to execute the
same test with different defined scenarios.

NOTE: "BgpSpeakerTestBase" tests are disable temporarily. It is needed
to configure "docker" in the system in order to execute them.

[1]https://nose.readthedocs.io/en/latest/

Story: #2010063
Task: #45519

Change-Id: I92e9547a26e9bec6c2a9a011c49a70b82dbb373e
2022-07-21 16:02:02 +02:00
Ghanshyam Mann 712535f6be 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: I2a42a907170a6fcd8cae245f864121fd12422ef0
2022-04-30 20:27:36 -05:00
Bernard Cafarelli a72de9a81d
Add requirements.txt to tox environment
This was spotted in [0] backport, upper constraints are not applied
correctly without it (and this aligns with the typical deps in other
projects)

[0] https://review.opendev.org/c/openstack/os-ken/+/823758

Change-Id: If2bbc92db09f3240ef9848f0db26ebcb709a2d3c
2022-01-10 11:20:15 +01:00
likui 9a31f457db Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I41611ad410e35c99193a995f1006d2e284e88c08
2021-08-11 19:39:51 +08:00
likui 042e32aa93 Replace deprecated UPPER_CONSTRAINTS_FILE variable
UPPER_CONSTRAINTS_FILE is old name and deprecated

[1] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I38355c133f41bfad8125f81b2334176cc3972117
2021-05-19 09:54:10 +08:00
elajkat 5312d23b43 pdf-docs: use UPPER_CONSTRAINTS_FILE for doc build
UPPER_CONSTRAINTS_FILE was not used for testenv:docs, and a recent
sphinx release seems to break pdf doc build, to avoid it use upper
constraints in tox.ini

Change-Id: Ica52306c9c2ca2d64161b09317735ed740bd4d32
2021-05-18 11:35:29 +02:00
likui ee19c59a9b Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
-https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
This allows to use lower-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/

Change-Id: Ie06d4e049e5e82fc0f75b8f3791b0b39594782b3
2020-11-01 16:36:53 +08:00
Bernard Cafarelli f61da64144
Fix lower-constraints and pep8 for Focal
Bump lower-constraints to versions supporting python 3.8 and with wheels
available and sync requirements

Bump hacking to 3.2.0 in order to work with Focal, disabling W504
to align with neutron and F405 (similar F403 is already disabled and it
needs a large fix)

Change-Id: I6b6329b2bb7a117f7426fdd63186d321290d9b67
2020-09-16 12:56:36 +02:00
Bernard Cafarelli 9c04dc0c6f
Update some URLs in README and tox
Use opendev.org URLs, point to storyboard instead of launchpad

Change-Id: Ib609aeadfde08cb4c3767d51c3c9ec906504f8a7
2020-07-08 14:08:19 +02:00
Sean McGinnis 2d31e3b0ff
Bump default tox env from py37 to py38
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.

Change-Id: I27363c065ba3410db07a4d343854d9f3145da83a
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-24 10:25:48 -05:00
Rodolfo Alonso Hernandez 3134ffe712 Drop Python2 support and testing
Remove Python2 CI testing and set the minimum Python version required
in setup.cfg.

Change-Id: Ifc65c94c00990bc50a5ae3789b71ae8c24b99e94
2020-01-18 19:29:14 +00:00
Akihiro Motoki 0d2059f933 PDF documentation build
It turns out that blank lines are not allowed in tables in
the latex builder. Otherwise, LaTeX complication fails.
A blank line in the docstring of 'bfd' class in os_ken/lib/packet/bfd.py
was dropped to pass LaTeX build.

Note that the structure of the generated PDF is not good (bad enough?).
This will be updated later.

Change-Id: Iec62042d4642d50d411478fadfa09e6a6bbf0a42
Story: 2006099
Task: 35137
2019-09-05 23:13:31 +09:00
Corey Bryant 8f7851a727 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: If9a09aa250139d8585445c3a892f71074e7637c7
Story: #2005924
Task: #34225
2019-07-05 13:55:38 -04:00
Ghanshyam Mann b9e3c6748b Dropping the py35 testing
All the integration testing has been moved to
Bionic now[1] and py3.5 is not tested runtime for
Train or stable/stein[2].

As per below ML thread, we are good to drop the py35
testing now:
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2]
https://governance.openstack.org/tc/reference/runtimes/stein.html
https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I1cc51c618c9a5ad016f506c4fcaf65a7fca001ca
2019-05-08 09:23:11 +02:00
Zuul 1fe8b7585d Merge "add python 3.7 unit test job" 2019-05-07 23:36:02 +00:00
Sahid Orentino Ferdjaoui 6e920c8994 add python 3.7 unit test job
See ML discussion here [1] for context.

[1] http://lists.openstack.org/pipermail/openstack-dev/2018-October/135626.html

Change-Id: I5fb3cf680aeea00bbca7695301939c14d78d0a7e
Story: #2004073
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-03-11 14:12:00 +00:00
Nate Johnston a3b706a774 Fix pep8 errors in os-ken
Update the lower constraint for appdirs, similarly to how it has been
done in other repos.

Whitelist pep8 error E113.  This is the "unexpected indent" error.  This
module uses C-style comment blocks pervasively, things like:

    OFPP_IN_PORT = 0xfff8   # Send the packet out the input port. This
                            # virtual port must be explicitly used
                            # in order to send back out of the input
                            # port.
    OFPP_TABLE = 0xfff9     # Perform actions in flow table.
                            # NB: This can only be the destination
                            # port for packet-out messages.
    OFPP_NORMAL = 0xfffa    # Process with normal L2/L3 switching.

For the lines above the ones that have an indented comment with no code
to the left would get E113 with a recent change to a less permissive
policy.  It would cause over 260 changes to comment strings, destroying
the consistency of comment style, to make that change.  Therefore,
blacklist that pycodestyle error.

Change-Id: I6d2f463b50551f32bce863aa7dc0c70ad3054cbd
Story: #2005142
2019-03-05 15:39:00 -05:00
Hongbin Lu 8de796f1df Move constraint from install_command to deps
The install_command is used to install os-ken and its dependencies.
However, we don't want to constraint on installing os-ken since
it will fail. Therefore, this commit moves constraint to deps.

Change-Id: Ic4c0d72e9c54e1991cbf390a08b0614f19a2a7af
2018-11-05 22:41:27 +00:00
Hongbin Lu b5be390943 Add minimum constraint for some requirements
The constraints were picked to be the same as neutron for consistency.

Change-Id: I957c144e52e29ec4724b1632eba998c0c4a64b33
2018-10-17 17:59:18 +00:00
Hongbin Lu 78cd06b76a Add job for running unit tests
Change-Id: I333b1f168314e73e9b0470041a16c0297b2cd562
2018-10-17 17:57:22 +00:00
Zuul 8f50702d82 Merge "Add pep8 job for code style checking" 2018-10-16 10:58:26 +00:00
Hongbin Lu af81f6413f Add pep8 job for code style checking
Change-Id: I05f9ba7a414a27a40b278b2c08ce50ac0805f3b6
2018-10-15 15:08:59 +00:00
Doug Hellmann 5006c498d8 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: I567b7fb703f095c9ac7c7732dfc1ac8b9a7b9cf7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-01 15:34:00 +00:00
Hongbin Lu af2e4fcee4 Apply OpenStack Cookiecutter template
Change-Id: I7172220a2b40cb856080e958bd4a340975449181
2018-09-04 17:00:24 +00:00
IWAMOTO Toshihiro 19662c5688 Test more python versions on travis CI
It seems tests weren't correctly run because of interactions between
travis CI env and tox venv.  Also, run the scenario test on more
recent python3, as python3.4 is going away.
The test uses a lot of memory and fails with pypy, so it's disabled for now.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-08-01 16:00:11 +09:00
IWASE Yusuke 56aff9adf3 pycodestyle: Ignore W504
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2018-06-20 12:04:46 +09:00
IWASE Yusuke 83650576e4 travis: Introduce autopep8 test
This patch add a new test using "autopep8" to keep codes reformatted
easily by using Python tool.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:46 +09:00
IWASE Yusuke bdf3549563 pycodestyle: Replace pep8
pep8 has been renamed to pycodestyle and will be removed in a future
release.

This patch replaces pep8 by pycodestyle and adding some settings for
pycodestyle.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-12-17 19:27:41 +09:00
FUJITA Tomonori a991fed7e4 Revert "tests: Separate test files from Ryu module"
This reverts commit a67ed28584.

The commit breaks OpenStack neutron dynamic routing.
2017-06-30 14:23:03 +09:00
IWASE Yusuke a67ed28584 tests: Separate test files from Ryu module
To prevent redundant files (e.g., pcap files, json files for tests,
packet data generator) to be installed, this patch separates test
directory from Ryu module.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2017-06-26 15:17:44 +09:00
IWASE Yusuke 6da65f508e tox: Move dependencies installation to .travis.yml
This patch moves dependencies installation in tox.ini to .travis.yml
in order to avoid to install dependencies repeatedly when running
tox tests on locally.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-14 13:23:32 +09:00
IWASE Yusuke c810965826 tox: Test ryu-manager without additional requirements
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-12-14 10:04:49 +09:00
fumihiko kakuma 580f04d8a9 Enable to run a scenario test with a specific python version
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-24 15:14:34 +09:00
IWASE Yusuke 03f77e7279 pip: Separate test-requires
Currently, in addition to "requirements for tests", test-requires
includes "optional requirements".
This makes it unclear to identify which packages are surely required
to use optional features (e.g., OF-Config, NETCONF, BGP speaker) and
causes the redundant installation when building Docker images.

This patch separates test-requires into two files("test requirements"
and "optional requirements").

Also, this patch reverts the version fixation for some packages.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-11-15 20:58:06 +09:00
fumihiko kakuma df1434a9bb Enable to run a scnario test for ryu bgp on travis
Signed-off-by: Fumihiko Kakuma <kakuma@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-10-29 06:27:56 +09:00
IWASE Yusuke 208ad9d11c tox: Integrate Coveralls.io
To check the code coverage of the unit tests on web, this patch
add integration of Coveralls.io (https://coveralls.io/).

Usage:
  1. Sign in to Coveralls.io with your GitHub account.
  2. Add repos at your account page.
  3. Execute tests on Travis-CI.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:33:21 +09:00
IWASE Yusuke dc6e2b8691 tox: Add Python 3.5
>From Ubuntu 16.04 LTS, the default version of Python 3 has been
upgraded to 3.5.1.
  e.g.)
    $ python3 --version
    Python 3.5.1+

This patch enables to run unit tests on Python 3.5 environment.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-13 22:33:17 +09:00
IWASE Yusuke dbe6743742 tox: Upgrade PyPy version to 2.6
Recently, Paramiko updates the requirements to 'cryptography>=1.1',
cryptography 1.0 is not compatible with PyPy < 2.6, but PyPy version
of Travis-CI is older than 2.6.
So this causes CI test error.

This patch upgrades PyPy interpreter version to 2.6 in tox environment.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-05-09 19:01:17 +09:00
FUJITA Tomonori af5e6b5fb7 drop python2.6 support
The Python core team[*1] stopped supporting python 2.6. Some Python
libraries started following the same path and trying to support 2.6
becomes painful...

For example, most of you already noticed, oslo.config dropped 2.6
support. I tried to work around it with the following commit:

2250171098

But this forces users of decent distributions (e.g Ubuntu 14.04) to
upgrade pip (old pip versions can't understand version conditions).

[*1]
http://www.curiousefficiency.org/posts/2015/04/stop-supporting-python26.html

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-18 06:54:47 +09:00
IWASE Yusuke 2ae4f884ab tox: Adapt to PyPy interpreter
Note: Though tests may not be enough, as far as running unit test,
this patch makes compatible with PyPy interpreter.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2016-02-10 13:46:35 +09:00
Satoshi KOBAYASHI 89e1bcd577 tox: disable wheel cache
Recently, installed packages are cached by Wheel. It is serious when the package is using 2to3 with setuptools (use_2to3) for adapting python3. Because Wheel is caching the contents of translated. If the contents of translated are cached, it can't work properly in python2

Signed-off-by: Satoshi KOBAYASHI <satoshi-k@iij.ad.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-11-13 15:37:14 +09:00
Yusuke Iwase 033d99474a .travis.yml: Suppress the output of unit tests
Because Travis-CI has a limit of the log file to 4MB, this patch
suppress the output of unit tests by setting NOSE_VERBOSE in tox.ini.
tox.ini does not effect when running run_tests.sh locally,
so please run run_tests.sh, if the full log messages are needed.

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-09-18 08:31:44 +09:00
IWAMOTO Toshihiro e83acc434d tox.ini: Be able to run python3 unit tests
With this change, you can run "tox -e py34" to test python3 compatibility.

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-06-20 21:18:58 +09:00
YAMAMOTO Takashi f40bc34ac8 tox.ini: Pass posargs to make "tox -e py27 path.to.test" work
Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-04-28 10:57:28 +09:00
YAMAMOTO Takashi bbecb6ca56 tox.ini: Disable pep8 W503 for now
Disable pep8 "W503 line break before binary operator" warning for now.
The check was recently introduced by pep8 1.6.2.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-16 13:05:30 +09:00
FUJITA Tomonori 45e37843b9 ignore some pep8 errors for now
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2015-02-08 12:31:56 +09:00