SoftInstigate / restheart

Open Source Low-code API development framework Featuring ready-to-go Security and MongoDB API
http://softinstigate.github.io/restheart/
GNU Affero General Public License v3.0
792 stars 170 forks source link

Achieve full compatibility with FerretDB #477

Open ujibang opened 11 months ago

ujibang commented 11 months ago

Brief overview

FerretDB is the truly Open Source MongoDB alternative, built on Postgres.

We are working with the FerretDB team to make RESTHeart and FerretDB work together.

Rationale

Extend support to other DBs

Detailed documentation

TBD

b1ron commented 7 months ago

We added your integration tests to our CI see a failed run here. I will parse through the output and create issues and link them to our config files.

AlekSi commented 7 months ago

We noticed that restheart-core tests currently fail when run against MongoDB: https://github.com/FerretDB/dance/actions/runs/6964444145/job/18951686919?pr=649 Is it expected? Are we doing something wrong in https://github.com/FerretDB/dance/pull/649

ujibang commented 7 months ago

Some features of RESTHeart requires MongoDB to be run as a replica set. This because change streams and transactions are available only on a replica set.

We run our tests against a single node replica set.

See https://restheart.org/docs/setup#run-with-mongodb

Basically you need to run mongo as follows::

$ mongod --fork --syslog --replSet=foo -dbpath=/tmp/db && mongosh --quiet --eval 'if (!rs.isMaster().ismaster) rs.initiate({});'
ujibang commented 7 months ago

You can also skip tests that require a replica set (and run the tests against a standalone MongoDB process) as follows:

$ ./mvnw clean verify -Dkarate.options="--tags ~@requires-replica-set"

Also note that at https://github.com/softInstigate/restheart#execute-the-integration-tests-suite you will find instructions on how to run and test RESTHeart against FerretDB. You can notice that we specify there -Dkarate.options="--tags ~@requires-replica-set"

b1ron commented 7 months ago

Thanks @ujibang, we configured our MongoDB service as a single node replica set and it now passes.