28 Commits

Author SHA1 Message Date
Witold Bedyk
ee42448e73 Add py36 tox environment
Change-Id: I40d383db83dca77445b411eba87a19d8d1457be1
Story: 2004148
Task: 28119
2018-11-28 10:01:35 +01:00
Sean McGinnis
9cd0d2836c 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: I7a3555dd0f0c4bcd1969ca7d3669369d7517a6be
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Depends-On: https://review.openstack.org/615557
2018-11-06 07:33:47 +00:00
melissaml
eb6eb9e683 Don't quote {posargs} in tox.ini
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')

Change-Id: I068ac92a340a5a31af53f77b69a702c5c138b4c8
2018-10-21 22:48:19 +08:00
Doug Hellmann
3cdad50696 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: Idd29b6d5460510ec02ec10853a0809185e5823cd
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-05 08:13:48 +00:00
Witold Bedyk
1017229c39 Fix coverage job for Python 3
* add coverage check job to Zuul
* migrate to stestr as described in PTI [1]
* unmock OffsetOutOfRangeError to correctly recognize it as Exception
and not a mock. Otherwise TypeError exception is thrown [2].

[1] https://governance.openstack.org/tc/reference/pti/python.html#coverage-jobs
[2] http://logs.openstack.org/60/606660/2/check/openstack-tox-cover/b3c1492/testr_results.html.gz

Change-Id: Idcb8b11778ce02596c1c02417ee6c88a33c7da03
Story: 2003240
Task: 26900
2018-10-05 10:09:06 +02:00
Witold Bedyk
34e4c58d50 Remove not used pykafka requirement
Story: 2003079
Task: 23153
Change-Id: Iba653db8935f9575a7838f6daa24b1ec90526815
2018-07-24 16:23:52 +02:00
Zuul
7257c671c9 Merge "Add check for rst syntax" 2018-07-19 11:23:00 +00:00
Witold Bedyk
b18cde2dc8 Add check for rst syntax
Creating the release would fail if the syntax of README.rst is not
correct. Let's check it in the pep8 environment.

Story: 2002163
Task: 23044
Change-Id: I2856622af08cec7c801959ca85f4c77252263db5
2018-07-18 16:11:30 +02:00
Charles Short
7903657bd1 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: Iebd6f34335e4ef0dd3629e970661d8c9ef08754a
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-07-16 11:40:15 +02:00
Doug Hellmann
193d1a3815 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: Ia156a087ff8f04307f255e61f3f2e9ffdae42861
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 17:03:33 -04:00
Zuul
d77bd7967d Merge "Updated pep8 checks" 2018-04-10 08:40:11 +00:00
Amir Mofakhar
806a418ede Updated pep8 checks
* set the maximum line length to 100
* removed unnecessary ignores
* updated codes for pep8
* added apache 2.0 license for missed files

Change-Id: If9398a8fdd094e50d6a07cb73f7389558dbe0a0d
Signed-off-by: Amir Mofakhar <amofakhar@op5.com>
2018-04-04 14:39:41 +00:00
Witold Bedyk
469df52e7c Execute ostestr in lower-constraints job
Change-Id: I9752713d2095c1a061aefaa577dc91a7da62fe4a
2018-03-27 11:40:45 +02:00
Doug Hellmann
9c426e867f 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: I0ef8ed50f55fa905b6090805a3088fc5ab56906c
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 15:47:51 -04:00
Andreas Jaeger
441d6efcd8 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: Ife6a6d88f636057f87d47fe79af8bfcff897ccc1
2017-12-02 19:27:29 +01:00
Andreas Jaeger
bad98c6722 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: Ib55145fd3f0ed0d8d56379c718e91ff55aa4aa27
2017-12-01 15:38:37 +01:00
Witold Bedyk
4d1715d3a9 Add bindep.txt
Change-Id: I89432f196f8cdaa66e3c113c55f5e84f15906dd6
2017-04-12 18:16:38 +02:00
Tomasz Trębski
cabc2ddd5f Migrate to ostestr framework and PY3
Following commits does several things:

* migrates CI of monasca-common to ostestr
* enables PY35 compatybility

Also:

* marked one tests as excluded under PY35 because changing
it would require affecting embedded kafka library which
will be eventually removed in future

Change-Id: I432a466e2620bc8d305ef2630307b636461c8e81
2017-03-02 19:51:04 +01:00
Craig Bryant
e8005cf1f1 Turn on bandit check as part of pep8
Add bandit job as part of pep8 in tox.ini

Had to ignore assert check since those are use for performance in the
validation code. Also, skipped bandit checks of monasca_common/kafka_lib
since that is just a clone of kafka-python and will be deleted in the
future

Change-Id: Ie2e726a8e45ef463c4e863792eed663ee472ed07
2017-02-09 09:04:56 -07:00
Joe Keen
cb2ec23cee Fork 0.9.5 kafka-python and require pykafka
To let other OpenStack projects move forward with new versions of kafka-python
we're forking kafka-python and embedding it in monasca-common.  This allows us
to migrate to the new async interfaces provided by more recent kafka clients
over time and not block other projects.

Requiring pykafka to allow us to have ~4x more throughput once we write to
their async interfaces.

Change-Id: Ifb6ab67ce1335a5ec4ed7dd8b0027dc9d46a6dda
Depends-On: I26f9c588f2818059ab6ba24f9fad8e213798a39c
2017-01-21 10:40:55 -07:00
Lukasz Wiecek
aae558035e Add proxy configuration for tox.ini file
Change-Id: I53b2fe578845d6a580efb2d8ef548b0b3e928eb1
2017-01-17 13:14:06 +01:00
gecong1973
b56e43aff7 Don't include openstack/common in flake8 exclude list
There is no this directory openstack/common which was used
to keep codes from oslo-incubator, we have retired oslo-incubator.
Removing openstack/commonfrom all OpenStack code in favor of the
Oslo libraries is a project wide goal for the Ocata release. So
don't use this directory any more. We should drop it for improving
searching efficiency.

Change-Id: I2e1a7ac2f9a8734ec60cf01ef04251fac3882452
2016-11-25 11:22:13 +08:00
Andreas Jaeger
21a38261d4 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: I27937c1fe02cd6fc04bd94a5162f78aef04b9c16
2016-08-30 20:14:13 +02:00
Laszlo Hegedus
c98478df18 Make monasca-common pep8 compatible
Cleaned up test-requirements.txt in order to use the latest hacking
package.
Removed the ignored pep8 checks and made the code pass all of them.

Also removed the OpenStack Foundation copyright notice that was put
there accidentally before.

Change-Id: I3d287eb71fc2bf0e4d52856c11cbc8a347cac2ed
2016-06-04 09:22:43 +00:00
Kaiyan Sheng
741a24e41a [monasca-common] Constraint tox targets with upper-constraints
This review is to prepare for adding monasca-common 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: I67a3e3fcb833e273900c490643197988efd5eb3b
2016-05-20 16:45:58 -06:00
Laszlo Hegedus
bfc88d4f05 Add unit tests for common Kafka module
Add tests for kafka producer and consumer modules. The test coverage
of monasca_common was was 9%. This is improved in this commit.

Show test coverage when running tox. Change the nosetests command to
show test coverage for the whole module.

Change-Id: I771a539aee5fa92c065ee16b5bb94c9ae7e7a09b
2016-05-17 10:50:12 +02:00
Haiwei Xu
e4ca678359 Delete python bytecode before every test run
Bring over the cleaning line from run_tests.sh for the pyc files to
all the tox runs.

This should eliminate the need to clean -x -i to kill pyc files in
your local directory to get tests to pass.

Change-Id: I0f59c977411d20751a26cac39504c51896b2eab8
Closes-Bug: #1368661
2015-12-02 13:34:00 +09:00
cindy oneill
21d3947845 initial python monasca-common code in monasca_common
This is the start of a python monasca-common package.
Initially it has a common python logging config,
common oslo opts, and mysql common code.

Change-Id: I15c32b72fc42a8c5ce9eeedf20ca3a11907bf29f
2015-09-01 13:56:39 -06:00