Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB: Add code from migr8 program #76

Merged
merged 2 commits into from
Nov 13, 2023
Merged

MongoDB: Add code from migr8 program #76

merged 2 commits into from
Nov 13, 2023

Conversation

amotl
Copy link
Member

@amotl amotl commented Nov 10, 2023

About

The migr8 program has been maintained over at 1. This patch adds it to cratedb-toolkit instead, in order to streamline maintenance in terms of more regular testing and shipping.

Details

Documentation is included. Installation works like:

pip install 'cratedb-toolkit[io]'
migr8 --help

A different CLI/library interface will be added on behalf of a subsequent iteration.

/cc @karynzv

Footnotes

  1. https://github.com/crate/mongodb-cratedb-migration-tool

Copy link

codecov bot commented Nov 10, 2023

Codecov Report

Attention: 125 lines in your changes are missing coverage. Please review.

Files Coverage Δ
cratedb_toolkit/__init__.py 100.00% <100.00%> (ø)
cratedb_toolkit/testing/testcontainers/mongodb.py 100.00% <100.00%> (ø)
cratedb_toolkit/io/mongodb/extract.py 72.41% <72.41%> (ø)
cratedb_toolkit/io/mongodb/cli.py 69.09% <69.09%> (ø)
cratedb_toolkit/io/mongodb/core.py 58.46% <58.46%> (ø)
cratedb_toolkit/io/mongodb/translate.py 61.97% <61.97%> (ø)
cratedb_toolkit/io/mongodb/export.py 26.92% <26.92%> (ø)

📢 Thoughts on this report? Let us know!

@amotl amotl force-pushed the amo/mongodb branch 2 times, most recently from 67c8c1c to f5aef18 Compare November 10, 2023 22:08
@amotl amotl requested review from seut and matriv November 10, 2023 22:13
@amotl amotl marked this pull request as ready for review November 10, 2023 22:13
@amotl amotl changed the title Add migr8 program from previous repository MongoDB: Add migr8 program from previous repository Nov 12, 2023
@amotl amotl changed the base branch from main to amo/generalize-testcontainers November 12, 2023 13:48
@amotl amotl force-pushed the amo/generalize-testcontainers branch 2 times, most recently from 725fd28 to 1c49f92 Compare November 12, 2023 17:54
Base automatically changed from amo/generalize-testcontainers to main November 12, 2023 17:56
Comment on lines +35 to +47
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.8", "3.12"]
mongodb-version: ["2", "3", "4", "5", "6", "7"]

env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
MONGODB_VERSION: ${{ matrix.mongodb-version }}
# Do not tear down Testcontainers
TC_KEEPALIVE: true
Copy link
Member Author

@amotl amotl Nov 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like MONGODB_VERSION may not be picked up by the test suite here, yet. By default, it is mongo:latest 1.

Footnotes

  1. https://github.com/testcontainers/testcontainers-python/blob/3add8cb09216/mongodb/testcontainers/mongodb/__init__.py#L51

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MongoDbContainerWithKeepalive has been improved correspondingly, and split into a seperate commit, see bf156ef.

@amotl amotl changed the title MongoDB: Add migr8 program from previous repository MongoDB: Add code from migr8 program Nov 12, 2023
@amotl amotl force-pushed the amo/mongodb branch 2 times, most recently from 2a0d819 to 173a645 Compare November 12, 2023 19:02
It honors the `TC_KEEPALIVE` and `MONGODB_VERSION` environment
variables.

Defining `TC_KEEPALIVE` will set a signal not to shut down the container
after running the test cases, in order to speed up subsequent
invocations.

`MONGODB_VERSION` will define the designated MongoDB version, which is
useful when used within a test matrix. Its default value is `latest`.
@amotl amotl merged commit 8491072 into main Nov 13, 2023
18 checks passed
@amotl amotl deleted the amo/mongodb branch November 13, 2023 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant