Commit Graph

47 Commits

Author SHA1 Message Date
Clark Boylan b502ec35b0 Omnibus fixups for storyboard testing and CI
Linting fails due to two different hacking rules: H214 and H216. We fix
H214 by using assertNotIn and assertIn over assertFalse(foo in bar) and
assertTrue(foo in bar). We ignore H216 as it says don't use the mock
library but storyboard actually does use mock and updating to use
unittest.mock appears to be a fair bit of work.

In the sqlaclhemy models we move some classes around to address this
error:
  sqlalchemy.exc.InvalidRequestError: When initializing mapper mapped
  class Story->stories, expression 'TimeLineEvent' failed to locate a
  name ('TimeLineEvent'). If this is a class name, consider adding this
  relationship() to the <class 'storyboard.db.models.Story'> class after
  both dependent classes have been defined.

In the project loader we switch to using yaml.safe_load() to avoid the
missing Loader argument to yaml.load().

We pin jinja2 to < 3.0.0 as the old sphinx we've pinned to uses
contextfunction which appears to have been replaced in jinja2 3.0.0.
We should probably attempt to update the doc toolchain for storyboard
when we have time.

We pin MarkupSafe for similar reasons to the jinja2 pin. Version 2.1.0
of MarkupSafe removed the soft_unicode name which is used by sphinx.

Finally we run the python 3.6 and 3.7 jobs on ubuntu-bionic.

Change-Id: Ifcb6660ce2c89c21ba867aa88d942461bcff125d
2022-04-18 16:00:35 -07:00
Adam Coldrick 983bb8e2d7 Unpin webob and hacking to fix compatibility issues
The pinned versions of webob and hacking weren't functioning properly
with modern Python, so they are unpinned.

Unpinning hacking brought a number of extra rules into use, so this
commit also contains a number of code style fixes.

There was also an incompatibility in the test_setup.sh script, which
meant it doesn't work with MySQL 8.0 (which is in Ubuntu 20.04). This
is also fixed in this commit.

Change-Id: I0889bc35f8babfeec42f6f577d302bb5fbce1c95
2020-09-11 12:26:47 +01:00
Adam Coldrick 647bb9c660 Drop Python 2.7 support
Python 2.7 is deprecated now, and some dependencies have dropped their
support for it. We should also just drop support for it rather than
pinning the dependency versions.

This commit also switches to a generic Python 3 tox environment,
adds additional test jobs for more Python 3 versions, and cleans up
some Python 2 compatibility cruft.

Change-Id: I3e7cc1713dec1bada4a85f75362c4fa4f89ceae6
2020-03-28 14:25:33 +00:00
Jeremy Stanley e386f32566 Add a dedicated "lpimport" tox testenv
To simplify the launchpadlib dependency installation for the
storyboard-migrate utility, use a separate tox testenv specifically
for this purpose and put that as its only additional runtime
requirement. Name the testenv "lpimport" with the expectation that
in time we may also rename the storyboard-migrate utility similarly
(so as to disambiguate it from the Alembic migrations we rely on
for database schema upgrades).

Change-Id: I8bd36bf69c235c8957ae4a161fd22cbe80028cf4
2019-12-17 08:36:50 -05:00
Adam Coldrick 489a6b5cb7 Whitelist `rm` for docs target in tox.ini
Change-Id: Ifd60e5ed0085059f47ae65f478d33f2f4bcb6fdf
2019-03-20 16:15:33 +00:00
Zuul 9200863c34 Merge "Use python3 for basepython in tox.ini" 2019-02-21 02:30:19 +00:00
Adam Coldrick 459399491c Use python3 for basepython in tox.ini
Change-Id: I1d9cd136592cec001abe0534dcf162d33785f281
2019-01-26 11:09:13 +00:00
Monty Taylor 45f7ed5a43
Switch to using stestr for tests
OpenStack is switching from testrepository to stestr. Make the shift
here.

Also, while doing this, update the rest of the test-requirements.
testtools and python-subunit are removed because they are transitive
deps of oslotest and stestr already.

Change-Id: Idf1298e03a78653044532fd54a4f35dcf5c6c1c5
2018-10-17 14:24:24 -05:00
Andreas Jaeger a5d8b2b64d Update coverage environment
Fix coverage environment to default stestr setup.
Update timeout for tox-cover.

Change-Id: I8f7b19743aa3d4b51316c9941bb751ff622fb354
2018-09-24 06:05:06 +02:00
Zuul df2ba5a99a Merge "fix tox python3 overrides" 2018-07-25 22:44:40 +00:00
qingszhao ac0f441430 change default python 3 env in tox to 3.5
Change-Id: Icbc062d281cb1d48da45bf550d8514e37be4b9c9
2018-06-12 11:34:46 +08:00
qingszhao b7ed9c76ca 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: If74556d3489092ea33d82224d1c1695c182b6bea
2018-06-12 01:18:45 +08:00
John L. Villalovos 7e9e1e5c44 Fix PEP8 failures for H236, remove unneeded ignores, use newer hacking
Fix [H236] Use six.add_metaclass instead of __metaclass__.

Remove ignoring of: H233, H234, and H236 as they are passing.

Use hacking>=1.0.0

Change-Id: I310f1161467339c6784bae253e0e3713f23d5218
2018-04-03 13:26:20 -07:00
Zuul 90fde5756b Merge "set up tests to run with sqlite" 2018-02-11 15:36:45 +00:00
Zuul 98a20e9c29 Merge "treat doc build warnings as errors" 2018-02-07 21:52:51 +00:00
Doug Hellmann 2fe2f57b6b set up tests to run with sqlite
For most of the tests for storyboard sqlite is around 10 times faster
than MySQL (more for non-SSD systems). An sqlite database does not
support some operations, like modifying constraints or dropping
columns, so we cannot avoid testing with MySQL. We can however use
sqlite for local development to reduce the pain involved with running
tests as part of the development process.

This patch adds a tox environment for running the tests against
sqlite3. The new tox environment is intended to be used by developers
as well as the new check and gate job defined in .zuul.yaml.

The new job ensures that changes to alembic migration scripts continue
to work with sqlite.

This patch also modifies the existing alter scripts to skip steps not
supported under sqlite. Those steps aren't strictly needed, and they
are still tested when the CI system runs the tests with MySQL.

Change-Id: Icb979cb03e10c56519a90ea3976a4da2d9bddb05
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-02-05 17:48:53 -05:00
Doug Hellmann 1044a1369f do not set OS_TEST_TIMEOUT in tox.ini
Do not set the variable in tox.ini, because that overrides any value
the user is trying to pass on the command line or from their
environment. A default is already set in .testr.conf using shell
syntax that supports using the value from the user if there is one.

Change-Id: I5ff1880655e927ea596217154958fb95857f5649
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-01-30 11:00:13 -05:00
Doug Hellmann a8dbce772c treat doc build warnings as errors
Turn on the flag to cause documentation build warnings to be treated
as errors.

Change-Id: I0135d905cc77dfe30b06093d18e0883f8227bd85
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-01-22 14:38:03 -05:00
Doug Hellmann 708d09be77 update documentation build for new PTI
Move documentation dependencies to doc/requirements.txt

Change tox.ini to run sphinx-build directly, like the zuul job does.

Switch from oslosphinx to openstackdocstheme.

Change-Id: I079ff78edacaba673461824af770344cb3a896f2
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-01-12 16:24:59 -05:00
Matthew Treinish f7556744bb
Bump minimum os-testr requirement to 1.0.0
This commit bumps the os-testr version to use 1.0.0. 1.0.0 changes the
internals to use stestr instead of subprocessing testr. A bunch of
incorrect imports in the tests were updated as a well, relying on
relative import paths is finicky at the best of times so to make the
tests work this just points to the path based on the root of the package
instead.

Change-Id: I2aed3f6a9adeac2b7dbe58ee12c0a1485278d56f
2017-10-16 20:29:39 -04:00
Luigi Toscano 146ab70a56 Use ostestr instead of the custom pretty_tox.sh
Switch to os-testr as wrapper for testr, instead of the custom
script pretty_tox.sh.

Change-Id: I5b76cf9ffca530664b1c1ddcbf98679ab4fca8b5
2017-02-09 12:29:41 +01:00
xhzhf 7ee939d445 H803 hacking have been deprecated
H803 hacking have been removed since hacking 0.10.
https://github.com/openstack-dev/hacking/blob/master/setup.cfg.
Closes-Bug: #1651715

Change-Id: I6ccc56071cdda3a39e8a5ce3f0688be6612ad8fd
2016-12-21 03:04:17 +08:00
James E. Blair 52eb7f22b2 Specify python2 for tox venv
The openid library seems to have problems with python3, so specify
python2 here so that when developers run the server using tox (as
recommended in the docs) they run with a python version compatible
with openid.

Change-Id: If4a886c1d6afa20e310c56b6299e36094855e823
2016-11-30 13:55:33 -08:00
Doug Hellmann 16d1cc1af2 remove final vestiges of incubated oslo code
Remove the sync config file, remaining unimported modules, and update a
couple of configuration files with references to the directory being removed.

Change-Id: I56ae9b23a6d1d06d80fbb44adaca16ca079a7663
Story: 2000776
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-11-07 13:31:55 -05:00
Doug Hellmann 6453df36cd configure tox to allow OS_TEST_TIMEOUT env var to pass through
By default tox does not pass environment variables to the processes it
runs. Add OS_TEST_TIMEOUT to the whitelist so that a developer running
the tests locally can update the timeout for the database tests that run
on a slow box.

Change-Id: I1300c0d8c0b8a0d5011fc5d2ac028f3ab2527593
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-11-07 10:41:12 -05:00
Doug Hellmann 79024e76b3 switch from incubated gettextutils to oslo.i18n
Replace the incubated copy of gettextutils with oslo.i18n, following the
best-practices guidelines in the library documentation for handling
imports, module names, and exceptions to the hacking rules.

Change-Id: Ie366afd8bda2a72c964d9ddf7dd53718002fb4d0
Story: 2000776
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2016-11-07 08:47:47 -05:00
Clark Boylan 1a0ce47f8f Use a common requirements file
We can use newer setuptools and pbr to use environment markers in our
requirements files which allows us to select deps if the environment
matches. With this we restrict the email dep to python < 3.0 which is
the only dep we have that doesn't work across python 2 and 3.

Note that this also updates the pbr machinery to pull in this new
feature support. Part of this update requires updating hacking to avoid
conflicting pbr requirements. This in turn has created some churn in the
format of the code but should largely be a noop.

Change-Id: I0be5dd8a6b33a51329077b5a5f4c7f5576829956
2016-07-08 09:06:10 -07:00
Anita Kuno 8ea0c1e4eb Add a py35 textenv to tox.ini
Currently the tox.ini file has a section for py34 tests. In order
to get the python35-db job to build we need to create a py35
textenv section in the tox.ini file.

Change-Id: I5811cc11342b67358aa010c96affe7a6b3544b02
2016-07-07 19:14:01 -04:00
Andreas Jaeger f84b684831 List system dependencies for running common tests
Add an other-requirements.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.

This change is needed since the infra team will not install standard
packages in jobs anymore, projects should use other-requirements.txt
instead. The macros xvfb-install, firefox-install, chrome-install
which are used to run some jobs for this repository will be removed
soon.

This change is self-testing.

For other-requirements.txt see also
http://docs.openstack.org/infra/manual/drivers.html#package-requirements

[*] http://docs.openstack.org/infra/bindep/

Change-Id: I936ff0e7c58df8ddfe5fbc6f4e387868ac16a0b0
2016-06-28 09:18:11 +00:00
Ondřej Nový 739ccb324b Deprecated tox -downloadcache option removed
Caching is enabled by default from pip version 6.0

More info:
https://testrun.org/tox/latest/config.html#confval-downloadcache=path
https://pip.pypa.io/en/stable/reference/pip_install/#caching

Change-Id: I9b3cc5abb8ebc6cef95f4f98fe031ae4c5ccb279
2015-12-11 22:52:10 +01:00
Gregory Haynes 61951bc77c Reorder py27 test to happen after py3 tests
This prevents hitting bug #1229445

Change-Id: I39c4919e696059e21664cae2da40f5e916b0d276
2015-02-17 22:09:28 +00:00
Gregory Haynes 110081865c Separate out py3 requirements and remove email
The email module is included with py3. Separating out py3 requirements
so we dont try to install it there.

Change-Id: I06d4fdf46677db6465374cc8da6b5cdd0c5defa3
2015-02-14 00:11:46 -08:00
Michael Krotscheck 3480bc69c0 Removed py33 and pypy
We don't test pypy. Infra no longer has instances able to test
py33. Removing these from our tox.ini file seems sane.

Change-Id: Icf42af12b61749a115136f25a219f4083500f353
2015-02-11 14:48:49 -08:00
George Peristerakis fc8b35afbd Whitelisted bash in the tox configuration
Change-Id: If333d240e6b6b5c22a3e29a32ab6ac62c6eb071b
2015-01-29 11:08:10 -05:00
Nikita Konovalov e136c92ca4 Adding pretty-tox
Tests output looks more informative with it.

Change-Id: I09377a383607c9d4bbb5aa6506bc83e1ced39de0
2015-01-23 17:37:54 +03:00
Michael Krotscheck 04e3b29bff Removed py26 environment from tox.
In an effort to move away from outdated and poorly ported
technologies, we are removing support for python 2.6.

Change-Id: I11ff08151ef8906aafbd61c55f08eb87ad19807d
2014-10-08 16:14:38 -07:00
Jeremy Stanley caef6f4a4b Work toward Python 3.4 support and testing
Change-Id: Ib8796a54153eed1af8d15644099f3cc2cec61d34
2014-09-03 19:03:08 +00:00
Nikita Konovalov e5af375d59 API tests for rest
Added tests for /stories endpoint

Added mock for sqlalchemy session.

Change-Id: I927b857b646ce014624d8fdd5eb2bc2803601e9e
2014-01-23 17:23:58 +04:00
Ruslan Kamaldinov b0d72b74e5 Fixed doc build
Fixed doc build by aligning Sphinx version with global OS requirements.
Also added an entry for doc build to tox.ini.

Change-Id: Icf411219a73d4f50640e404d6db5019f5483e7f9
2014-01-17 10:02:03 +04:00
Monty Taylor d6066f2a75 Add SQLalchemy database model
As a step towards continuous deployment and having a pecan/WSME REST
interface, split the database out into SQLalchemy-based model using
Alembic for migrations. To support that, also pull in oslo.db and use
oslo.config for config files.

Change-Id: I33a1e72700be14e28255aaa52faed70c4686a3ec
2014-01-13 18:52:47 +04:00
Monty Taylor 3d62394619 Update tox config to use 1.6
Change-Id: I0a692ef5aa3e3bd847423f70460ce89c5d36397d
2013-09-25 12:07:32 -04:00
Monty Taylor 8f50ee9469 Fixed the import errors hacking warning 2013-07-15 13:56:36 -04:00
Monty Taylor a49f74bc11 Make testr tests run properly 2013-07-15 13:54:00 -04:00
Monty Taylor 8103db2161 Enabled more of HACKING 2013-07-15 13:48:50 -04:00
Monty Taylor 31ca1960c0 Fixed F403 2013-07-15 13:45:08 -04:00
Monty Taylor eeba502fe8 Fixed a bunch of pep8/pyflakes errors 2013-07-15 13:43:02 -04:00
Monty Taylor d035720744 Added OpenStack dev things
Added a pbr-based build system and a tox file and some requirements
files. Also moved the apps to all be under storyboard so that a
publication to PyPI won't do evil things from an install perspective.
2013-07-15 13:35:32 -04:00