196 Commits

Author SHA1 Message Date
Doug Hellmann
f3496591ae 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: Ic9645685e0f9ae25b0b2b754b11e34d8aef41829
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-07-10 05:05:08 +00:00
Zane Bitter
7ef796bbcf Use group_regex to serialize scrubber tests
Instead of doing two separate test runs, use the group_regex option to
stestr to group tests that cannot be run in parallel into the same
worker.

Change-Id: I3d69d5c72d69484f4e1c9c0b11122d0cf3703d60
Related-Bug: #1768077
2018-06-07 09:25:04 -04:00
Brian Rosmaita
837937f8d2 Add glance-eventlet-ssl-handshake-broken-py35 job
Blacklist the two currently skipped functional-py35 tests and
include them in a new non-voting job so that their failure is
obvious instead of hidden.

Change-Id: Ice8e114c6590b25f3ec79fbe4c06efaa245706c0
Partial-bug: #1769006
2018-06-05 22:32:28 -04:00
Brian Rosmaita
427a22109a Prevent early exit from functional tests
Default behavior in tox is to bail when there's a failure in a set
of commands in a testenv.  Now that the functional tests run multiple
commands, this behavior isn't desirable.  Add the ignore_errors
configuration to the two functional testenvs so all functional tests
will be run.

Change-Id: I8525d0988c6df4d3339e2ac68dc9b6effe07231f
2018-05-09 12:09:12 -04:00
Brian Rosmaita
189ca47598 Run scrubber functional tests in serial mode
The current scrubber functional tests seem to be confusing the subunit parser.
This patch modifies the functional test definition in tox.ini to run serial
tests separately from the "regular" functional tests and moves the current
scrubber tests to the 'serial' directory

Change-Id: I041c90aa8854bca30f9ea7b0c9d81e41f79cb81e
Partial-bug: #1768077
2018-05-08 02:04:51 +00:00
Brian Rosmaita
aba20e70ea Add redirect capability to glance docs
Adds .htaccess containing redirects so old URLs can retrieve
the correct document from the docs reorganization introduced
with commit 1c7f556d4f77d2dd7f282f2b41bdfb2abb6e5740.

Change-Id: I9678eedd5634ac04482f3f8b5ee0e4177cf985e3
Needed-by: https://review.openstack.org/564344
Partial-bug: #1766257
2018-04-25 21:38:59 -04:00
Nguyen Hai
5e5ba92aec Follow the new PTI for document build
For compliance with the Project Testing Interface as described in:
https://governance.openstack.org/tc/reference/project-testing-interface.html
http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html

Remove the '[build_sphinx]' and [pbr] sections as described in:
http://lists.openstack.org/pipermail/openstack-dev/2018-March/128594.html

Adds the use of sphinxcontrib.apidoc to get (mostly) the same output as what
was provided by the removed [pbr] section.

Change-Id: Ie7e3acef7161cb8f218c2333167490c8116a2122
Depends-On: https://review.openstack.org/#/c/560270/
2018-04-11 06:02:54 +00:00
Doug Hellmann
b4d93b627a 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: Ibd41a407f8f5f4eb2de1a44904fb7df5ab81e30c
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-04 14:31:23 -05:00
Brian Rosmaita
edf41df02b Make functional tests run by default
The Glance unit and functional tests were split out by change
I93d7216340bef70fc18fc9943da5c740ba3d4761.  (Previously Glance had
only 'py27' and 'py35' tox testenvs that handled both unit and
functional tests.)  That change made it easier to run the faster
unit tests separately during development, but made it so that simply
running 'tox' locally no longer ran all relevant tests.  This change
modifies tox.ini so that running tox with the defaults will run all
unit and functional tests.  The tests continue to be run separately
in gate/check jobs.

Change-Id: I6745ebfc0ca7e8b59dc4abf63b3d6dad1fde76fd
2018-04-02 16:10:43 -04:00
Abhishek Kekane
64eda44029 Execute py35 functional tests under py35 environment
Recently merged patch [1] causes py35 functional tests under py27
environment. As a result py35 functional tests also hangs (refer
bug [2]). The reason for this is in patch [1] intended to use already
created environment using 'envdir' variable but somehow it uses py27
environment instead of py35 environment.

Removed 'envdir' from functional and functional-py35 section so that
it can creates its own environment for execution.

[1] https://review.openstack.org/#/c/474816/
[2] https://bugs.launchpad.net/glance/+bug/1744824

Change-Id: I405b3718358b9977384696c8f004ffb2cf922ef5
2018-01-25 07:21:40 +00:00
Zuul
44a9cf68cc Merge "Implementation of Inject metadata properties" 2018-01-24 09:40:08 +00:00
Zuul
a8cf96ad85 Merge "Add doc8 to pep8 check for glance project" 2018-01-23 17:15:53 +00:00
Sean McGinnis
466c10420b Separate out functional tests
This breaks out the functional tests from the unit tests to allow running
just unit test for faster validation. Additional gate jobs will be added
to run the new functional test jobs so we don't lose that coverage, but
during development, by default only the unit tests will run.

Change-Id: I93d7216340bef70fc18fc9943da5c740ba3d4761
2018-01-22 10:29:34 -06:00
Nguyen Van Trung
97dbfb02d7 Add doc8 to pep8 check for glance project
This patch adds a doc8 check of .rst files to the current pep8 check.
It includes fixes to the .rst files that didn't pass the check.

Co-authored-By: Hoang Trung Hieu <hieuht@vn.fujitsu.com>
Change-Id: I5a9299200202576d97760ebf07bceb930888f2d7
2018-01-19 08:20:56 +00:00
bhagyashris
f5ae04b9f3 Implementation of Inject metadata properties
Implements the spec Inject metadata properties automatically
to non-admin images

This commit adds new task '_InjectImageMetadata' to inject
the metadata properties automatically to non-admin images
at the time of creation of images using newly introduce
'image-import' api in v2.

DocImpact

Implements: I6a7ed31d5fae677cbbc9a6f6053f79d3e9326561
Change-Id: I98be97c42f23b60a72d520aad5f6078a96372c59
2018-01-19 12:11:31 +05:30
Zuul
c05aeb8226 Merge "tests: replace .testr.conf with .stestr.conf" 2017-10-30 21:49:20 +00:00
junboli
e571e1878f tests: replace .testr.conf with .stestr.conf
TrivialFix:In the change[1] os_testr changed under the covers
from using testr to stestr, so that we now get the following
warning:
   ostestr.py:120:
   UserWarning: No .stestr.conf file found in the CWD.
   Please create one to to replace the .testr.conf. You
   can find a script to do this in the stestr git repository.
So remove the .testr.conf and add .stestr.conf which was
generated using a utility script as documented here [2].
[1] Id7cb2a39a8308f1413608dcf19273a1d7f33592e
[2] https://media.readthedocs.org/pdf/stestr/stable/stestr.pdf

Change-Id: I4810ac86aeca23e5abff3dc0417ffa3aa2f3a199
2017-10-13 23:42:03 +00:00
Jenkins
32f4e50fc7 Merge "Add a local bindep.txt override" 2017-10-12 23:42:02 +00:00
Dirk Mueller
8db99e2213 Add a local bindep.txt override
This avoids falling back to the global bindep-fallback.txt which
installs a pretty big environment. Without this change, a lot
of additional but unnecessary packages are installed on the nodepool
workers.

Change-Id: Id6c17f9a53ad8ad5f0bb9d308ccf5d33a6f59f7f
2017-05-25 23:13:21 +02:00
Alexander Bashmakov
9a55baa2c8 Clean up py35 env in tox.ini.
This patch enables the py35 job in tox.ini to run using ostestr.
It also fixes a bytes encoding issue in the 'test_wsgi' functional
test to make progress towards the community goal of enabling
python3.5. Two other functional tests remain disabled and will need
to be addressed in a later patch in order to fully complete the
community goal - 'test_ssl' and 'test_reload'. These tests fail
due to SSL handshake not working in python3.5 when using self-signed
certificate and authority.

Change-Id: Ie9071f1a93d8201f754ae3042d6e51b5de6d2e63
2017-05-09 22:54:59 +00:00
Andreas Jaeger
0a98c2733c Fix periodic py27 oslo-with-master test
The tests
http://logs.openstack.org/periodic/periodic-glance-py27-with-oslo-master/
fail due to changes in tox.ini, the substitutions do not work.

Create separate py27 test environment and adjust the used tox environments
for base-python.

Change-Id: I482c2d891e5ee067235b2c62e958f1f571b6e6ad
2017-05-08 10:33:45 +02:00
Jenkins
085f375a13 Merge "Fix and enable integration tests on py35." 2017-04-13 23:49:15 +00:00
Alexander Bashmakov
b75a0fcc59 Fix and enable integration tests on py35.
Fixed the tests in the `glance.tests.integration` module. Enabled
them to run for py35 job in tox.ini. All changes are related to
string/bytes object differences in python 2.7 vs 3.5.

Also added testing of tasks location header value due to a change in
how it is handled in py27 vs py35.

Change-Id: I26aae0c518fe84c9967461a3b9fef02bc0c17923
2017-04-06 18:14:46 +00:00
Alexander Bashmakov
c07969b439 Fix and enable two funcitonal tests on py35.
Fixed test_api and test_glance_manage functional tests to work on
python3.5. All of the changes are related to decoding of bytes
objects into strings and sorting of json dictionaries.
Enabled the tests in tox.ini.

Change-Id: I5bfcb34956aaf82beaa5e286f2569ccaac5ad32a
2017-03-23 21:58:49 +00:00
Jenkins
16de72b4b4 Merge "Fix and enable remaining v1 tests on py35." 2017-03-23 17:11:05 +00:00
Alexander Bashmakov
2e0201e717 Fix and enable remaining v1 tests on py35.
Two functional v1 tests were previously not enabled on py35 runs:
`test_api.py` and `test_copy_to_file.py`. Fixed and enabled them
to run in tox.ini. All but one of the changes are related to string
vs bytes differences between python 2.7 and 3.5. Additionally, a
instance of sys.maxint (which was removed in python3) has been
replaced with sys.maxsize.

Change-Id: Ib73aa3feb273e20754e084439376fc171fd84f44
2017-03-22 23:02:16 +00:00
Alexander Bashmakov
b93cafcb42 Fix and enable test_cache_middleware test on py35.
Fixed glance.tests.functional.test_cache_middleware tests to work on
python3.5. Enabled running the tests in tox.ini.

Change-Id: Ie5d4ee52c378aae97f3c944aec8be1a1c4a5edd5
2017-03-22 23:01:55 +00:00
Javier Pena
ce92edafd2 Remove glare leftovers from setup.cfg
I3026ca6287a65ab5287bf3843f2a9d756ce15139 removed Glare from the Glance
codebase, but left some lines in setup.cfg.

This patch removes the remnant of the references in the code tree.

Co-Authored-By: Javier Pena <jpena@redhat.com>
Co-Authored-By: Nikhil Komawar <nik.komawar@gmail.com>

Depends-on: I02bfe805c419fcc49ac43b66f4f7b1a0d1d54755
Change-Id: Ia3652eb0dede3614cc4ea880f8ddc06c95740797
2017-03-04 15:59:29 +00:00
Hemanth Makkapati
95c7c1b753 Refactor tests to use Alembic to run migrations
* Functional tests now use alembic instead of sqlalchmey-migrate
  to build and destroy test database.
* All tests now use a file-based sqlite db as opposed to an in-memory
  database.

Partially-Implements: blueprint alembic-migrations
Change-Id: I77921366a05ba6f9841143af89c1f4059d8454c6
Depends-On: Ie8594ff339a13bf190aefa308f54e97ee20ecfa2
2017-02-01 16:08:17 -06:00
Alexander Bashmakov
88c038b043 Enable python3.5 testing.
This patch enables py35 venv in tox.ini and fixes failing
unit tests.

Change-Id: I1e56056e109a1b4838cd94bccce28199c71f17fd
2016-12-21 05:55:37 +00:00
Jenkins
7d364aebd8 Merge "Update tox configuration file to reduce duplication" 2016-12-21 00:15:18 +00:00
Jenkins
316bca40a0 Merge "Python3: fix glance.tests.functional.v2.test_images" 2016-12-20 21:06:18 +00:00
Jenkins
e88f9a9a30 Merge "Python 3: fix glance.tests.functional.v1.test_misc" 2016-12-20 18:00:29 +00:00
Ian Cordasco
44b0f84c2d Update tox configuration file to reduce duplication
While reviewing a separate patch in which an entire test environment was
simply copied and pasted just to change the basepython attribute, I
realized Glance could utilize tox's feature set in a much more efficient
manner.

Tox allows you to generate envlists, have "factor-conditional" settings,
and other "factor-conditional" conditions since version 1.8:
https://tox.readthedocs.io/en/latest/config.html#generative-envlist
A good minimum version, though, is 2.3.1 because it has made support for
these features more robust and a lot of bugs have since been fixed.

Change-Id: Ia44a37177d57b972c4c9d0f179291b0c8316dd95
2016-12-20 11:23:36 -06:00
Jenkins
b91bbaa9a2 Merge "Python3: fix glance.tests.functional.test_scrubber" 2016-12-20 08:54:56 +00:00
Jenkins
96221514c5 Merge "Python3: fix logs/glance.tests.functional.test_healthcheck_middleware" 2016-12-20 07:11:26 +00:00
Jenkins
fc83c8a5d0 Merge "Python3: Fix glance.tests.functional.test_glance_replicator" 2016-12-20 06:17:14 +00:00
Jenkins
d4d76ce09e Merge "Python3: Fix glance.tests.functional.test_bin_glance_cache_manage" 2016-12-20 00:58:55 +00:00
Jenkins
5ce416cc87 Merge "Python 3: fix glance.tests.functional.db.test_sqlalchemy" 2016-12-19 23:32:55 +00:00
Jenkins
a4d261daa5 Merge "Python3: fix test_client_redirects.py" 2016-12-19 22:19:48 +00:00
Jenkins
835a18d678 Merge "Add working functional tests to tox.ini" 2016-12-14 17:46:28 +00:00
Jenkins
472fd5206b Merge "Use upper constraints for all jobs in tox.ini" 2016-12-14 04:41:52 +00:00
Cyril Roelandt
ddb2b87a20 Python3: fix glance.tests.functional.v2.test_images
Change-Id: Ib72948e5155bec3530cf430e70a3d77e613cbdcd
2016-12-01 17:43:22 +01:00
Cyril Roelandt
37a6f30aa0 Python 3: fix glance.tests.functional.v1.test_misc
Change-Id: I7b552dd0b942363c3e049d25dd20d5166c727d7a
2016-12-01 17:43:22 +01:00
Cyril Roelandt
1d5dd0641a Python3: fix glance.tests.functional.test_scrubber
In Python3, the division of two integers may return a floating number, which is
not a valid argument for the range() function.

Change-Id: I7b301c474c2501a5b83b3cb242803dbee669c3bc
2016-12-01 17:43:22 +01:00
Cyril Roelandt
5521b6d906 Python3: fix logs/glance.tests.functional.test_healthcheck_middleware
Change-Id: Ic65240d98bbfb8ff8ee4f31b106a8556befc41dc
2016-12-01 17:43:22 +01:00
Cyril Roelandt
eab64feaea Python3: Fix glance.tests.functional.test_glance_replicator
Change-Id: Ie6be20b7d76034fdb70f25a71cc73e17c785e3d0
2016-12-01 17:43:22 +01:00
Cyril Roelandt
401f544d0c Python3: Fix glance.tests.functional.test_bin_glance_cache_manage
The tests were faulty here.

Change-Id: I7ee53bd6890536ec0c9cb6a0ae43c84c2c391f10
2016-12-01 17:43:16 +01:00
Cyril Roelandt
6540f9319a Python 3: fix glance.tests.functional.db.test_sqlalchemy
This patch fixes 3 issues:
- "RuntimeError: dictionary changed size during iteration"
- "TypeError: 'map' object is not subscriptable"
- "TypeError: object of type 'map' has no len()"

Change-Id: If52ab336512f37b6e5ad6c748bef7996c67cb71a
2016-12-01 17:42:12 +01:00
Cyril Roelandt
c366881f30 Python3: fix test_client_redirects.py
Change-Id: I68d3430e9d741250edb6d000585d06f958cea105
2016-12-01 17:42:12 +01:00