- Move tests out of the package.
No significant changes.
- Deprecated MongoDBService.
No significant changes.
Require pymongo 3.5.
Dropped deprecated methods in helper:
helper.filter_warnings
helper.connect
(#12748811)
- Extended the timeout dramatically on Windows, but only when GITHUB_ACTIONS is configured. (#32)
- Added special handling for MongoDB 7 query plan structure (#35)
- Removed MongoDBInstance.mongod_args, removing default to ephemeralForTest storage engine, which no longer exists (#34)
- Pin to Mongodb 6.0.9 to prevent installation of breaking 7.0 release (#34)
- Added
helpers.server_version
. (#28) oplog
createIndexes
support is now only applied on MongoDB 4.4 and later. (#28)
- Require Python 3.8 or later.
#27: In oplog module, once again support createIndex operations even on MongoDB 4.4 and later.
mongodb_instance
now uses preferred simple fixture
instead of deprecated yield_fixture
.
Rely on native f-strings and remove dependency on future-fstrings.
#22: The pytest fixture now honors --mongodb-uri
or
the environment variable MONGODB_URL
to run tests
against an existing instance of MongoDB rather than starting
up a new one.
Rely on PEP 420 for namespace package.
Require Python 3.6 or later.
#26: Removed --noprealloc
and --smallfiles
from
MongoDBReplicaSet class, restoring compatibility on
later MongoDB releases.
Added jaraco.mongodb.sampling
with the new
estimate
function for estimating the count of
objects matching a query.
Remove dependency on namespace_format
from
(otherwise pinned) jaraco.text
and instead rely
on future-fstrings
to provide for f-strings on
supported Python versions.
#25: Pin dependency on jaraco.text 2.x to avoid error.
Fixed DeprecationWarning in assert_distinct_covered.
Fix a couple of deprecation warnings, including an emergent one on recent pytest versions.
Add codec
module with support for parsing dates from
JSON input, suitable for making queries.
Switch to pkgutil namespace technique
for the jaraco
namespace.
create_database_in_shard
now also reports the 'nodes'
on which the database was created.
Added testing.assert_index_used
function.
Removed deprecation of helper.connect_db
, as the
upstream implementation still doesn't provide for a
nice 'default'.
Disabled and deprecated helper.filter_warnings
.
Deprecated helper.connect
.
Deprecated helper.connect_db
in favor of functions
now available in pymongo 3.5.
Added helper.get_collection
.
#21: In mongodb_instance
fixture, allow --port
to be
passed as mongod args, overriding default behavior of starting
on an ephemeral port.
Refreshed project metadata, including conversion to declarative config. Requires Setuptools 34.4 to install from sdist.
In query.upsert_and_fetch
, allow keyword arguments to pass
to the underlying call.
Fix return value in query.upsert_and_fetch
.
MongoDB Instances are now started with
--storageEngine ephemeralForTest
instead of deferring to
the default storage engine. As a result, these options have
also been removed from the mongod invocation:
- noprealloc
- nojournal
- syncdelay
- noauth
This change also means that the soft_stop
method has no
benefit and so has been removed.
MongoDBInstances will no longer attempt to store their data in the root of the virtualenv (if present). Instead, they unconditionally use a temp directory.
#12: Ensure indexes when moving files using move-gridfs
script.
#19: Added Python 2 compatibility to the monitor-index-creation
script.
Added compat.Collection
with save
method added in 6.2.
No longer pass --ipv6
to mongod in MongoDBInstance. IPv6
is supported since MongoDB 3.0 without this option, and in
some environments, supplying this parameter causes the daemon
to fail to bind to any interfaces.
Added jaraco.mongodb.insert-doc
to take a JSON document
from the command-line and insert it into the indicated collection.
#18: Allow pmxbot command to connect to the MongoDB database other than localhost.
Add jaraco.mongodb.fields
for escaping values for document
fields.
#17: Remove --nohttpinterface
when constructing MongoDB
instances, following the same approach taken by MongoDB.
#16: Fixed monitor-index-creation script for MongoDB 3.2+.
Corrected oplog replication issues for MongoDB 3.6 (#13, #14).
Moved Extend
action in oplog module to
jaraco.ui 1.6.
In move-gridfs
, explicitly handle interrupt to allow a
move to complete and only stop between moves.
Fix AttributeError in move-gridfs
get_args.
Miscellaneous packaging fixes.
Removed support for seconds
argument to oplog
command.
move-gridfs
now accepts a limit-date option, allowing
for the archival of files older than a certain date.
#11: With save, only use replace when an _id is specified.
#10: MongoDBInstance now passes the subprocess output
through to stderr and stdout. Callers should either
capture this output separately (such as pytest already
does) or set a .process_kwargs
property on the
instance to customize the stdout
and/or stderr
parameters to Popen.
Use portend for finding available local port, eliminating remaining DeprecationWarnings.
Add compat module and compat.save
method for
supplying the Collection.save
behavior, deprecated
in PyMongo.
Updated PyMongo 3.0 API usage to eliminate DeprecationWarnings.
#9: Fix issue with MongoDBInstance by using
subprocess.PIPE
for stdout. Users may read from
this pipe by reading instance.process.stdout
.
Now, suppress creation of MongoDBInstance log file in fixture and MongoDBInstance service.
Removed workarounds module.
Added workarounds module with safe_upsert_27707
.
No longer startup MongoDBInstance with
textSearchEnabled=true
, fixing startup on MongoDB 3.4
and dropping implicit support for text search on MongoDB 2.4.
#7: Oplog tool now supports MongoDB 3.4 for the tested use cases.
assert_covered
now will fail when the candidate cursor
returns no results, as that's almost certainly not an effective
assertion.
Nicer rendering of operations in the oplog tool.
In testing
module, assertions now return the objects
on which they've asserted (for troubleshooting or additional
assertions).
#6: Oplog tool will now include, exclude, and apply namespace renames on 'renameCollection' commands.
Oplog tool no longer has a default window of 86400 seconds, but instead requires that a window or valid resume file be specified. Additionally, there is no longer a default resume file (avoiding potential issues with multiple processes writing to the same file).
Oplog tool now accepts a --window
argument, preferred
to the now deprecated --seconds
argument. Window
accepts simple time spans, like "3 days" or "04:20" (four
hours, twenty minutes). See the docs for pytimeparse for specifics
on which formats are supported.
Fix version reporting when invoked with -m
.
Oplog tool no longer defaults to localhost
for the dest,
but instead allows the value to be None. When combined with
--dry-run
, dest is not needed and a connection is only
attempted if --dest
is indicated.
Oplog tool now logs the name and version on startup.
Removed oplog.increment_ts
and Timestamp.next
operation
(no longer needed).
Ensure that ts is a oplog.Timestamp during save_ts
.
#3: create_db_in_shard
no longer raises an exception when
the database happens to be created in the target shard.
#5: Better MongoDB 3.2 support for oplog replication.
Tests in continuous integration are now run against MongoDB 2.6, 3.0, and 3.2.
Oplog replay now warns if there are no operations preceding the cutoff.
#2: Retain key order when loading Oplog events for replay.
Avoid race condition if an operation was being applied when sync was cancelled.
oplog
now reports the failed operation when an oplog
entry fails to apply.
oplog
command now accepts multiple indications of the
following arguments:
- --ns - --exclude - --rename
See the docstring for the implications of this change.
Drop support for Python 3.2.
Add helper module to docs.
Added sharding
module with create_db_in_shard
function and pmxbot command.
Add Trove classifier for Pytest Framework.
Extract migration manager functionality from YouGov's cases migration.
Correct syntax error.
Set a small batch size on fs query for move-gridfs to prevent the cursor timing out while chunks are moved.
Add jaraco.mongodb.move-gridfs
command.
Exposed mongod_args
on MongoDBInstance
and MongoDBReplicaSet
.
Allow arbitrary arguments to be included as mongodb args with pytest plugin. For example:
pytest --mongod-args=--storageEngine=wiredTiger
Added manage
module with support for purging all databases.
Added .purge_all_databases
to MongoDBInstance.
Minor usability improvements in monitor-index-creation script.
Better error reporting in mongodb_instance fixture.
MongoDBInstance now allows for a .soft_stop
and subsequent .start
to restart the instance against the same data_dir.
repair-gridfs
command now saves documents before removing
files.
Add helper.connect_gridfs
function.
Add script for removing corrupt GridFS files:
jaraco.mongodb.repair-gridfs
.
Add helper
and uri
modules with functions to facilitate common
operations in PyMongo.
Add script for checking GridFS. Invoke with
python -m jaraco.mongodb.check-gridfs
.
#1: Rename a namespace in index operations.
Add a dry-run
option to suppress application of operations.
Oplog command no longer accepts '-h', '--host', '--to', '--port', '-p', or '--from', but instead accepts '--source' and '--dest' options for specifying source and destination hosts/ports.
Adopt abandoned mongooplog_alt
as jaraco.mongodb.oplog
.
Support PyMongo 2.x and 3.x.
Adopted service
module from jaraco.test.services.
Add testing.assert_distinct_covered
.
Add query.compat_explain
, providing forward compatibility
for MongoDB 3.0 explain changes.
testing.assert_covered
uses compat_explain for MongoDB 3.0
compatibility.
Add query module with project
function.
Removed references to jaraco.modb
. Instead, allow the Sessions object to
accept a codec
parameter. Applications that currently depend on the
use_modb
functionality must instead use the following in the config:
"sessions.codec": jaraco.modb
Initial release, introducing sessions
module based on yg.mongodb
2.9.