Commit Graph

107 Commits

Author SHA1 Message Date
Zuul 262ec2c995 Merge "Enable configuration via environment variables" 2020-09-18 07:14:43 +00:00
Sorin Sbarnea e6b1354d91 Enforce use of safe yaml loader
Sorts runtime warning related to use of unsafe loading on yaml files.

Change-Id: I11f1332f34fe341b13100d8ae4c263cfbd5b90e0
2020-09-17 15:18:36 +01:00
Sorin Sbarnea 3d1411f3a1 Enable configuration via environment variables
Refactors configuration loading in order to simplify it and to
allow overriding defaults using environment variables.

This behavior is similar to other tools like pip or ansible, which
can load any configurable option from env.

This step ease migration towards containerized use, where we do not
want to keep any secrets inside containers and we may want to
avoid volume mounting, especially when testing.

Change-Id: I0d3a9f19b0ba8d1604d0ca63db01296a3219fb47
2020-09-17 10:59:38 +01:00
Sorin Sbarnea 3901d2fd93 Made parse_jenkins_failure a non static
Replaces static implementation that received password and a member
function that can make use of the config object.

Change-Id: If9617b6db73eb49c5193f098d45e357a267529dd
2020-09-15 10:04:15 +01:00
Sorin Sbarnea 9d37c88c8f pylint: 4 more
Change-Id: I4cc928d8212a5192927a994b4248f32fe05ca723
2020-09-11 11:19:35 +01:00
Sorin Sbarnea 360c57118c pylint: 6 more
Change-Id: Ic16db7972fe6f9da86592d56f4983572d7c68989
2020-09-10 15:28:52 +01:00
Sorin Sbarnea c41b9c6fa0 pylint: fixed logging-not-lazy
Change-Id: Ic25366a9afdfc67ab2beddbe2b8d02544c51e480
2020-09-10 14:56:52 +01:00
Sorin Sbarnea ed5296999e pylint: fixed imports
Fixed pylint violations around imports. Implements
standard import ordering (isort).

Change-Id: Ib89108925487e49109d18ae315cd4892b8b48837
2020-09-10 13:46:38 +01:00
Zuul bbd3a2f2d5 Merge "pylint fixes" 2020-09-10 12:14:05 +00:00
Sorin Sbarnea 78a8098354 pylint fixes
Resolves several code style violations.

Change-Id: Id03dad8f8ce141eb1e630a77d0c9ae497de9f2ed
2020-09-10 12:42:12 +01:00
Sorin Sbarnea c6f07d7f93 Use pytest for queries
Switches queries testing to use of pytest which provides the following:
- test generator for each query (parametrize)
- ability to test a single query test
- generate html report with test results, making easier to investigate
  failures.
- parallel executions
- minor bugfix which prevented running queries from running with py38
  as the  config parser requires only strings (None being invalid).

Change-Id: I982c694a5160a9ecfd117d177d30b911cfe53425
2020-09-10 10:24:37 +00:00
Sorin Sbarnea 97ca1c24c3 Drop py27 and add py38 jobs
- Dropping py27 as is out of support
- Enable py38 testing, already default python on several distros.
- removes six as a dependency as is no longer needed for pure py3

Change-Id: I1e825073abc6cd55aa2fdc363358f2701152c57b
2020-09-08 10:21:02 +01:00
Sorin Sbarnea 8f709c1d67 Resolve unsafe yaml.load use
Fxed deprecation warning about unsafe call

Change-Id: I474454f438d6345dea76daf788be14c93fee6fb6
2020-08-19 09:52:17 +01:00
Matt Riedemann 73a1e85c67 Hard-code os-brick into TestQueries.openstack_projects
The elastic-recheck-tox-queries job is failing because
there is a query on an os-brick bug and the os-brick
project in launchpad is not part of the openstack project
group. This change simply hard-codes it since we know os-brick
is part of openstack.

Change-Id: Ia05c009226f88da427ec6ad9724410cd6ebed859
Story: 2006736
Task: 37197
2019-10-16 16:45:40 -04:00
Matt Riedemann fbdbbc0f40 Switch gerrit URL to review.opendev.org
As of the great renaming of 2019 we need to update the
openstack gerrit URL default to review.opendev.org.

Change-Id: I2e3f7e7fb03be0deba0c95995265376dbce3c5b6
Story: #2005498
Task: #30599
2019-04-22 11:55:55 -04:00
Jens Harbott e83d0dd58b Make the functional queries test work with python3
This seems to have been missed in the py3 conversion and seems to have
been broken for a while.

Change-Id: I9314ead6b0d14ed79ffd43c0f880daf57a014871
2019-03-05 11:25:28 +00:00
Clark Boylan 02d0651f29 Better event checking timeouts
Previously we gave every event a 20 minute timeout. This meant that we
could eventually rollover on the day and start querying against current
indexes for data in older indexes. If this happens every query would
fail because we are looking in the wrong index. Every query failing
means we run the 20 minute timeout every time.

All this results in snowballing never being able to check if events are
indexed.

Address this by using the gerrit eventCreatedOn timestamp to determine
when our timeout is hit. We will timeout 20 minutes from that timestamp
regardless of how long interim processing has taken us. This should over
longer periods of time ensure we query the current index for current
events.

Change-Id: Ic9ed7fefae37d2668de5d89e0d06b8326eadfbb9
2018-11-30 19:34:54 +00:00
Sorin Sbarnea 6c4f466282 Made elastic-recheck py3 compatible
- Adds py36/py37 jobs.
- Fixed invalid syntax errors
- Bumps dependencies to versions that are py3 compatible

Change-Id: I0cebc35993b259cc86470c5ceb1016462a1d649b
Related-Bug: #1803402
2018-11-29 20:15:07 +00:00
Chuck Short 3d0ea8cd30 Drop mox usage
Mox is not being used anywhere, so remove it.

Change-Id: I66bee0fa0d22e99554eae51c74b149d212ede7ed
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-08-21 21:40:15 -04:00
Matt Riedemann 57aab15c11 Retry change queries on a 502 response
When gerrit is running slow we get 502 responses
back which kills the graph builder. We can retry
these requests from the client to keep going. Generally
a single retry fixes it.

Change-Id: I745d7c9b80ab8861972193d82c037df76af69e06
2017-10-09 20:18:58 -04:00
Ramy Asselin de437439ad Wait until the most recent index is available
When elastic search indexing is behind, and the day has
progressed forward to a new day,  the latest
index is not yet available for use. Exclude it from searches
until it is ready in order to avoid the ElasticHttpNotFoundError.

Add Unit tests for this case as well as for when multiple days
are specified for the search.

Change-Id: Ifd27d1ab21bebcb63b48ea164f425c4a2ac8759c
2016-10-20 10:48:55 -07:00
Ramy Asselin f4ddadc834 Fix test_queries regression
In change Ic6f115a6882494bf4c087ded4d7cafa557765c28, test_queries.py
was not updated to use the new Config class.
It causes the non-voting test to fail for the 'wrong' reasons.

Change-Id: Ib729d5d360619bf289bc9c91f2a3f856f525a947
2016-10-12 15:53:28 -07:00
Ramy Asselin 49999256f4 Make Elastic Recheck Watch more reusable
Refactor to use a config class to hold all the
params needed so that they can be more easily
overridden and reused across all the
elastic-recheck tools.

In addition, use the new class to make the
jobs_regex and ci_username configurable.

Change-Id: Ic6f115a6882494bf4c087ded4d7cafa557765c28
2016-09-20 18:11:30 -07:00
Matthew Treinish b5d3c22c9a
Fix the integrated gate filtering on uncategorized
When stackforge was compacted into the openstack/ git namespace this
broke our filtering on just integrated gate projects. This commit does
2 things to handle this. First it takes a list of the projects using
the integrated gate job template from zuul's layout.yaml and uses that
to be the filter. This way we actual have a view of the integrated gate
again. It then makes a second page for all the other projects failures
which can be used by those to track uncategorized failures. A future
next step will be to add a config file to make the functional split of
these views configurable so that we can more easily adjust the split
as the interactions between projects change.

Change-Id: I41c8ae1e75e8a3d8893f6af5af7c283b5f5c1bcf
2016-08-08 20:09:35 -04:00
Sean Dague afba5b2b7e Fix e-r with fixtures 3.0.0
Fixtures 3.0.0 adds another parameter to MonkeyPatch fixture usage
which is some kind of link back to the class being patched out. This
makes the ER code pass under fixtures 3.0.

Change-Id: Id19d0dde8fa558cbf3c76a66430170d0d5b0cd94
2016-06-13 16:10:19 -04:00
Jenkins 67763248c2 Merge "Disable failing tests test_gerrit_comment.py" 2016-03-03 15:24:33 +00:00
Matt Riedemann 291da244af Add query for volume-backed live migration abort bug 1524898
Like bug 1539271, we should track failures for the live migration
tests in the non-voting multinode job(s).

This has 103 hits in 7 days, all failures.

Change-Id: Ibc65c035614f233f67653c3ca941244704e66c11
Related-Bug: #1524898
2016-03-01 15:46:17 -05:00
Matt Riedemann e456a7afca Add allow-nonvoting key
By default we add 'voting:1' to all queries so they are filtered
from the graph.

There are cases where we want to track bugs for non-voting jobs
in the graph, so add an 'allow-nonvoting' key for special bugs
that we want to track while we're trying to stabilize a job.

Updates the docs, adds a test query and unit test for the query
loader, fixes a bad query that was setting voting:1 already, and
removes the TODO in the query for bug 1539271.

Change-Id: I61b1d4b0faaa3f20fc5b04aa3392c68c61990866
2016-02-01 07:55:30 -08:00
Jenkins a27f20ddfd Merge "Fix elastic-recheck query command" 2016-01-23 03:19:13 +00:00
Swapnil Kulkarni (coolsvap) 6a9f2903b2 Correct typos
Change-Id: I6db263ab67de0d50193832a1e30d83ba6b890c8e
2015-12-22 18:07:04 +05:30
Ramy Asselin 19712edc2d Fix elastic-recheck query command
This code doesn't work at all. Bring it back to life.
Also accept inputs from a config file.
Closes-Bug: #1526921

Change-Id: I8f45dc9d42f7547f9d849686739b9a641c176814
2015-12-18 12:14:34 -08:00
Sean Dague 314d578653 only query voting changes
Elastic recheck is about failures, all queries should only include
voting changes. We do this by explicitly adding voting:1 to all
queries that load in the query builder.

Change-Id: I4bd4827f72d85bf69bf501be2f5744e71de35a3c
2015-12-02 12:41:03 -05:00
Markus Zoeller e51b35ff24 add query for random network.test_neutronv2 fails
Related bug: #1521599

Change-Id: I1670f149a54d3fa6261c754d0a9993e826d6c00b
2015-12-01 16:27:29 +01:00
Ramy Asselin f64dfb1417 Disable failing tests test_gerrit_comment.py
These tests don't work anymore. Skip them until they are fixed.
They are not normally run, but are run by default in IDEs that
run all unit tests.

Related-Bug: #1517730
Change-Id: I7ad86158ba29ae7210b31c0f45df62277112b3f4
2015-11-18 20:55:02 -08:00
Clark Boylan 4d8d102ffb Fix unittests
jaraco.functools 1.6 is broken and is pulled in by the irc lib. Use an
older version to avoid the brokenness. Use a real url in the fake
connection url as this is checked for correctness when creating
elasticsearch transport objects.

Change-Id: I41b5868c0c055297bb9ead1ad96486afeed9cce5
2015-11-09 13:38:32 -08:00
Jenkins a34e4a4c54 Merge "test_queries now uses elasticRecheck.conf" 2015-10-15 21:26:36 +00:00
Dolph Mathews ac4eaab80e add CLI command for executing elastic-recheck queries
This is an upstreaming of:

  https://github.com/dolph/spandex
  https://pypi.python.org/pypi/spandex

... which I'll nuke if this is merged.

I use this tool to write, test, and look for patterns in the results of
elastic recheck queries. I never use logstash.openstack.org anymore.

Change-Id: I864b22c05b398f6ad8ccb9009b5866f36b46789d
2015-10-14 08:07:52 -07:00
Ramy Asselin fde886d4df test_queries now uses elasticRecheck.conf
If elasticRecheck.conf is provided, the test_queries should
use its values over the defaults.

Change-Id: Ic15d5a9914a012e3c279362c30aeac93483c53aa
2015-10-13 18:10:38 -07:00
Sean Dague 9c362e69fa provide exclusion support for jobs
Some teams aren't using elastic recheck for tracking issues, which is
fine, but with the big tent this means that the openstack/ method of
inclusion no long works. Specifically exclude jobs from projects and
efforts that seem to not be using ER regularly.

Co-Authored-By: Matt Riedemann <mriedem@us.ibm.com>

Change-Id: Iaa55bb46f4c1cc20dc05fd03797f35e9d74f7cc0
2015-09-25 11:53:29 -07:00
Matthew Treinish d83ef2e5ea
Add support to filter results by failure test_ids
This commit adds a new field to the query yaml test_ids which is a
list of test_ids that will be query the subunit2sql db to verify that
at least one of them failed on the failed uuid.

Change-Id: If3668709e3294b5d6bf9e1f082396fbc39c08512
2015-08-14 17:11:39 -04:00
Joe Gordon 2b97c0d156 Upgrade to hacking 0.10.x
Fix up issues detected by new version of hacking

Change-Id: Ie12b9f5ccaa1ce5f49ee6bf35d3275bc9dbcbc15
2015-04-30 17:00:22 -07:00
Joe Gordon 7726a837db Functional test should not require a config file
Instead of getting the queries directory from the config file, just hard
code the default path inside this repo.

Change-Id: Ia7a860b8b81b1b9b3f1628ef1214480754f6711a
2015-03-24 07:33:18 -07:00
Jenkins 494046d0f1 Merge "Add launchpad test to test_queries" 2015-03-16 20:01:41 +00:00
Jenkins 098bafd1bd Merge "Make test_queries runnable as gating test" 2015-03-16 20:01:05 +00:00
Joe Gordon 51105afa65 Add launchpad test to test_queries
* Check if launchpad bug is part of OpenStack or oslo  launchpad groups.
  fail if no tasks are targeted against those groups
* Ignore specific series

Make sure the test should not fail do to things like bugs closing etc.

Change-Id: I5a0b33c0e809e2ecf2050272142d1a15f60a23da
2015-02-27 13:22:14 -08:00
Joe Gordon 7ac81a0d48 Make test_queries runnable as gating test
Previously test_queries, tested for:

* check if the query has hits
* check if the launchpad bug is open

This wasn't a good test to gate on because hits can go away and bugs can
be closed, so this test can stop working without any code changes,
making it a bad gating test.

Split out getting launchpad test working to a separate patch, still a
few more issues to sort out there.

Change-Id: Ic362d89a0ed34bb14864237e4bc5975befc36497
2015-02-27 13:22:05 -08:00
Joe Gordon 612d43f971 Add support to suppress bot notifications
* Similar to suppress-graph

There are some gate failures that are expected and are real errors (such
as global-requirements mismatches in requirements jobs).
suppress-notifications allows us to classify these failures and remove
them from the unclassified page while not telling developers to recheck.

This can be used along with suppress-graph.

Change-Id: I6d905ba65e66e799a65598f8a5d5c3dd684feb8c
2015-01-23 09:42:54 -08:00
Joe Gordon 2a1767767b Make build_short_uuid work with URLs with trailing slashes
jenkins now includes a trailing slash
  http://logs.openstack.org/89/141489/6/check/gate-horizon-pep8/48238d7/

so update code and unit test to support an optional trailing slash

Change-Id: I2b180ffb5c15436ac40a70b5e746c2d719a8152f
2015-01-13 14:09:03 +13:00
Jeremy Stanley 10309a754a Workflow documentation is now in infra-manual
Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.

Change-Id: I0fe0dcb62ac8e31d6cda8ad292a9c89c24932e1e
2014-12-05 03:30:42 +00:00
Jenkins 24c460ee03 Merge "Add open reviews to elastic-recheck status page" 2014-08-22 22:06:42 +00:00