Commit Graph

61 Commits

Author SHA1 Message Date
Hasan Acar a24fd834d0 fix: migrate CI to jammy
fix: change tox.ini

fix: change queries for list_dimension_names and list_dimension_values because of influxdb time filter problem

fix: remove build_sphinx group from setup.cfg

fix: handle hashlib security problem

Change-Id: I0d31a8db5ed71c70e7b878ce5e7940e041d0fa43

Change-Id: I6f7066da10e834550cbf0c053c7bf425ac0ead93

Change-Id: If9575aee73d600bbc84fcdf58deb1c57b508d9c2

Change-Id: If515eaeee7539da3ca49997e88785dc65572b334
2024-02-22 14:35:03 +00:00
Ghanshyam Mann 658c68b593 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: Ibd8664001aa3960f3994340cfd31683d8514a280
2022-04-30 19:22:11 -05:00
Ghanshyam Mann dea6f95c15 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: Ibfb162f88cb04c0b2af3fbf41cfcd96bc7e351be
2021-02-02 14:36:06 +00:00
Hervé Beraud 9cb4a752c0 Add doc/requirements
We need to specify doc requirements in doc/requirements.txt
to avoid problems with the pip resolver [1] for the release team [2][3].

Removing specific doc requirements from test-requirements.txt.

The problem here is that this repos haven't doc/requirements.txt file
and by default in this case zuul will use the test-requirements.txt file
to pull requirements [4].

This requirements file contains extra requirements like flake8 that
collided with those allowed in our job environment and so the new pip
resolver fails to install these requirements and the job exits in error.

This project meet the conditions leading to the bug.

[1] http://lists.openstack.org/pipermail/release-job-failures/2021-January/001500.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2021-January/019611.html
[3] http://lists.openstack.org/pipermail/openstack-discuss/2021-January/019612.html
[4] https://opendev.org/zuul/zuul-jobs/src/branch/master/roles/ensure-sphinx/tasks/main.yaml#L36

Change-Id: I582c7b1b8008e72f376a24a58ca1ee5ac4d933bb
2021-01-07 13:18:06 +01:00
likui 2d520d5099 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

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

Change-Id: Ic52698b4147d451e0b5ce25dbbf83083ccd69115
2020-12-04 12:49:00 +00:00
zhangchun 344c62671a bump py37 to py38 in tox.ini
in 'victoria' cycle, we should test py38 by default.
Trivial change

Change-Id: I255addda0c344ad24335a709b2ab9ad6964b5c35
2020-11-02 10:39:31 +00:00
Martin Chacon Piza a99d2f063a Fix and unify cover environment
Fix cover environment and unify it accordingly to Project Testing
Interface [1].

[1] https://governance.openstack.org/tc/reference/pti/python.html#coverage-jobs

Change-Id: I045d46d74809e506bcd94deaefc5477461616071
2020-05-27 18:14:09 +02:00
Andreas Jaeger abad342eb2 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found by updated hacking version.

Remove hacking and friends from lower-constraints, they are not needed
there at all.

Change-Id: I35d848e9af297d3561ea2838a4808166d1c36601
2020-04-22 07:37:55 +00:00
Ghanshyam Mann e2789e8a9d [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

monasca-api is ready with python 3 and ok to drop the
python 2.7 support.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Depends-On: https://review.opendev.org/#/c/693631/
Change-Id: I5daa9bb079d0373d0e1379d20e98dd5c0880d312
2019-12-10 13:58:58 +01:00
pengyuesheng cc09e9040a Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I802dae2d7106c487b1c77d143edce6b52f5d3810
2019-09-20 17:25:36 +08:00
agreentree 1f9ef03828 generate monasca pdf documentation
https://storyboard.openstack.org/#!/story/2006097

Change-Id: Ia915b535cee5f80fe7c7bcc10c7c87ca3de3bc14
2019-09-04 19:40:47 +00:00
Shubham82 6cc6c9ba4f Switch python3 versions of test jobs to match Train PTI
In Train, we will use python 3.6 and 3.7 for python3 runtime
in our gate jobs [1]. This commit also adds python 3.7.
In Python3.7 async is a reserved keyword so replacing it with is_async.

[1] https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I05f40c4a9304cad551cefd4f10c3ba9a72d69a6f
2019-07-26 14:31:42 +05:30
Thomas Bechtold 96e13dad75 Replace api-config.conf with monasca-api.conf
api-config.conf is the deprecated path for the configuration file. The
new path is /etc/monasca/monasca-api.conf .

Story: 2004708
Task: 28987

Change-Id: If06d9114529c3ef4520247dfc7c32d3769f07084
2019-01-19 12:15:22 +01:00
Sean McGinnis 917676e868 Remove setup.py check from pep8 job
Using "python setup.py check -r -s" method of checking the package has
been deprecated with the new recommendation to build the sdist and
wheel, then running "twine check" against the output.

Luckily, there is already a job that covers this that only runs when the
README, setup.py, or setup.cfg files change, making running this in the
pep8 job redundant. This covered by the test-release-openstack-python3
that is defined in the publish-to-pypi-python3 template.

More details can be found in this mailing list post:

http://lists.openstack.org/pipermail/openstack-dev/2018-October/136136.html

Change-Id: Id846625bdbf3390a0a0bfe441418f763f052dc62
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Depends-On: https://review.openstack.org/615557
2018-11-05 13:20:35 +00:00
Doug Hellmann b81a46e77b 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: If881880f3199a53e7eaa5e6db86e3fab5db48de3
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-05 13:21:09 +00:00
lvxianguo 902c6d1558 [Trivial Fix] change the unicode of some higher numbered characters
Change-Id: Ib83fdbe69140ce16c34ced10b3472b0120a9870e
2018-09-07 08:44:04 +08:00
Nguyen Hoai Nam 9deb316feb fix tox python3 overrides
It is necessary to add python3 as the base python for the genpolicy
test.

Change-Id: I863f1e13ad0053e88ce94cab1bb11274dc304641
2018-08-23 11:36:27 +00:00
Adrian Czarnecki 55b2ce0312 Disable B303 bandit test
Change-Id: Ie2d308d271ef8c237ec855e16cc6efdb999ac33d
2018-08-22 14:25:47 +02:00
Witold Bedyk fb675ac141 Fix README.rst and add syntax check
Change-Id: I3559cccac407f0f6c72597bf874e3bfd4bfe7f76
Story: 2002163
Task: 24277
2018-08-06 14:23:12 +02:00
Chuck Short 7cf608c31d 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.

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

Change-Id: Icaff30a749d68d745191958196a6dbba6352f59c
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-06-29 12:00:48 -04:00
Zuul 493d36f1ad Merge "fix tox python3 overrides" 2018-06-12 08:11:15 +00:00
Doug Hellmann 0b6c6561f5 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: I9e1dfd8d4ff6039cbf6d26d1c55fe8c6f7fb84e1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 16:06:02 -04:00
Amir Mofakhar 3ca4b057dd Using oslo.policy for monasca-api
Added policies and used policy enforcement engine
from monasca-common.

- Replaced security with oslo.policy
- Updated unit tests and implemented some new tests
- Added a new entry point for generating sample policy file by tox

story: 2001233
task: 6355

Change-Id: I4aa444fe6ec883160c03c201145c77994b6615f9
Signed-off-by: Amir Mofakhar <amofakhar@op5.com>
2018-06-05 12:25:07 +00:00
Zuul 5f18d192a9 Merge "Update pep8 checks" 2018-04-16 13:23:22 +00:00
Jui Chandwaskar 03bd329dd0 Update pep8 checks
* Update max line length to 100
* Clean up code for pep8 checks

Change-Id: Ibde2939831e6eeaab3db66fbc18255c71592bb41
Signed-off-by: Jui Chandwaskar <jchandwaskar@op5.com>
2018-04-11 12:40:27 +02:00
Witold Bedyk a449b1355e Fix lower-constraints job
* bump lower-constraint for cassandra-driver version to 3.3.0
* add cassandra-driver and influxdb to extras
* execute lower-constraints job with python 2.7
* move common commands to [testenv]
* fix lower-constraint for sphinx
* add funcsigs to lower-constraints.txt

Depends-On: https://review.openstack.org/555402
Change-Id: Idc2351e597ce933fa5c83a6c872ae241ce4b0220
2018-04-09 14:15:47 +02:00
Doug Hellmann 50d73ca3ab 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: Ie26e8ffc7dc7620e7ea1b4e8004cff1f849f0b68
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 15:47:26 -04:00
Luong Anh Tuan 5703d0c775 Enable more extensions in pep8
This patch enable extensions:
-[H204] Use assert(Not)Equal to check for equality.
-[H205] Use assert(Greater|Less)(Equal) for comparison.

Change-Id: I04b06851e13dd34c63040b648dff576f68a7abec
2018-02-01 02:11:46 +00:00
Chandan Kumar 80b4f18e1e Remove bundled intree monasca-api tempest plugin
* https://review.openstack.org/#/c/526844/ move the intree
  bundled tempest plugin to a new repo monasca-tempest-plugin.
  Let's use it and remove the bundled tempest plugin from repo.

* Moved post_host script to main root directory
* Removed dummy gate_hook.sh script
* Fixed the jobs for the same

Story: 2001400
Task: 6085

Depends-On: I2ce2bd8238d44a451faeba9ddbfe27d900e9adef
Change-Id: I79cea368271bbef33914dba7b95f5546a1b8d3c1
2018-01-31 11:50:16 +05:30
Andreas Jaeger 53ae9853a3 Remove -U from pip install
'pip install -U' ugrades specified packages, this is not necessary
since we use constraints, remove the parameter '-U' from the line.

With tools/tox_install.sh - which a previous change of mine removed -
the -U was not harmful, but with the current set up, it might cause
upgrades, so remove it.

Change-Id: I393d267a44298cadd4bdd9f9c107a07b82602eec
2017-12-02 19:26:15 +01:00
Andreas Jaeger ec5a0f2607 Avoid tox_install.sh for constraints support
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.

This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.

Change-Id: Icdf31c157dba7018770502517ad6cee87b73c16f
2017-12-01 15:37:36 +01:00
Adrian Czarnecki cdc3acb279 Migrate to Zuul v3
Story: 2001238
Task: 5764
Task: 5765

Change-Id: I263b1a92a9ec7b5e38d9c1dc8b02e214102a92c2
Needed-By: I7bc913d0e5cd9e8a06a63cc3d11740056c7036d7
2017-10-24 04:16:44 +00:00
Tomasz Trębski dae93af09d Make legacy gates working
- make pep8 working by removing ChangeLog that is not generated
- make maven working by removing condidation for user
- make legacy dsvm working by using $USER intstead of hardcoded jenkins

Change-Id: I30f2edc4d34d0fad63f961f99dcecaf5c767f57f
2017-10-18 11:01:28 +00:00
Tomasz Trębski 5d27af4079 Config-generator for monasca-api
Change migrates the monasca-api to use oslo-config-generator in
order to always build newest configuration file. That removes
the need of maintaning the file along with changes to oslo configuration.
The example of the file is also included in the documentation.

Also:
* ported case for launching api under WSGI and allowing the argument
  parsing of oslo to take place

Story: 2000970
Task: 4865

Story: 2000964
Task: 4106

Change-Id: I57547b0e2122e40f58db5f949773900b76214526
2017-08-28 06:58:57 +00:00
Tomasz Trębski 366c8886f9 Unify test setup
Change make the tests follow the same approach
for every possible case. This change is required to
properly introduce configuration parsing from a single
place.

Change-Id: I14fbf71eddd0930ecaa6330955f74ebc8677912b
2017-08-11 04:31:20 +00:00
Tomasz Trębski 332634f74f Prepare foundation for doc migration
Commit aims at providing the foundation to launch
doc migration for monasca-api:

* api-ref
* releasenotes
* doc

Extra:
* fixed documentation errors to enable codebase documentation

Story: 2001058
Task: 4768

Change-Id: Ic7af65a154dba7e52ffb90d0e6dbf0ae87d5d699
2017-07-31 10:43:49 +00:00
Tomasz Trębski 175577d35b Validate all bash files inside devstack
Previously only plugin.sh was validated.
At the monent some parts of the plugin
were moved under devstack/lib to increase plugin.sh
readability. Those files were not validated.

Note:
    Tweaked a tox.ini by removing installing the monasca-api
    package in environments that do not actually need it.
    Also removed redundant references to main environment
    dependencies.

Change-Id: I43381647228fad99603b5717c37496e80f409d4f
2017-07-12 06:28:07 +00:00
loooosy 9ddddb01d3 Enable some off-by-default checks
Some of the available checks are disabled by default, like:
[H106] Don’t put vim configuration in source files
[H203] Use assertIs(Not)None to check for None

Change-Id: I0b6ea01d2efc4d8e0d96af169cadb410c49624aa
2017-06-23 17:20:33 +08:00
roland-hochmuth c8694aeff8 Remove xrange for run both Python 2 and Python 3
Change-Id: Ibf1b45fe27f1943265cdc36e99b7a53263885eb2
2017-05-31 08:51:43 +02:00
Witold Bedyk bcee24b323 Add bindep.txt
Change-Id: I84a365737c92d8c7b5205885cc2d1407f3f67112
2017-04-12 18:03:22 +02:00
Jenkins 984e0ab877 Merge "Use them same versions of Influx or Cassandra" 2017-02-24 13:20:19 +00:00
Tomasz Trębski 9d470036f5 [BASHATE] Extended code analysis
Followign code adds linting with bashate to
devstack/plugin.sh

Change-Id: Iec6e82a6ddc8ce4e405196509777c029139b5025
2017-02-16 07:51:46 +00:00
Yushiro FURUKAWA a4fe9f86c5 Use them same versions of Influx or Cassandra
Versions of Influx or Cassandra between tox and devstack
env were different. Now in both places OpenStack requirements
are used.

Additionally:
- moved Influx and Cassandra to test-requirements.

Change-Id: I5be1be023b605a0b7efe718796877b90f9dc06f0
Related-Bug: #1628719
2017-02-16 06:15:16 +00:00
Tomasz Trębski 228c24561b [WIP][BANDIT] Extended code analysis
Following commit enables bandit to analyse
code quality of both API and tempests code

Change-Id: I70e964b7f6afddb79b70416c8d99100bfcc8a379
2017-02-07 10:55:52 +01:00
Tomasz Trębski 10c19b6f6f [PEP8] Extended code analysis
Following commits makes tempests code
compliant with PEP8 rules

Change-Id: I08e0a001c3fd56201db71babc894a18d63706895
2017-02-02 09:43:10 +01:00
Tomasz Trębski ff0afc968b Migrate test run to ostestr
Instead of running tests with nosetests,
this commit migrates tox.ini to use ostestr
similar to other openstack projects.

Using ostestr, as well testrepository, results
in another useful feature where test results can be
seen in convenient graphical representation.

Additionally:
* added oslo_debug_helper
* extracted unit-like dependencies into external testenv,
that way they are not installed for target where
they are actually not required (like pep8)
* removed testenv:docs because monasca does not come
with sphinx documentation
* removed testenv:genconfig because monasca is not
compatible with supplying its entire configuration
they way oslo-config-generator expects

Change-Id: Ic5bb793847f7ab45731862f4208e94589421f490
2017-01-14 19:47:29 +00:00
Andreas Jaeger 37909061a0 Use constraints everywhere
Infra now supports constraints everywhere, remove now unused
workarounds.

For more information about constraints see:
http://lists.openstack.org/pipermail/openstack-dev/2016-August/101474.html

Change-Id: Ida7db987085fea39a3853e18ccfa6957f8cde15e
2016-08-30 20:12:00 +02:00
Deklan Dieterly 7abd139f0e Enable Cassandra Database
Implement the following resource endpoints using
Cassandra as a backend DB.

metric names
metrics
alarm history
measurements
statistics

Change-Id: I9ddbd2037fb6b989dee5e33945df9dd08afa84e8
2016-08-04 01:56:29 +09:00
Kaiyan Sheng 983f9d58a3 Move influxdb install into tox.ini and plugin.sh
Influxdb is a database which is better to move into tox.ini
from requirements.txt to make it more dynamic.

Change-Id: I1448ec7fc5585cb3b189c66f0b258c6df4e50d7d
2016-07-05 11:25:46 -06:00
Kaiyan Sheng ea2447df72 [monasca-api]Constraint tox targets with upper-constraints.txt
This review is to prepare for adding monasca-api into openstack
global-requirements. After this project gets into global requirements,
it will be in upper-constraints.txt. If we make changes on this
specific project, we need to replace it in the upper-constraints with
source based specifier before applying it to pip install.

Change-Id: Ib2505d53591f978353622a80f539d91285c966df
2016-05-20 22:10:22 +00:00