Commit Graph

23 Commits

Author SHA1 Message Date
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
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
Matthew Treinish c7c7f83f45
Use modern PBR and hacking packages
The pbr release 2.0.0 is breaking in that it removes the use of
warnerrors in build_sphinux. Hacking <0.11 had a similar issue so
use a newer version of that.

Change-Id: I4ad82bb6bf8b2633713dc989445e3d1f318790ee
2017-03-01 10:19:20 -05:00
Matthew Treinish c47cfaa6c7
Cap oslo.db <=4.15.0 and remove badges
The latest oslo.db versions changed how their testing interfaces work
and that is breaking subunit2sql's tests. Lets cap for now to unbreak
things. This commit also removes the shields.io badges from the README
because they're breaking doc builds.

Change-Id: Iae45702dc1519cc7c95666d5426cbd85ea85b4e0
2017-01-06 17:32:11 -05:00
Matthew Treinish 0eac5374b4
Move oslo.concurrency to test-requirements
Looking through the subunit2sql code oslo.concurrency is only ever used
for a lock fixture used during the unit tests. We shouldn't have test
only requirements listed in the requirements.txt file. This commit moves
it to live in test-requirements so we don't unecessarily install it
when installing subunit2sql.

Change-Id: Idf537d20980ffc1c1d3ec8c7758c810f18fc5164
2016-05-19 12:33:54 -04:00
Matthew Treinish 21ee9f58b8
Remove cap on oslo.db version
This commit removes the requirements cap on oslo.db. This was
originally added because of the removal of a private interface that
subunit2sql depended on in it's alembic env.py. A public interface
was eventually added to provide analogous functionality but
subunit2sql never removed the cap and used the new interface;
until now.

Change-Id: Idbc17096d0d3fe43261026b866041ae8a97d86fc
2016-05-18 15:22:49 -04:00
Matthew Treinish dee1f2c18a Add support to subunit2sql cli to specify a run_at time
This commit adds support to the subunit2sql cli command to specify the
run_at field for a run being created. The db api has had support for
this for quite some time but it was never exposed through the CLI.
This resulted in the default behavior of using utcnow() to set the
run_at column for a created run. However, if you're trying to insert
old runs into the DB this isn't ideal because it will look like the
test results were recent. This commit enables users to specify a
different run_at time for these use cases.

Change-Id: I0c00ef71633e043c9d80adf0bc2df0157d1a11b3
2015-11-30 22:40:41 +00:00
Matthew Treinish 6608e63b19 Add DB API testing framework
This commit adds functional tests for the db api. It is still a
rough implementation right now, but to start I'm not worried about
that too much since it works. Things will just be a bit slow, because
it drops the db and runs the migrations on an empty db on each test
method, locks against every other api test method and the migration
tests, and requires a local mysql db exist with the hardcoded values
from the migration opportunistic test functions. But it works!

Ideally we would just use the in memory sqlite db for this testing
since it provides the isolation we really desire for running
individual tests. However, because the migrations don't work on
sqlite this makes it kinda difficult.

To mitigate the locking penalty a bit a group regex is added to the
testr.conf to serialize tests at the class level. This will at least
mean that api tests will run serially since they're all in the same
class.

In an effort to decrease code duplication as part of adding additional
DB functional tests the existing migration tests are refactored to
use a common set of fixtures and util methods to handle the test db
setup and connection configuration information.

We also should slowly ramp up the number of tests here since the
coverage is very basic as this was intended to mostly start the
framework. But that, can be a follow up patch.

Change-Id: Iea6dd86498002ab20977b5fb02b4c7d751a08bca
2015-09-16 22:30:16 +00:00
Matthew Treinish 4d04042bd6
Fix issues in migration 1ff737bef438
This commit fixes a couple of issues with the migration 1ff737bef438.
First, on multi-byte configured mysql systems the status column is too
big to index, so this adds a length to the index to allow it to run on
those envs. The second is that since the migration fails to run on
certain envs checks need to be done to account for migrations that are
only partially applied. The min version of SQLAlchemy is also bumped
to version 0.8.2 because that's when using dictionaries on the
mysql_length for composite indexes was added.

Change-Id: Iad056d44251ad2eac8a5cb5628779b27c2126630
2015-08-07 11:12:47 -04:00
Matthew Treinish f6a36b00a8
Set temporary version cap on oslo.db
This commit temporarily adds a cap on oslo.db because of the use of a
private method from oslo.db in the alembic env.py for subunit2sql
which was removed in the latest release. In the future we will switch
to using a public api from oslo.db for doing this. However, one does
not exist at this time. So we add a cap on the version of oslo.db to
ensure that a version including the private api is used.

Change-Id: I726a4afb9b4ed0d7283b42e8f5f45035fcf4fabf
2015-06-29 21:45:00 -04:00
Jenkins 6082f0529b Merge "Add external plugin support to subunit2sql-graph" 2015-06-26 18:53:12 +00:00
Matthew Treinish 3891be33ad
Do not use oslo.db 1.12.0
The oslo.db 1.12.0 release included implicit usage of the oslo_context
library. To complicate matters it imported oslo_context without listing
it as a requirement. Since subunit2sql does not use oslo_context
(meaning it wasn't necessarily installed) this caused subunit2sql to
crash with an ImportError whenever oslo.db calls were made when using
1.12.0. This commit adds an exclusion to the oslo.db line in the
requirements.txt file to mark that subunit2sql does not work with this
release.

Change-Id: I4ee8d3a037d9942ccdf0379b0cd2e40886f122a7
Related-Bug: #1468707
2015-06-25 12:05:06 -04:00
Matthew Treinish 60735a247a Add external plugin support to subunit2sql-graph
This commit adds support to the subunit2sql-graph command to load
installed plugins that add additional graph commands. The interface
for adding additional graph commands was already modular, but it
still required additional modules added in tree. Now additional
commands can be added just by adding entry-points in the
subunit2sql.graph.plugins namespace, the same pre-existing interface
for adding graph commands should be used.

Change-Id: I2bd59d9c3565ad0d07c357307e5151904bb0e288
2015-06-22 14:35:45 -04:00
Matthew Treinish 62e484dc68
Use setuptools extras for graphing requirements
This commit switches the packages only required to generate graphs,
mainly pandas and matplotlib, to be marked as extra requirements using
setuptools extras. These requirements aren't needed for subunit2sql
unless you want to generate graphs and they are fairly involved to
install with many external dependencies.

Change-Id: Iefc0bbed60ad8a42a2568060ce109072e3e4c920
2015-05-26 17:03:15 -04:00
Matthew Treinish ef9b60dd6f
Remove matplotlib from requirements file
This commit removes matplotlib from the requirements file. It is
only used by the subunit2sql-graph tool and isn't required for the
whole package. Given issues with running it in CI this removes it
from the requirements file and adds a note to the README about
needing it to use the graph command.

Change-Id: Ibdc68745ea035be66a35281845d7e4fc49e239a4
2015-05-15 19:59:24 -04:00
Matthew Treinish cd9b5ebcc1 Improve run_time graph formatting
This commit improves the formatting of the run_time graphs generated.
It adds a legend with details about the lines being shown, ups the
resolution to more clearly show details, and adds background fill to
show the std deviation.

Change-Id: I5e459e152391b7502a1557339b1745ec6a9c2516
2015-04-30 14:20:14 +00:00
Matthew Treinish 0084375002 Stop using numpy for just a mean
This commit stops using numpy in the 5332fe255095 migration, which is
a bit heavyweight to require for running migrations. Especially when
you can accomplish the same task using python built-ins.

Change-Id: Icbb22f7ffcba7f8b8e5de7ea38472a30a05cc598
2015-01-24 22:39:01 -05:00
Matthew Treinish 42f86e5266 Improve query efficiency on populate_run_time migration
This commit improves the efficiency of migration 5332fe255095 to only
make 1 query to pull the data set and one update for each test row.
This is much better than before where each test would make 2 additional
reads from the database to get the neccesary information to calculate
an average.

Change-Id: I891b8d255015566c422f224073e3511bb2810efb
2015-01-06 20:39:09 +00:00
Matthew Treinish 3036d15bf7 Add tool for generating line graphs of test run times
This commit adds a simple utility for generating graphs of an
individual tests run time over the entire set of test_runs. I imagine
this command will grow over time to generate other graphs, but for
right now it only does the one type.

Change-Id: I9ba442e83aeeac1ab9aad4b3e24ad09fd1e0f805
2015-01-06 15:38:41 -05:00
Matthew Treinish 10e5d0eda5 Bump oslo.config version
There is a bug in oslo.config <=1.3.0 when registering cli opts with
deprecated_opts set. This causes an error with registering the oslo.db
opts. The bug was fixed post 1.3.0, so pinning this to >= the latest
alpha, which will pull in any release 1.4.0 when it becomes available.

Closes-Bug: #1347911

Change-Id: I58505ffcdfb0acf0ed2137282c18258e94e201f6
2014-07-23 22:53:16 +00:00
Matthew Treinish 423d13aff2 Add basic unit tests
This commit adds the first unit tests to the projects. Right now
it's just testing a couple of utility methods. Mostly because they
were the easiest tests to write.
2014-06-24 20:14:18 -04:00
Matthew Treinish 81f84d66f9 Update requirements files
This commit makes some updates to the requirements files.
2014-06-24 16:26:50 -04:00
Matthew Treinish 9d86270fac Initial commit
This just adds the basic framework for all the various pieces. The
schema will be built using alembic. Everything else is untested.
2014-06-12 23:59:00 -04:00