Commit Graph

37 Commits

Author SHA1 Message Date
Sanjay Chari 155fb7056d Fix tox issues
This patch fixes issues with the openstack-tox-molecule
and openstack-tox-linters Zuul jobs.

Change-Id: I577897953ff04a1e9cc3f70d32650d688e3b32fd
2023-01-06 10:47:27 +05:30
Masco Kaliyamoorthy 91101dbdc8 fix lint errors
Change-Id: Id857fc63f91d7673a5944637e821466e871990d3
2020-10-14 21:11:44 +05:30
Zuul ed9e7e75cd Merge "Add molecule infrastructure" 2020-02-14 15:20:28 +00:00
Charles Short 73138475dc Add molecule infrastructure
- Add molecule support to test ansible roles.
- Also fix flake8 failures.
- Also drop python36 from the templates

Change-Id: Ib647d93144a02a6be7340991c31f65842fdf3f29
Signed-off-by: Charles Short <chucks@redhat.com>
2019-12-16 08:11:35 -05:00
Charles Short 0fa8454fd1 Remove PerfkitBenchMaker
No longer supported.

Change-Id: Iae8ff4e0a1f55af67b49df16e8ecf276877f2525
Signed-off-by: Charles Short <chucks@redhat.com>
2019-11-20 14:54:43 -05:00
Charles Short 2ba39b30ab Refresh collectd for "train"
This commit does several things at once:

- Use ansible_distribution_major_version to detect which version of the
  EPEL repository. So we dont have to hard code the URL for either epel7
  or epel 8.
- Remove "stein" workaround for colelctd-openstack role. The "stein"
  workaround has been removed in favor of running the collectd daemon
  in a podman container.
- Drop opendaylight support for collectd since it is no longer
  suupported.
- Add the collectd playbook so we can run collectd in a centos 7
  container going forward for "train". This commit still needs
  to be tested on "stein" but it will probably work anyways.
- Add browbeat-containers to tox.ini for flake8
- Simplify detection of docker or podman for older versions of OSP.
(sai)
- Fixed typo from compute_compute to collectd_compute that caused failures on computes
- clear graphite_host in install/group_vars/all.yml
- Move container DockerFiles into brwobeat tree
- Conditionally copy required Dockerfiles to node instead of git clone
- Fix up some log file paths
- Use Docker/Podman depending on release
- Provide single interface(collectd.yml) which has container and baremetal playbooks
- Introduce variable collectd_container in install/group_vars/all
- remove unneeded selinux rebaelling (already running as priveleged) when running container
- remove unneed hostfs mount
- collectd container logs to file instead of STDOUT for easier debug
- add collectd-ping package to collectd-openstack Dockerfile
- Improve docs to reflect changes
- dynamically set rabbitmq and swift paths as well for tail plugin

Co-Authored-By: Sai Sindhur Malleni <smalleni@redhat.com>

Change-Id: I627a696f6f1240d96a0e1d85c26d59bbbfae2b1b
Signed-off-by: Charles Short <chucks@redhat.com>
Signed-off-by: Sai Sindhur Malleni <smalleni@redhat.com>
2019-11-05 08:08:37 -05:00
Charles Short c335d6439b Fix tox.ini
- Fix ansible-lint tox environment to run on python3.
- Ignore '306' lint check
- Remove python36, python35, only test on python37 (standard)

Change-Id: I75000b21dc4562d443e41ac93473a152acb53fe4
Signed-off-by: Charles Short <chucks@redhat.com>
2019-10-29 10:29:32 -04:00
Sorin Sbarnea 489300d832 Add pypi publishing testing
Builds the source and wheel distribution as part of linting job to
assure we can build the package.

Adds packaging temp files to .gitignore to avoid poluting the
repository.

Adds a publish tox environment which can be used for manual publishing
on pypi (exceptional cases).

Change-Id: If9176b33cc13904a516d8e64d53170f52f2baf55
2019-04-10 17:00:44 +00:00
agopi 4969f31ce1 Update ansible-lint execution
Updated ansible-lint to run via pre-commit only on ansible files.

Moved config file to its standard location, repository root, which
simplifies syncronization and usage.

Contains bumping ansible-lint to current version which also required
adding few more rule excludes. These excludes are going to be removed
one by one in follow-up changes. This gradual approach allow us to
improve code style without endless merge conflicts.

Config settings mostly based on those used by tripleo repos.

Bumping linters can now be done by running 'pre-commit autoupdate'.

Pro-commit always locks versions so there is no chance that a newer
linter (ansible-lint) would break CI.

Some documentation can be found at https://github.com/openstack/tripleo-quickstart/blob/master/doc/source/contributing.rst
and applies mostly to any project using pre-commit.

Co-Authored-By: Sorin Sbarnea <ssbarnea@redhat.com>
Change-Id: I05eb561c4e353b5fe0bc7c6d3ab2f8ea6c6ea2f4
2019-01-29 18:36:59 +00:00
agopi fcd0d7ed05 Moving ansible-lint rules to .ansible-lint.
Temporarily skipping rules 201,204,405,504,601 and 602.
This is to clear the gate and allow for merges.

Change-Id: I140dad80b61014a5b9ef43dbaa7d6ddd99b813d7
2019-01-18 15:31:07 +00:00
Sorin Sbarnea 8f338e08c2 Fix python3.7 import errors and made job voting
Python3.7 finally removed relative imports so we adopt the correct
syntax and also making py37 job voting to avoid regressions.

Change-Id: I16e01344e8ae1c732c31264c50d6dd57143ea799
2018-11-14 16:47:12 +00:00
Zuul 0c396ef646 Merge "Don't quote {posargs} in tox.ini" 2018-11-13 15:05:22 +00:00
Zuul 7e9b5c98a3 Merge "fix tox python3 overrides" 2018-11-12 16:57:58 +00:00
huang.zhiping c70837b1b7 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: I4cfa741310c5e55fb88eb4f24f5a2ed3baa2b88c
Closes-Bug:  #1801695
2018-11-12 16:25:13 +00:00
agopi 03be425102 Add numpy to extras
Move numpy out of requirements into extras, as it's not required
for running browbeat, but only used for insights like compare
results.

So to install with insights, pip install .[insights], to perform
the CLI operations such as compare.

Added a tox test to ensure no dep conflict arises.

Change-Id: Id8aafcd479003ae79ab8c2d0f1fa378ea38d60d2
Closes-Bug: #1799690
2018-11-12 15:41:24 +00:00
Nguyen Van Trung 492143e44e 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: If225be953bf78e9f52a3f41797b7746ac823e5cc
2018-11-09 18:30:16 +00:00
Sorin Sbarnea 7bc805ef08 Fix package building failure due to empty description
Adds descriptions and avoid twine check failure when the sdist package
was build via python3. It seems that sdist command produce different
packages in this unique case where Description field becomes False
instead of UNKNOWN.

This also adds new dist tox targets that tests that packaging works
well. On CI we have diffent job that does almost the same thing.

Change-Id: I93300e49b80fc170c1b73ffb5540cd42754e6a21
2018-11-08 18:42:17 +00:00
Sorin Sbarnea 90d9c1bc41 Include flake8 execution in tox -e linters
This fixes several flake8 failures and integrates flake8 into linters
tox environment.

Rule W504 is disabled because at this moment there is no known way
to avoid flapping between W504 and W503.

This allows us to retire openstack-tox-pep8 job because the more
beneric openstack-tox-linters includes it. Still, developers will
be able to coveniently run only pep8 if they want.

Change-Id: I7da0f6f09a533dd1c4dc303029e8c587bc200f66
2018-10-24 19:52:45 +01:00
agopi 15766424f5 Adding ANSIBLE0019 to skiplist for linters
linters fail because ANSIBLE0019 has been enabled
link: https://github.com/willthames/ansible-lint/pull/262
This is a temporary merge until we reenable ANSIBLE0019

Change-Id: I335c4ed7a591da06b884da13ec89037aea8cd934
2018-10-15 15:01:41 -04:00
Chuck Short f1cc080dfb Ignore rally directory
Rally uses yaml to run the workloads so ignore the directory
when we run linter tests.

Change-Id: If9bbfe4d7cbd703e85e6555581fbc228e86c06b0
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-09-26 13:22:10 -04:00
Chuck Short 6d03698faa Clean up linter
Enable ANSIBLE0010, package installs should
not use latest. Package installs should use state=present with
or without a version.

Change-Id: Id9868d0170fcf715be473d121f9db809f6c7d528
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-08-16 09:02:50 -04:00
Chuck Short 959bed59a5 Enable linter test for ANSIBLE0013
Use shell only shell functionality is required.
The shell functionality should only be used when piping, redirecting or
chaining commands.

Change-Id: Icb9b1dd5ea22a2af895a87a9fa2cc1b9a488ac0c
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-08-10 14:28:36 +00:00
agopi cf24a5aa48 py36 added to envlist
py36 testnv was introduced in
https://review.openstack.org/#/c/578313
However, py36 wasn't added to envlist and this fails tox .when run
locally as it's not defined

Change-Id: I7ddf464161d1f2b38f653adb3d632151a1659cec
2018-08-09 15:02:02 -04:00
Vu Cong Tuan 127013e7b9 Add py36 testenv
Python 3.6 is installed by default in Ubuntu 18.04 LTS.
Therefore, according to Transition Plan [1],
it'll be handy to have py36 testenv.

For more details, please check Python2 Deprecation Timeline [2]
and Python3-first Goal - Completion Criteria [3].

[1] https://wiki.ubuntu.com/Python/Python36Transition
[2] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html
[3] https://review.openstack.org/#/c/575933/8/goals/stein/python3-first.rst@42

Change-Id: I03c7658fa863fe4b92aedd1062cb0491477450c1
2018-06-27 15:22:05 +07:00
Charles Short 36b1bd09a0 Allow testing with py35
Update envlist to test for py35 easier.

Change-Id: Icbfa85e1f64766a366d0bada1309375fa6f0490f
Signed-off-by: Charles Short <zulcss@gmail.com>
2018-05-08 19:51:45 -04:00
akrzos 1c3b60a8c8 Mix and Match Workloads
* Mix and Match Workloads
* rerun_type - ['iteration', 'complete'] - allows you to rerun complete
  browbeat workload or iteratively
* browbeat/config.py for loading and validating config schema
* tests/test_config.py to test config.py

Change-Id: I99ea87c01c17d5d06cf7f8d1eec3299aa8d483a5
2017-12-12 11:08:50 -05:00
akrzos 1a65cd1feb Refactor of linting/config validation
* Use the built-in pykwalify cli validator
* Use set -e on loop inside tox.ini to ensure invalid configs fail CI

Change-Id: I251f7ead8393b97e93de03dc3b6accbdd9670092
2017-11-29 18:41:53 +00:00
akrzos aa1b7651d3 Auto venv via path module
* Add path module to handle paths
  * Finds the venv
  * Finds the overcloudrc
* Clean-up/refactor imports

Change-Id: I24c269f2073a28ae0bee230cb9911dc89249f79f
2017-10-06 11:29:11 -04:00
akrzos 2f0096fde5 Initial refactor
Refactor module names
Logger match module names
Add abstract method for run_workloads to WorkloadBase

Change-Id: I20b22787046bab98efb0a099bd32a08df8918628
2017-09-14 13:11:50 -06:00
jkilpatr 4eae72c0dc Fix non multiple of four indentation in Tools and Yoda
So turns out that E111 is the multiple of four indentation check
it's my fault that ended up in the tox.ini last time I was messing
with it and it seems to have come back to bite only me, as Yoda and
Tools functions, also for Yoda are the only victims of bad indentation.

After a strong recomendation by a friend I'm giving autopep8 a try.

Change-Id: Ia067bc60fad1200f577624aac2e979dfc26ec05d
2017-08-24 11:16:00 +00:00
jkilpatr c2654c826b Fix some errors that slipped by the linters
So up until recently the 'linters' CI run ran both
the pep8 and the Ansible linters, after some review
I can only conclude that it actually was not supposed
to do that and I should have seperate Python and Ansible
linters jobs.

Anyways because of this the pep linters where out for a
few days an we got exactly two minor pep errors into our
repo.

Change-Id: I66f82021c71f89a775e05c411ee1af2dba3a1c7b
2017-06-09 13:30:33 -04:00
jkilpatr 180740305c Don't exclude Ansible from flake8
flake8 doesn't actually have any issues if you do and
adding exclusions deletes flake8's rather comprehensive
list of exceptions enabled by default.

Change-Id: I2097a4ad095e60064c16d6e1948996f4b11d7af8
2017-04-11 14:12:27 -04:00
Andreas Jaeger d6d7f501e4 Cleanup tox.ini: Remove obsolete constraints
Remove old and unused constraints environments from tox.ini. Those
have never been used. Use standard environments as default list.

Note that the standard jobs - as run in OpenStack CI - did not use
constraints previouly and do not use them now. So, this keep the status
quo for CI.

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

Change-Id: If99dc4a9398988da769d49a57e22f58b7d83ae74
2017-04-11 08:40:15 -04:00
jkilpatr c60b55ec83 Update tox.ini with Ansible linting and Browbeat config linting
This commit enanbles Ansible linting and does some
minor refactoring to make existing Ansible roles
compatible with the new rules.

Several Ansible linting rules have been excluded to keep the number
of changes from being too onerous.

Also a new script in ci-scripts is used to check very config file
included in the Browbeat repo for validity using the template
Browbeat uses when it runs.

Here's a list of the new linting rules

* Ansible tasks must have names
* When you use shell you must use become not sudo
* Using become_user without using become is not allowed
* If a repo is pulled it must be a pinned version of commit, not latest
* Always_run is deprecated don't use it
* Variables without {{}} and not in when statements are deprecated don't use them
* No Trailing whitepaces
* YAML checking, catches big syntax errors but not less obvious ones

Change-Id: Ic531c91c408996d4e7d8899afe8b21d364998680
2017-03-29 07:35:34 -04:00
jkilpatr 976231a58d Temporarily Disable Linters
This change should disable the Ansible Linters in tox.ini
so that we can make the existing pep8 tests voting.

Linting should be re-enabled in tox once Ansible playbooks
have their errors corrected.

This commit also corrects some python errors that snuck into
Shaker.py

Change-Id: I5d64985849b9e31b91c9000dba7238cc79bd2009
2016-09-06 10:52:47 -04:00
Paul Belanger f05eadea0d
Add tox -elinters
This is the entry point for openstack gate jobs.

Change-Id: Icbebabf5ea439ef0ef20cdbda41fb9adc82965d1
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2016-08-16 14:40:37 -04:00
Sindhur 06e3e3292b Adding Browbeat Infra files
Adding .gitreview file
Adding tox.ini
Adding setup.py
Adding test-requirments.txt
Fixing syntax

Change-Id: Id6d628708079440207e5f068f5f0827802f2aa14
2016-06-14 09:16:53 -04:00