Commit Graph

426 Commits

Author SHA1 Message Date
Matthew Treinish fca99f945c Fix compatibility with latest oslo.config
With recent versions of oslo.config the tests have started to fail
because the multistring opt used for specifying input subunit file paths
was getting an implicit required. However it's not a required field just
positional. This commit fixes this issue by explicitly setting it to not
be requried and setting a default value of None for it. I'm not sure when
an implicit required was added in oslo.config, but this should fix it
regardless of which oslo.config version is used.

Fixing other gate failure also for pythin 2.7 & 3.8 compatibility.

- with mysql 8.0 there is no implicit user creation with GRANT. we
need to create user first.

- hacking version used is too old which pull old pyflakes (< 2.1.0) not
compatible with py3.8. Bumping hacking version to 2.0.0 which solve the
pyflakes version conflict with new pip resolver but skipping all the
new checks of 2.0.0. We can fix those later once gate is green.

- for openstack-tox-py27 we need to cap stestr with <3.0.0 so that it can pull
stestr py2 compatible version.

- move dec requirements seprate from test-requirements otherwise it conflist with
other deps.

Story: 2008348
Task: 41250

Change-Id: I219755d98d9f8b5a284c0e858b60f852b948c8d4
2021-01-21 19:43:39 -06:00
Zuul 99f83fda87 Merge "Add .zuul.yaml and python 3 Train unit tests" 2019-07-20 01:48:19 +00:00
Zuul aeb9d0940f Merge "Add attachments flag to get_test_runs_by_status" 2019-07-18 05:52:22 +00:00
Masayuki Igawa 99f770ca13
Fix gate error "mysqladmin: command not found" and etc
mysqladmin package is required in tools/test-setup.sh
so adding bindep.txt file for this binary dependencies. And postgresql
packages are also required as well.

- http://lists.openstack.org/pipermail/openstack-discuss/2019-June/007272.html

This commit also updated sphinx versions in test-requirements.txt to
avoid this error.

  ERROR: Sphinx requires Python '>=3.5' but the running Python is 2.7.15

And also, this commit fixes a sqlalchemy error. This probably caused by
sqlalchemy version updates. It might be better to fix the code rather
than the sqlalchemy version cap.

  sqlalchemy.exc.ArgumentError: Textual SQL expression
    "tests.id='fake_null_test_..." should be explicitly declared as
    text("tests.id='fake_null_test_...")

Change-Id: Iff79081403fbc26442165ff5feb300bc317b0dfc
2019-07-18 12:11:53 +09:00
Masayuki Igawa 9b5a71eab2
Add .zuul.yaml and python 3 Train unit tests
This commit adds .zuul.yaml and python 3 Train unit tests jobs which is
one of Train goals.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: If0e74b8939dc86924e4fea73ddb1e5e7495629fe
2019-07-18 11:46:28 +09:00
OpenDev Sysadmins 2421eace0f OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:26:09 +00:00
Zuul c807e204fc Merge "Replace DbMigrationError with DBMigrationError" 2019-01-09 16:59:27 +00:00
Matthew Treinish ae1c4485ca Fix inconsistent treatment of test status
This commit is the follow on to change
Ib84eb5e4b2da4847e86ff24c8bc5ba19a0df5b37 which fixed an unhandled
condition when xfail or uxsuccess was in the passed in results stream.
While that fixed the failure condition it neglected to update how we
treat those test result statuses in all other cases. This commit does
that by making sure we treat xfail and uxsuccess as success and failure
respectively for aggregate counts.

Change-Id: I1d2308d2c68f4f6b432ab733ead19a0167ba0b94
Story: 2000701
Task: 3176
2018-12-27 04:41:35 +00:00
mccasland, trevor (tm2086) 464a9e0adc Add attachments flag to get_test_runs_by_status
By adding an 'include_attachments' flag to the get_test_runs_by_status
method we can join the Attachments table with the same structure as
the RunMetadata table allowing us to optionally include attachments or
metadata with test_runs filtered by a given status.

Notes on testing:
  * As far as I could tell, logstash.o.o doesn't store attachments[1]
  so to test this patch you will have to setup/use another subunit2sql
  db with attachments stored in it
  * you can find the openstack-health patch to render the attachments
  in the Needed-By change of the footer of this commit message.

Notes on performance:
  * on average loading attachments is about 13% slower when calling this
    api with python[2]. The query times in the paste were produced by calling
    the api method get_test_runs_by_status_for_run_ids 100x in a for loop with
    49 test_runs being returned from the call, which is the number of failures
    in the last 10 runs.

[1] http://paste.openstack.org/show/719192/
[2] http://paste.openstack.org/show/738662/
Needed-By: I3ce2fc50ada9462de3df29b5a8b76b12a548fd12
Change-Id: I31468c825cf259b8df62134e578f31d96af6ac75
2018-12-26 16:15:27 -06:00
Zuul 4202e4c195 Merge "Update min tox version to 2.0" 2018-12-24 20:54:18 +00:00
Matthew Treinish 35793871f3
Fix handling of xfail and uxsuccess results in subunit2sql cli
This commit fixes an issue with the subunit2sql cli (for importing
subunit streams to the DB) when the subunit stream has a test_run with
an xfail or unxsuccess status. Previously we didn't handle these
statuses at all and we'd raise an exception because they weren't known.
This fixes this by treating xfail the same as success and uxsuccess the
same as failure.

Change-Id: Ib84eb5e4b2da4847e86ff24c8bc5ba19a0df5b37
2018-12-17 19:13:44 -05:00
Vieri 02c0c6354d Update min tox version to 2.0
The commands used by constraints need at least tox 2.0.  Update to
reflect reality, which should help with local running of constraints
targets.

Change-Id: I9af1121a4a7b7f1db8bcae5a9f0f9a643e4b2428
2018-11-02 12:06:10 +00:00
Zuul 96940dd287 Merge "fix tox python3 overrides" 2018-09-13 14:08:17 +00:00
Matthew Treinish 651544448d
Clean up run_time graph style
This commit cleans up the style used for the run_time graph. It switches
the individual run_time graph (not the avg or std dev) from a line graph
to scatter points. Since there are potentially a lot of data points this
makes things cleaner and easier to see. Then the size of those points
and the line width are shrunk. When there are a lot of data points
things overlap, get cluttered, and hard to see. By shrinking the lines
and scatter points it alleviates this to a certain degree.

Change-Id: I1271acf10a12df8e36a85e4deacbfc77f7f05bc0
2018-08-23 16:48:12 -04:00
Matthew Treinish 190c3e6c87
Fix pandas rolling calls in run_time graph
This commit fixes the use of rolling_mean() and rolling_std() in the
run_time graph command. These functions were removed from pandas a few
releases ago and were replaced by the Rolling class. We updated the
other commands already, but the run_time graph was missed. This commit
corrects the oversight and uses the Rolling class to generate the
rolling mean and std dev data.

Change-Id: I4a2fd0256b05f468cdbbe67fb2573233f64d74d8
2018-08-23 16:27:46 -04:00
qingszhao 1c6037c9a3 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: Ifa267fcd8eb5334672dd0b603d42dedb67bd2c98
2018-06-12 01:20:47 +08:00
megan 08222d7a2b Amend releasenotes for new subunit2sql functions and options
This clarifies the release notes for the newly added delete by uuid
db api functions, as well as by the addition of the ability to pass
programatically the variables neccessary to process run results via
the shell module

Change-Id: Ie86d43ea7272b1b2cd86e8290461285a37539bed
2018-04-20 20:10:45 -07:00
Zuul eff319766d Merge "Add delete by uuid functions" 2018-04-17 20:23:14 +00:00
Megan Guiney fe52f342cc Add ability to grab stream processing variables from kwargs
This commit allows the 'run_at', 'artifacts', run_id',
'run_meta', and 'test_attr_prefix' to be passed in to the
process_results function, thus allowing for the programmatic
usage of subunit2sql without having to access and update
CONF for every run that gets processed.

Change-Id: Ie5db660a2b1a8162403b0475d13686e80b1b9cc6
2018-04-03 12:59:14 -07:00
Megan Guiney 9d37139ca2 Add delete by uuid functions
These functions delete run and test_run entries associated to a
given run uuid. These functions are intended primarily for usage
in https://review.openstack.org/#/c/530681/ , but seemed like handy
utilities to have in general

Change-Id: I3a25b74875cd8664a7895b67f09870ea78c99e98
2018-04-02 14:30:37 -07:00
Matthew Treinish 02a25056c4
Honor dpi cli flag for ci_time graph
The newly added ci_time graph was originally introduced before the dpi
cli flag for the subunit2sql-graph command. It merged around the same
time as the cli flag meaning it was never updated to respect that, and
had a hardcoded dpi of 900. This commit fixes that oversight and updates
the command to use the dpi flag.

Change-Id: I72b3dc5d4d484a2b9f7b542ab1da01cc40a0ed24
2018-03-02 06:13:16 -05:00
Zuul 7121c60a85 Merge "Add graph for aggregate run time grouped by run metadata" 2018-03-02 11:10:27 +00:00
Matthew Treinish 6e9dae785f
Add --dpi flag to subunit2sql-graph
This commit adds a new flag, --dpi, to the subunit2sql-graph command.
This flag is used to specify a DPI for generated graph images.
Previously most graph commands hard coded the DPI to 900 (which is far
too high for most people) and others didn't specify one. This commit
changes that so it's user adjustable and consistent between all
commands.

Change-Id: I5c8c48bda18daff11d6069c35451d932ffe4e33b
2018-02-11 23:03:00 -05:00
Zuul 6f95e43478 Merge "remove oslosphinx from test-requirements" 2018-02-07 19:42:46 +00:00
Yaguo Zhou f7734842b0 Replace DbMigrationError with DBMigrationError
DbMigrationError is deprecated and will NOT be thrown in oslo.db
since oslo.db >=4.27.0, DBMigrationError will be thrown instead.
Consumers should catch DBMigrationError instead of DbMigrationError

Depends-On: Iab0566cf9f4552e91fa417e64472fa106e8bc86d
Depends-On: I0ebd69c3d778acb5bec9e136627e345e7fcf2bd3

Change-Id: I726edf35ccb11facf6ab53e403ee9d0d40435fae
2018-01-10 21:02:09 +08:00
Trevor McCasland fed81d0901 Add subunit2sql CLI option to use non_subunit_name
This commit adds a new CLI option for allowing mixed subunit
content. This is desired for subunit.stream files with non-subunit
content mixed in but still want the subunit content converted to
sql. However, this commit only adds support for passing the argument
to ByteStreamToStreamResult. Nothing is added beyond that for managing
the non-subunit content.

Co-Authored-By: Matthew Treinish <mtreinish@kortar.org>

Change-Id: I68cbeb47e9093b98630f096fc5818a77932c8da4
2017-12-26 19:29:13 +00:00
Trevor McCasland 37fc3f5f38 Fix mysql db api
By default the multiline option for the db api was included in
PyMySql<0.8 but now that it is removed[1] we need to pass in the
multi=True argument to the cursor to maintain the same execution
behavior. Unfortunately, I wasn't sure on how to do that
so I modified the op.execute method to run the sql commands one
line at a time instead. It seems to work for the test cases.

[1]c0aa317940

Change-Id: If139f0941562b7a792d813b5e23a47eb92487304
Story: 2001420
2017-12-21 15:10:30 -06:00
Andreas Jaeger 989b0a3563 Remove setting of version/release from releasenotes
Release notes are version independent, so remove version/release
values. We've found that projects now require the service package
to be installed in order to build release notes, and this is entirely
due to the current convention of pulling in the version information.

Release notes should not need installation in order to build, so this
unnecessary version setting needs to be removed.

This is needed for new release notes publishing, see
I56909152975f731a9d2c21b2825b972195e48ee8 and the discussion starting
at
http://lists.openstack.org/pipermail/openstack-dev/2017-November/124480.html
.

Change-Id: I9827b64eba24033388e82ab9023a640b0720e506
2017-11-16 18:49:32 +01:00
Dong Ma bd4b103fda remove oslosphinx from test-requirements
Change-Id: I56b461d959d69e710e470ab848b32b9f6d74323a
2017-11-06 13:52:08 +08:00
Zuul 7ffabb1110 Merge "Switch to use stestr completely" 2017-11-02 07:54:19 +00:00
Zuul cf9b6aa7fc Merge "turn on warning-is-error in documentation build" 2017-11-02 07:52:38 +00:00
Matthew Treinish eeed5f8d23
Add graph for aggregate run time grouped by run metadata
This commit adds a new graph command ci_time which is used to display
the aggregate run time for all runs grouped by run metadata. You provide
a run_metadata key and it will display a bar graph with the values with
the most aggregate run time.

Change-Id: I40e019d1f65586d01e07a8c44ff03365223dbf84
2017-11-02 03:22:26 -04:00
Matthew Treinish ea8194464d Update python3 versions in tox.ini envlist
This updates the envlist to include modern versions of python. It
doesn't really mean anything except for you run tox without specifying
an environment it will now run py35 and py36 instead of py34 (which
isn't used anywhere anymore)

Change-Id: I5b61677d4ee7a2c5dbf29755c03243cba0e6446e
2017-10-25 07:53:41 +00:00
Masayuki Igawa 92e8359d66
Switch to use stestr completely
This commit adds .stestr to .gitignore and remove os-testr from
test-requirements.txt to switch to use stestr completely. We actually
already switched in the previous commit[1]. And now, we can switch
completely.

One thing - .testrepository is still remaining in .gitignore. This
directory can be still remaining in the most of user environments. So
that, to avoid the confusion, '.testrepository' should be still there
for a moment.

[1] I39f5db8f77de027c18917215c761dca69d8cbea0

Change-Id: I9530af1a91ae20dca24a699fbf04893102570f09
2017-10-25 15:55:10 +09:00
Matthew Treinish b99350137b Switch to using stestr
stestr is a fork of testrepository, designed specifically to concentrate
on being a dedicated test runner. [1] The testrepository project is
basically not active anymore and has several long standing bugs and
useablility issues. stestr is still actively maintained and fixes a
large number of those issues with testrepository. The best part is that
stestr supports using subunit2sql as a repository backend.

[1] https://github.com/mtreinish/stestr

Change-Id: I39f5db8f77de027c18917215c761dca69d8cbea0
2017-09-06 17:58:04 +00:00
Dong Ma f5a0f6ff85 turn on warning-is-error in documentation build
Turn on the flag to ensure that future warnings in the doc build
trigger a build failure.

Change-Id: Ibb59a40ec8f1bbd9520e0edb07360332d5701f5b
2017-08-16 16:28:25 +08:00
Matthew Treinish 2626a1f7ae
Update requirements
The subunit2sql requirements file was running caps on old versions,
because we encountered some bugs with newer versions of oslo libs. This
commit removes those caps to get us back on the latest versions.

Change-Id: Ia780ecc4b144c42c40710743ec73c8dc25d1cf94
2017-08-09 11:23:39 -04:00
Jenkins 4cbd7e4bc4 Merge "Add a unit test with a simple sql injection ala xkcd" 2017-08-02 02:59:33 +00:00
Jenkins c441e1e8e4 Merge "rearrange existing documentation to follow the new standard layout" 2017-07-31 16:06:28 +00:00
Jenkins 69c7790bf1 Merge "Switch from oslosphinx to openstackdocstheme" 2017-07-31 15:11:33 +00:00
Matthew Treinish 3fa49d84ca
Add a unit test with a simple sql injection ala xkcd
This commit adds a basic unit tests with a simple sql injection attack
for a test name. All of the database interactions on the insert are done
through sqlalchemy and the ORM should be protecting us against this
attack vector. The test added here is just to sanity check this and so
we have something to point to. It's not intended to actually be a
thorough or even a real security test or a thorough security audit.

Change-Id: Iee5ed994328cf44834a1becb246f9983881d2129
2017-07-25 15:51:29 -04:00
Dong Ma cfda0d1b2d rearrange existing documentation to follow the new standard layout
Change-Id: Iab9b509459d91d368b691efc55b4a952f9aa6623
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454
2017-07-03 11:25:23 +00:00
Dong Ma 5dbb8c8c00 Switch from oslosphinx to openstackdocstheme
As part of the docs migration work[0] for Pike we need to switch to use the
openstackdocstheme.

[0] https://review.openstack.org/#/c/472275/

Change-Id: I9f5d44dfdfeeab87ced0936318d95741d62845ba
2017-06-28 05:57:27 +00:00
Jenkins 4f5c3943c6 Merge "Update docs theme" 2017-06-20 07:13:56 +00:00
Jenkins c6d7e13c2b Merge "Add vcs status to version option" 2017-06-20 07:13:50 +00:00
Jenkins ca7b04ed58 Merge "Dailycount should not need build_queue to exist." 2017-06-20 07:13:41 +00:00
Masayuki Igawa e244282c37
Add vcs status to version option
This commit add vcs status to the version option. This is helpful to
know a correct version of subunit2sql commands.

Change-Id: I06da9ddecbec945e802974bde1c91a78f25a991a
2017-06-19 16:31:09 +09:00
Gavin Brebner 80ff853795 Dailycount should not need build_queue to exist.
Dailycount assumes that there is a metadata item called build_queue
with value gate and if this does not exist in the database, the
tool will fail messily. This patch allows you to specify the md
key and value to be used.

Note, it also treats NAN data by filling with 0 - otherwise
the graph gets very confused.

Patch set 2 -
  Fixed pep8 issues.
  Fixed option ordering issue as per review comments.

Patch set 3 -
  Removed debug print statement.

Change-Id: I51baf2ee15d65e315c8142824fae13d964d9f973
Story: 2001034
2017-06-16 15:34:45 +02:00
Jenkins 0aec5e47b8 Merge "Disable SmartyPants for docs" 2017-06-16 07:44:47 +00:00
Masayuki Igawa 2e1670c64f
Update docs theme
This commit updates the docs theme to use the new one. And this commit
also changed the smartypants option to False because it is useless and
it changes dashes('--') into en- nad em-dash entities. We don't need
that feature in our document, so far.

Change-Id: I9921b8c72baf191e675d3956beca68ffd47813c2
2017-06-05 14:17:58 +09:00