Commit Graph

46 Commits

Author SHA1 Message Date
Jason Madden 7015f597e3
Document that PyPy does not work with mysqlconnector and remove it from the matrix. 2018-02-02 09:29:42 -06:00
Jason Madden d2cdd3ad24
Modernize .travis.yml [skip appveyor] 2018-01-31 10:57:41 -06:00
Jason Madden d584d19ef0
Attempt to fix Python 3.6 build on Travis. 2017-06-22 10:40:50 -05:00
Jason Madden db12477bc3
Update to Pylint 1.7
Fixes #181

Mostly a few changes in pragmas. There are also a few actual code
changes:

- remove reduntant `else return` after `if return`
- Change some `x = foo and bar or baz` into equivalent `bar if foo
  else baz` forms.
2017-06-22 10:27:27 -05:00
Jason Madden 3860375815
Use a better query to delete blob chunks for HF MySQL
Fixes #175.

Also pins pylint because 1.7.0 has a number of (good!) new warnings.
2017-04-14 10:16:52 -05:00
Jason Madden 3b65f778e6
Test on ZODB 4.4
Fixes #169.

We need this version for IMultiCommitStorage and the registerDB fix in
ConflictResolvingStorage. Since these versions run on Python 2.7.8,
there's no motivation for trying to go back farther.
2017-04-11 09:27:46 -05:00
Jason Madden 8e7b49d2a6
Clean up mysqlconnector driver name. Clean up installation docs and driver statement docs. 2017-01-26 11:58:05 -06:00
Jason Madden a2c398e1c2
Simplify lastrowid. Update comments. Simplify build matrix. 2017-01-25 17:57:20 -06:00
Jason Madden 9261f009db
really try to use the explicit drivers. 2017-01-25 10:15:44 -06:00
Jason Madden 45bf891321
Fix tests with python connector. Try to run both on travis. 2017-01-25 09:55:05 -06:00
Jason Madden 28f9b1ac56
Initial support for connector/python 2017-01-24 17:18:29 -06:00
Jason Madden 3f15d12583
fully specify the matrix 2017-01-24 13:44:59 -06:00
Jason Madden 618243a1e0
Try using the matrix to only put postgres on the trusty image. 2017-01-24 13:39:36 -06:00
Jason Madden 4f010fc972
try the newer trusty environment for travis ci to get needed postgres. 2017-01-24 13:24:48 -06:00
Jason Madden 82dc954578
postgres 9.5+: use ON CONFLICT UPDATE to make temp permanent
Instead of a combination DELETE/INSERT statement. This gives us a 5-10%
performance increase.

BEFORE

"Transaction",                postgresql
"Add 1000 Objects",                17167
"Update 1000 Objects",             17314
"Read 1000 Warm Objects",          12575
"Read 1000 Cold Objects",          16714
"Read 1000 Hot Objects",           58357
"Read 1000 Steamin' Objects",    2124724

AFTER

"Transaction",                postgresql
"Add 1000 Objects",                18042
"Update 1000 Objects",             19380
"Read 1000 Warm Objects",          13611
"Read 1000 Cold Objects",          17970
"Read 1000 Hot Objects",           62971
"Read 1000 Steamin' Objects",    2069391
2017-01-24 10:40:25 -06:00
Jason Madden aa293beeb1
trying 3.6 for ci 2017-01-04 14:45:36 -06:00
Jason Madden 6d4731daa5 Support for Python 3.6 (#146)
* Initial support for 3.6: tox.ini, changes.rst

* Try 3.6.0rc1 in travis

* Try 3.6.0rc1 in travis

* Adjust version specs for 3.6.0rc1
2016-12-12 06:36:17 -06:00
Jason Madden 4bf54e0954 Cleanup all the lint (#143)
* Clean up all violations reported by pylint in preperation for turning on landscape.io

* fix all prospector errors.

* don't run pylint on pypy/py3 because we're getting all sorts of import errors under Py3 (and it's sorta slow on pypy)

* back to editable? Somehow _cache_ring isn't always being built.

* skip bootstrap.py on landscape.

* pylint fixes for umysql
2016-12-10 11:27:11 -06:00
Jason Madden c92487edd3
make sure to skip pymysql under pypy-5.4.1; we used to before the explicit versioning. 2016-11-17 08:27:53 -06:00
Jason Madden 83b5eca55f
Try native up-to-date pypy
Per https://github.com/travis-ci/docs-travis-ci-com/pull/771/
2016-11-15 14:10:21 -06:00
Jason Madden 93afe5fb1c
Set the snakepit location to where we expect it to be. 2016-09-22 17:17:36 -05:00
Jason Madden 3b90200d89
Move installing pypy and PATH manipulation to before_install, like the example 2016-09-22 17:09:25 -05:00
Jason Madden 632847d201
Rip out the compatibility with old CFFI.
The PyPy on Travis doesn't run with it anyway, and I couldn't make it
work locally either.

Try to install a pypy to test with that does work.
2016-09-22 17:00:29 -05:00
Jason Madden 763024c3f4
Restore -e to the travis install so we get proper test coverage. 2016-09-08 09:23:46 -05:00
Jason Madden 6425cbf2c1
Use find_packages instead of a manual list, and test non-editable installs. Fixes #121 2016-09-08 06:29:29 -05:00
Jason Madden f81338039a
Ahh, maybe the b1 in the ZEO pin is what's allowing it to use ZEO 5b0? Anyway, PyPy is having trouble untarring ZEO-5.0.0b0.tar.gz. 2016-08-23 13:01:49 -05:00
Jason Madden 14eb8abdf0
Try installing in .travis.yml in a different spot, with pins 2016-08-23 11:06:02 -05:00
Jason Madden 452bdd0864
Try installing in .travis.yml 2016-08-23 10:56:09 -05:00
Jason Madden ac3e77caeb
No need to install patched ZODB from git anymore, ZODB 4.4.3 is out. 2016-08-23 10:47:13 -05:00
Jason Madden 8ad649511a Adapt code from NextThought to support umysqldb (#110)
* Adapt code from NextThought to implement umysqldb support. Fixes #79.
* exclude should be a sub-key of matrix.
* Force the right driver for the umysqldb tests.
* formatting and debuging.
* Use bytes, not bytearry, to avoid a crash in umysql.
* Tweak driver selection.
* test fixes for umysqldb.
2016-07-17 11:23:05 -05:00
Jason Madden 14c65a1525 Changes to handle_serials merged to version 4 and removed in version 5. 2016-07-12 12:46:30 -05:00
Jason Madden 28086b93e7 Use the branch with the test patch. 2016-07-11 16:11:34 -05:00
Jason Madden d2c659b86b
Implement saving/loading the local cache to/from a file.
As #92 shows, this can have a profound performance impact (depending on
the hit rate, of course, and the relative speed of the
database/Memcache).

This still needs a lot of cleanup, specific testing, and documentation.
Committing as a WIP.
2016-07-07 18:36:57 -05:00
Jason Madden 06bfe2da4b
Bump PG server for pg8000. 2016-07-01 17:44:55 -05:00
Jason Madden f1e017bc77
different syntax for travis conditional. 2016-07-01 17:26:08 -05:00
Jason Madden 4ba2b252d5
Initial support for pg8000
The major difference from psycopg2/cffi is that it doesn't have native
lobject support. This is easily worked around, but this draft is not
complete because it doesn't support chunks. Some refactoring will be
required to elegantly handle this.

Two minor differences:

- It doesn't support multiple statements in a single `cursor.execute()`
  call. Apparently it turns all statements into prepared statements,
  because the error is from the server. Easily worked around and
  unlikely to be a perfomance difference.
- It handles transaction isolation levels like most other drivers, in
  SQL. This could be handled more elegantly too.

One thing: The server spits out lots of "WARNING: not in a transaction".
If I enable statement logging, I see every `commit` immediately followed
by a `rollback`, which generates the warning. I'm not sure if that's
just us, or something the driver is doing differently (e.g, maybe
psycopg2/cffi always follows `commit` with `begin`? and then when we try
to `rollback` we're already in a transaction?). Annoying but harmless.
Still, would like to figure it out though.

Testing this pure-python driver on Python 3 also revealed a lot of
connection leaks, many of which I've fixed, but there are probably more.
This should be a win for PyPy. See also zopefoundation/ZODB#78.

The testing matrix is expanded to test the pure-python drivers on
CPython too and to test pg8000. (Travis will be the first time I run
psycopg2 tests; hope I didn't break anything!)

Fixes #85.
2016-07-01 17:10:36 -05:00
Jason Madden b6862be066
Enable memcache integration on Travis. Fixes #53. 2016-06-27 09:27:05 -05:00
Jason Madden 7c3200e31a
try to install the memcache libs as a first step 2016-06-27 09:00:55 -05:00
Jason Madden 5c10809035
upgrade setuptools. 2016-06-24 07:32:39 -05:00
Jason Madden 5ae308fd55
registerDB and new_instance cooperate with storage wrappers.
Fixes #70 and fixes #71.

Add tests for this.
2016-06-24 07:25:51 -05:00
Jason Madden 67d4fdd8c5
Another place to use the slow zap for PyPy; looks like a bug in ZODB test isolation. 2016-06-18 08:20:36 -05:00
Jason Madden 97cff3a170
Attempt to get the setup metadata for Python 3 right and turn on travis for it. 2016-06-16 14:16:03 -05:00
Jason Madden 6db5e45aca
Update postgres in travis addons for commit-lock-timeout testing. 2016-06-15 09:30:52 -05:00
Jason Madden 01e8f7d456
disable coverage by default for pypy because it's way too slow. 2016-06-13 10:13:08 -05:00
Jason Madden befbdc32f1
Try enabling PyPy on Travis.
Locally, I'm getting a bunch of MemoryErrors with PyPy 5.0+MySQL (with
or without coverage) that I didn't get with PyPy 4.whatever I was using
before.

```
File "relstorage/tests/blob/testblob.py", line 532, in relstorage.tests.blob.testblob.savepoint_cleanup
Failed example:
    db = DB(bs)
Exception raised:
    Traceback (most recent call last):
      File "/Users/jmadden/bin/pypy/lib-python/2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest relstorage.tests.blob.testblob.savepoint_cleanup[3]>", line 1, in <module>
        db = DB(bs)
      File "////relstorage/.tox/pypy-mysql/site-packages/ZODB/DB.py", line 458, in __init__
        temp_storage.tpc_vote(t)
      File "////relstorage/.tox/pypy-mysql/site-packages/perfmetrics/__init__.py", line 133, in call_with_metric
        return f(*args, **kw)
      File "relstorage/storage.py", line 841, in tpc_vote
        return self._vote()
      File "relstorage/storage.py", line 875, in _vote
        self._prepare_tid()
      File "relstorage/storage.py", line 757, in _prepare_tid
        adapter.txncontrol.add_transaction(cursor, tid_int, user, desc, ext)
      File "relstorage/adapters/txncontrol.py", line 140, in add_transaction
        self.Binary(description), self.Binary(extension)))
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/cursors.py", line 159, in execute
        query = self.mogrify(query, args)
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/cursors.py", line 138, in mogrify
        query = query % self._escape_args(args, conn)
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/cursors.py", line 113, in _escape_args
        return tuple(conn.escape(arg) for arg in args)
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/cursors.py", line 113, in <genexpr>
        return tuple(conn.escape(arg) for arg in args)
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/connections.py", line 793, in escape
        return escape_item(obj, self.charset, mapping=mapping)
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/converters.py", line 26, in escape_item
        val = encoder(val, mapping)
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/converters.py", line 94, in escape_bytes
        return b"_binary'%s'" % escape_string(value)
      File "////relstorage/.tox/pypy-mysql/site-packages/pymysql/converters.py", line 83, in escape_string
        value = value.replace('\\', '\\\\')
    MemoryError
```
2016-06-13 08:57:25 -05:00
Jason Madden 55436c7aaf Travis CI for MySQL and Postgres.
Adds .travis.yml and scripts for creating the DBs for those tests.
Travis is setup to send coverage reports to coveralls.io (once the tests
pass).

Also adds a tox.ini and .coveragerc for checking coverage locally.

Run the tests with '-m relstorage.tests.alltests', which now behaves
like the existing '-m relstorage.tests.testmysql' et al.

Fixes an issue running blob tests with '-m'.
2016-06-10 08:47:04 -05:00