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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
This commit add vcs status to the version option. This is helpful to
know a correct version of subunit2sql commands.
Change-Id: I06da9ddecbec945e802974bde1c91a78f25a991a
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
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