75 Commits

Author SHA1 Message Date
Zuul
7991f12e17 Merge "Switch to using stestr" 2018-07-16 14:49:41 +00:00
Chuck Short
cce25ed22e Switch to using stestr
According to Openstack summit session [1] stestr is maintained project
to which all Openstack projects should migrate.

Let's switch it then.

Also adjust requirements to pass the gate.

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

Change-Id: I79b2220c20a04e2e33360bc330b5b4b4124caf71
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-07-14 07:49:50 -04:00
huang.zhiping
0feeaf1f9b 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: Ic87686868f784f0e1b514d6b899cc16240d88d61
2018-06-09 11:47:48 +00:00
Harald Jensås
868965c340 Fix pycodestyle warnings/errors now visible with hacking 1.1.0
This fixes the warning/errors except for the C901 Function is
too complex in the ironic_inspector/rules.py's create method.

Bump's max-complexity to 18 in tox.ini to workaround the C901.

Story: 2001985
Task: 19604
Change-Id: I6c76a43353b1beb572dbde78dba4b4a839d45ea7
2018-05-08 23:46:05 +02:00
Doug Hellmann
5113ef51c5 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: I8a5c47cb8e4d623776cd4335754184f6f7f0d398
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 13:44:49 -04:00
Nguyen Hung Phuong
2dba74430e Remove empty files
plugin-requirements.txt
is empty file. We probably should delete it.

Change-Id: I8029e606a7d284287d4d430cbde479a252a33e64
2018-01-29 16:29:57 +07:00
Pavlo Shchelokovskyy
d3fd0d98ad Use general py3 tox env for default tox run
different distros already come with different minor versions of Python3,
so let's use general 'py3' tox env when invoking tox without specific
env.

This is just a convenience for developers and will not affect gates,
as they use specific tox envs, all of them pre-generated by tox by
default.

Change-Id: Ife1d1b66e5ebf698f16a5b830604117a6e111107
2017-12-28 15:00:19 +02:00
Andreas Jaeger
396ce758e9 Use native v3 tox jobs
Instead of a legacy tox job, use the already defined functional jobs
that do the same. Note that those jobs are named "functional", so update
tox.ini as well.

Remove unused playbooks.

Change-Id: Icdb1b94b0e69ffb55007e166705871010e8943c5
2017-12-17 18:58:58 +01:00
Zuul
15ebcf32ce Merge "Add request context and policy enforcement" 2017-10-19 21:40:24 +00:00
John L. Villalovos
7dbb7c1721 flake8: Enable some off-by-default checks
Enable the following off-by-default checks:
    * [H204] Use assert(Not)Equal to check for equality.
    * [H205] Use assert(Greater|Less)(Equal) for comparison.

Increase the version of hacking in test-requirements so that can use new
off-by-default checks.

No changes to code were required.

Change-Id: I7fe394d99eee980e90768902b9fc264a8be3fe15
2017-10-16 14:25:15 -07:00
John L. Villalovos
19c1b8e5ca pep8: Add 'application-import-names = ironic_inspector'
Add 'application-import-names = ironic_inspector' to tox.ini.

Update files which failed pep8.

Change-Id: Ib908b75ac2bf262773978be62e11f973f9eba0d2
2017-10-16 14:24:48 -07:00
John L. Villalovos
2e25c5ed76 Fix for broken zuul v3 job and releasenotes
The Zuul v3 job is looking for the log files from the release notes
in: .tox/releasenotes/log/ but we had then in .tox/venv/log/

Fix it to where they Zuul v3 job expects it to be.

Change-Id: Ic0810a681efefe2be4656bc66e2477710a8b15dd
2017-10-16 12:06:34 -07:00
Pavlo Shchelokovskyy
198ef70c2b Add request context and policy enforcement
this patch introduces an oslo.policy-based API access policy
enforcement engine to ironic-inspector.
As part of implementation, a proper oslo.context-based request
context is also generated and assigned to each request.

Short overview of changes:

- added custom RequestContext class

  - extends oslo.context to handle of "is_public_api" flag
    (False by default)

- added context to request in each API route

  - '/continue' api sets the "is_public_api" flag to True

- added documented definitions for API access policies and their
  defaults
- added enforcement of these policies on API requests
- added oslo.policy-specific entry points to setup.cfg
- added autogenerated policy sample file with defaults
- added documentation with autogenerated policies

Change-Id: Iff6f98fa9950d78608f0a7c325d132c11a1383b3
Closes-Bug: #1719812
2017-10-13 11:55:52 +00:00
Pavlo Shchelokovskyy
7625ed68c8 Use ostestr unit test runner
This patch moves ironic-inspector to use 'stestr' test runner
via 'ostestr' wrapper.

Effective changes:

- unit tests are now being run in parallel by default
- 'py*' jobs are not running code coverage measurements,
  which is left for 'cover' job only
- 'cover' job now also produces html reports consumable by upstream CI,
  and fails under 90% of code coverage
- users can leverage all the ostestr/stestr features

Change-Id: I75f539457dbb1d811fdee69de52d1bcee4c6ebe6
Depends-On: Ica838db23b5714c2da1e4313e1a7ece0ca241d44
Closes-Bug: #1666232
2017-10-02 14:28:58 +00:00
dparalen
b1ce6f9ba3 Bump pydot2 to pydot3
pydot2 is incompatible with python3[1]. Bumping the pydot release (through
the test-requirements.txt) rather than pinning basepython to fix this.

Also updating the states.svg with the tox -egenstates result of running
pydot3

[1] https://github.com/erocarrera/pydot/issues/107

Change-Id: I9aa0e701af3915b39e1a5681c2105a6afb687dd2
Depends-On: I82e3651eefd3186c9e131b0db29a328967fb3161
2017-05-17 16:51:32 +02:00
Ramamani Yeleswarapu
7a670bfd5d Unpin python3 version for functional tests
Change-Id: I72a606b557ad552e5fc4279d2e79e1f2a424cda9
Closes-Bug: #1670461
2017-04-03 12:11:10 -07:00
Jenkins
04bc1cd404 Merge "Fix tox test failed because timezone is CST" 2017-03-06 21:25:46 +00:00
lihao
5b97e40c19 Fix tox test failed because timezone is CST
When the timezone of an ironic-inspector develop environment is CST,
tox test will fail. So we should set TZ to UTC by default.

Change-Id: Icebef00efe029d793e04e1aec81132805009bde0
Closes-Bug: #1669699
2017-03-05 07:09:48 +00:00
Annie Lezil
36ac6a388b Python 3.4 (py34) is removed from tox envlist
Python 3.4 is not a supported python version. So removing it from tox
envlist

Change-Id: I50e5f97cfac1d2f602da43c3c7a78566d58491e2
Related-Bug:1667312
2017-03-03 18:30:50 +00:00
Jenkins
234731b74a Merge "Add fsm dot diagram generator" 2017-03-02 16:46:33 +00:00
Anton Arefiev
886d05ee64 Add fsm dot diagram generator
Add a tool which generates dot diagram from inspector state machine
using atomaton pydot convertor.

Also add generated svg diagram to docs.

Change-Id: I021812288f1833a6ebad2f90cbe862d40bd8d503
2017-03-01 14:46:28 +02:00
John L. Villalovos
ea97d2b733 Use flake8-import-order
Use the flake8 plugin flake8-import-order to check import ordering. It
can do it automatically and don't need reviewers to check it.

Change-Id: I9ced9c297273db0eec6ab3995b663b1e8dffe87d
2017-02-16 10:11:06 -08:00
Jenkins
34c770c6b5 Merge "Add py35 to tox job list" 2016-11-09 20:28:38 +00:00
John L. Villalovos
4ba285bc5f Add py35 to tox job list
Add 'py35' to the tox job list, so that it will run unit tests using
Python 3.5 when doing:
    $ tox

Change-Id: I0059e016b3eb6e0d812706ee4a6e679a52c34e41
2016-11-09 05:39:30 -08:00
John L. Villalovos
ba9adaa2f5 Update to hacking 0.12.0 and use new checks
Use hacking 0.12.0

Use the new checks that are available:
    [H106] Don’t put vim configuration in source files.
    [H203] Use assertIs(Not)None to check for None.
    [H904] Delay string interpolations at logging calls.

Fix code so tests pass.

Change-Id: I7b1cd98aeb3bb8f4f01dd1d69d1afcd839749074
2016-11-09 05:37:10 -08:00
Dmitry Tantsur
cb8db157e4 Switch func3 environment to Python 3.5
Change-Id: I95943826f8d702466ab50a3f5c16bc147313ad41
2016-10-31 13:58:53 +01:00
AvnishPal
f3fd06fab5 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: Ibb49105fea5f119d181e7fd6f78ca6cf72ada33f
Closes-Bug: #1614361
2016-08-22 16:54:48 +05:30
Jenkins
f04a318cd4 Merge "Make tox respect upper-constraints.txt" 2016-04-11 11:20:36 +00:00
Marcellin Fom Tchassem
16594518f3 Make tox respect upper-constraints.txt
This will force pip install to use the upper-constraints.txt specified
version of pip modules. When you don't do this, you are out on the
bleeding edge and become unstable everytime some python library in the
wide world changes in a way that you don't expect.

Post jobs are not yet compatible with the upper-constraints file, so
override the install_command there to skip upper-constraints.

Credit to the equivalent Ironic patch
https://review.openstack.org/#/c/300146/

Change-Id: Ica668afedf622a0be8e8566ac88e1d0020ed9bc7
Closes-Bug: #1563038
2016-04-08 00:33:07 +00:00
Anton Arefiev
30ae1e72f1 Move unit tests to "unit" directory
This refoctor is needed for tempest test work as tempest tests
will placed in test dir. So move unit tests to separate directory
"unit" under test.

Change-Id: Ic99df6111ef30947148a9e38b9435a54f3d37064
2016-04-05 11:15:29 +03:00
Pavlo Shchelokovskyy
b71a3d9c79 Use dedicated config file for config generator
Change-Id: I1c9dcdb118005e10bc180afe8c81c8567c0b4c7b
2016-03-07 13:54:19 +01:00
Anton Arefiev
5086d93b41 Add enroll_node_not_found hook
Add new node_not_found_hook - enroll_node_not_found hook,
which allows to enroll unknown nodes to Ironic automatically.

Change-Id: If1528688504e4be4b2369b985bc576544d96868d
Related-Bug: #1524753
2016-03-01 14:00:31 +02:00
Janonymous
ffcf76a684 Put py34 first in the env order of tox
To solve the problem of "db type could
not be determined" on py34 we have to run first the py34 env to, then, run
py27. This patch puts py34 first on the tox.ini list of envs to avoid this
problem to happen.

Change-Id: I088ae4e71bfa2e673743193751410693d533153b
Closes-bug: #1489059
2015-12-22 18:22:53 +05:30
Dmitry Tantsur
99732e5297 Numerous improvements in the documentation
* Flatten the directory structure (we don't have that many doc files)
* Dropped HTTP-API from the root so that we don't maintain 2 copies
* Fixed links all over the place
* Leave one copy of README text in the root and include it in docs
* Update 'tox -epep8' to also check docs

Change-Id: Ic14cb73668544be27c6b96b384f93b239e49acfd
2015-12-02 18:07:22 +01:00
Jenkins
31bf3f1606 Merge "Do not explicitly mention requirements.txt in tox.ini" 2015-11-30 19:40:17 +00:00
Serge Kovaleff
292e8c9cfd Generate Sphinx docs
Change-Id: I540b28d6173b30baf6ee2e6e14d8ba5ffb67b660
Closes-Bug: #1514803
2015-11-27 11:56:36 +02:00
Dmitry Tantsur
f5671a4376 Use Reno for release notes management
Shameless copy-paste from Ic700d719242b17532b0b43a68b7eff507cb3a43c
and Iaef8b78802c04ec8306dd6f1da02d6c6a50697d8 with minimal changes.

Change-Id: I604136b72e2cf6b2bbbc3f9dc46ea3b419e495df
2015-11-26 10:12:14 +01:00
Dmitry Tantsur
a25b48715c Do not explicitly mention requirements.txt in tox.ini
It's handled by pbr anyway, and this makes it harder for tests
to pick requirements changes.

Change-Id: I1e5a7682da0a114dcfbe8dc0e2c2116f9b98628f
2015-11-16 14:11:59 +01:00
Kurt Taylor
9fbd91b9d1 Add coverage target to tox.ini
This creates a seperate target splitting out the coverage from the other
tests. The test directory and project names are different, overriding with
passed package name. Since testr is not used, coverage is called separately.

Change-Id: I32c132414a8b7e702b65617b95236397f4a471c2
2015-10-06 17:25:22 -05:00
Dmitry Tantsur
38ee2340d9 Add func3 tox environment for functional testing with Python 3.
It's the same as func, but runs functional tests with Python 3.
One issue was fixed in ironic_inspector.test.functional.

Change-Id: I6a081ad2ca8857018c6b531ed82182aab0ccca4d
2015-08-13 14:51:58 +02:00
Yuiko Takada
6ce87e8f42 Migrate to oslo_log
Use oslo_log instead of logging module.

Change-Id: I0e9c9b9b68ba9c8c4f1c0cdd0746991c53e2d7e5
Closes-bug: #1475690
2015-08-12 09:23:18 +09:00
Dmitry Tantsur
6c234a39ca Clean up tox.ini
* Don't repeat dependencies
* Reuse 'venv' for genconfig

Change-Id: I3cb011bbbacbe4708cb7e0021d7bf08c0362405e
2015-07-08 20:48:09 +02:00
Yuiko Takada
e195b4780a Migrate to oslo_db
Currently, Ironic-inspector uses SQLite as database.
We should migrate to oslo.db.
In this patch, make database connect operations to oslo_db.

Change-Id: Ibd0f787b570bc101eab9fbd0b59d8a775a95e2e0
Implements: blueprint migrate-to-oslodb
2015-07-08 08:33:23 -04:00
Jenkins
c946f616f9 Merge "Make functional test importable and stop depending on DIB code" 2015-07-01 07:39:17 +00:00
Dmitry Tantsur
def1f3700c Make functional test importable and stop depending on DIB code
With integration tests on the radar we no longer need to do
integration checking between ramdisk code and inspector here.

Also copy integration test script from functest to devstack.
Once we update the gate to use the new script, the whole functest
directory should be deleted.

Change-Id: Ic29e954fac1c535cb4f83d46ccea9ebfb80f840c
Closes-Bug: #1468748
2015-06-30 07:57:06 +00:00
Dmitry Tantsur
931685d008 Move Python ramdisk code out of tree
New home will be IPA, patch is already being worked on:
https://review.openstack.org/#/c/194116/

Anyway, we have to get rid of the ramdisk code before release.

Change-Id: I1b71a466059e70fd249712eaaf325efd459addcf
Closes-Bug: #1464708
2015-06-29 12:22:41 +02:00
Dmitry Tantsur
a7788a7a9a Move client out of tree
New home is https://github.com/openstack/python-ironic-inspector-client

Change-Id: I9b252f7007f568bfd19906662d7fb8b2e53574f6
Closes-Bug: #1464707
2015-06-18 16:50:03 +02:00
Dmitry Tantsur
9dcc2bb082 Switch to pbr
Also creates a required "venv" environment, drops version handling
from __init__.py and updates requirements.

Closes-Bug: #1466477
Change-Id: I57ce71ee52cc48e0239cdecb69fd2272fc99ea41
2015-06-18 16:09:07 +02:00
Sam Betts
dd0f0085a6 Add missing backslash and run genconfig
Change-Id: I0a9f6a4743de3903919480faeca3a2dc9cf97603
Closes-Bug: #1465303
2015-06-15 15:14:56 +01:00
Yuiko Takada
9df4c8c868 Pass environment variables of proxy to tox
When a development environment is under a proxy, tox is failed even if
environment variables of the proxy are set.

This patch fix this problem.

Change-Id: I24ca2f991832e5a0689c1051b60caf949d8225a1
2015-06-15 09:53:20 +09:00