From aae51594babb89cada3923a834d75e997db5cb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= Date: Thu, 3 Jul 2025 11:09:29 +0200 Subject: [PATCH 1/3] chore: remove old param --- start-ferretdb.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/start-ferretdb.sh b/start-ferretdb.sh index 05c8fbc..a5ba275 100644 --- a/start-ferretdb.sh +++ b/start-ferretdb.sh @@ -3,7 +3,6 @@ FERRETDB_VERSION=$1 FERRETDB_PORT=$2 FERRETDB_TELEMETRY=$3 -USE_POSTGRES=$4 echo "Starting FerretDB version ${FERRETDB_VERSION} on port ${FERRETDB_PORT}" From 83961d9641228643fda0bfb82a47066545774f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= Date: Thu, 3 Jul 2025 11:09:46 +0200 Subject: [PATCH 2/3] fix: access ferretdb unauthorized --- start-ferretdb.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/start-ferretdb.sh b/start-ferretdb.sh index a5ba275..855f0b1 100644 --- a/start-ferretdb.sh +++ b/start-ferretdb.sh @@ -11,13 +11,14 @@ docker network create ferretdb docker run --network ferretdb --name postgres \ -e POSTGRES_USER=username \ -e POSTGRES_PASSWORD=password \ - -e POSTGRES_DB=ferretdb \ + -e POSTGRES_DB=postgres \ -d ghcr.io/ferretdb/postgres-documentdb:latest docker run --network ferretdb --name ferretdb \ -p $FERRETDB_PORT:27017 \ - -e FERRETDB_POSTGRESQL_URL=postgres://username:password@postgres:5432/ferretdb?pool_max_conns=40 \ + -e FERRETDB_POSTGRESQL_URL=postgres://username:password@postgres:5432/postgres?pool_max_conns=40 \ -e FERRETDB_TELEMETRY=$FERRETDB_TELEMETRY \ + -e FERRETDB_AUTH=false \ -d ghcr.io/ferretdb/ferretdb:$FERRETDB_VERSION if [ $? -ne 0 ]; then From 05798c2771f8844a73a90b25f64f9bc6d38817a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20K=C3=B6nig?= Date: Thu, 3 Jul 2025 11:10:01 +0200 Subject: [PATCH 3/3] chore: actually test acessing the db --- test/test.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/test.js b/test/test.js index dabbc12..b3bf595 100644 --- a/test/test.js +++ b/test/test.js @@ -11,6 +11,15 @@ test("connects to FerretDB", async () => { await connection.close() }) +test("creates a collection and record", async () => { + const connection = await Mongoose.createConnection(`mongodb://localhost:${PORT}`).asPromise() + + const collection = await connection.createCollection("TestCollection") + await collection.insertOne({ name: "Test Document" }) + + await connection.close() +}) + test("fails to connect to non-existent FerretDB instance", async () => { await expect( Mongoose.connect(`mongodb://localhost:${parseInt(PORT) + 1}`, {