SIGN IN SIGN UP
payloadcms / payload UNCLAIMED

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

41461 0 0 TypeScript
test: improve database test setup (#14982) This PR brings over most of the test suite improvements I made [here](https://github.com/payloadcms/enterprise-plugins/pull/249) to our payload monorepo. - Replaces mongodb-memory-server with an actual mongo db using the mongodb-community-server docker image. This unblocks the vitest migration PR (https://github.com/payloadcms/payload/pull/14337). Currently, debugging does not work in that PR - this is due to the global setup script that has to start the mongo memory db. - Just like postgres, all mongodb databases now support vector search. mongodb-atlas-local supports it natively, and for mongodb-community-server, our docker compose script installs `mongot`, which unlocks support for vector search. This means we could add [vector storage/search tests similar to the ones we have for postgres](https://github.com/payloadcms/payload/blob/main/test/database/postgres-vector.int.spec.ts) - Int tests now run against both mongodb adapters: mongodb (mongodb-community-server) and mongodb-atlas (mongodb-atlas-local) - Adds docker scripts for mongodb, mongodb-atlas, and postgres, documented in README.md. Updates default db adapter URLs to automatically pick up databases started by those scripts. This makes it easier for people cloning the repo to get started with consistent databases matching CI - no complicated manual installation steps - Simplified db setup handling locally in CI. In CI, everything is scoped to `.github/actions/start-database/action.yml`. Locally, everything is scoped to `test/helpers/db`. Each database adapter now shares the same username, password and db name - Use consistent db connection string env variables, all ending with _URL - Updates the CONTRIBUTING.md with up-to-date information and adds a new database section. We now recommend everyone to use those docker scripts
2025-12-19 07:07:16 -08:00
# Database adapters: mongodb, mongodb-atlas, cosmosdb, documentdb, firestore, postgres, postgres-custom-schema, postgres-uuid, postgres-read-replica, vercel-postgres-read-replica, sqlite, sqlite-uuid, supabase, d1
PAYLOAD_DATABASE=mongodb
# Optional - used for the `translateNewKeys` script
OPENAI_KEY=
# If you're NOT using our docker scripts and want to manually install your database, uncomment these and point them to your local database.
# Do not uncomment these if you're using our Docker scripts to run your database.
# MONGODB_URL=mongodb://127.0.0.1/payloadtests
# POSTGRES_URL=postgres://127.0.0.1:5432/payloadtests