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
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.
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
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.
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
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. 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.
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.
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.
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.
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.
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
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.
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
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.
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
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
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 <firstname.lastname@example.org>
By default the multiline option for the db api was included in
PyMySql<0.8 but now that it is removed 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.
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
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.
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)
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. And now, we can switch
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.
stestr is a fork of testrepository, designed specifically to concentrate
on being a dedicated test runner.  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.
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.
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.
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.
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.