187 Commits

Author SHA1 Message Date
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
Cyril Roelandt
dfe21bdba3 Add working functional tests to tox.ini
Change-Id: I9bd0190e9e9c539c732c31bbba80937e27721976
2016-12-01 17:42:12 +01:00
Li Wei
e40d3fff1d Add DeprecationWarning in test environments
Many deprecations are triggered early (on imports, for example)
before the warnings are enabled by the WarningsFixture in the
base test class.
To make sure all DeprecationWarning messages are emitted we
enable them via the PYTHONWARNINGS environment variable.

This copy from 1be35ff039d67c50866f2556ef847b048cbf3578

Change-Id: I25e51e8365e154489d6513db7a5dd05914a3b221
2016-10-20 14:41:38 +00:00
AvnishPal
48f8dd3a81 Use upper constraints for all jobs in tox.ini
Openstack infra now supports upper constraints for
all jobs. Updated tox.ini to use upper constraints
for all jobs.

Change-Id: I7d9df75b7f76f5019daae6e9fab30ebea5a7a834
Closed-Bug: #1614361
2016-08-22 14:43:18 +05:30
bria4010
ee1b6dce3c WADL to RST migration (part 1)
This brings the Images API Reference to the glance tree as part of
the effort described here:
https://wiki.openstack.org/wiki/Documentation/Migrate#API_Reference_Plan

This patch introduces (a) the tox environment to generate the api-ref,
and (b) the content of the Images v1 API reference converted to RST.
The content has been corrected where I noticed divergences with reality.

Note to reviewers: The conversion project is ongoing, that is, the doc
team is continuing to develop tools (for example, to display the response
codes in a table) and converging on a style for these docs.  So this isn't
a final product, there will be more patches later.  While this patch is
not perfect, it is pareto-optimal with respect to content (it's at least
as good as the current guide, and better in at least one place).  Thus
my advice, should you choose to take it, is that we should merge this
patch to get these docs in-tree, and make improvements as additional
patches that can focus on particular API calls rather than try to get
everything perfect on this patch.

Change-Id: I51dfaf1832108466f115ab183838c5f28e138312
2016-06-21 13:29:24 -04:00
Danny Al-Gaaf
f248c0ef93 use os-testr instead of testr
Make use of the testr OpenStack wrapper ostestr instead of
testr directly.

Closes-Bug: #1566353

Change-Id: I85972dd09384dad22e3b78b0365b2026f1baef5c
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2016-04-08 17:50:45 +02:00
Jenkins
e51f29176a Merge "Add debug testenv in tox" 2016-03-08 19:42:02 +00:00
ting.wang
0d97af65b4 Add debug testenv in tox
Once we add debug testenv, we can use "tox -edebug"
to debug test cases when tox is running.

Change-Id: I266b521b4d8ab3569e23ad2b2fbd4e498e4043e5
2016-03-08 10:13:27 +08:00
Jenkins
971fd94534 Merge "Do not use constraints for venv" 2016-02-29 14:33:21 +00:00
Andreas Jaeger
162ed97f80 Do not use constraints for venv
The venv environment is used by infra scripts to build tarballs and
documents - and used by both check and post jobs. In post jobs, we
currently do not support constraints, so add the non-constraints install
command here so that nova-docs (publishing of documents to
docs.openstack.org) and the tarball jobs work again.

Change-Id: I7116134ca0963de001223ba905619947fcbda07a
2016-02-28 19:12:38 +01:00