From 99a32a42655ca7f55ebe5644c9915e44d243c195 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Thu, 4 Apr 2024 11:45:22 +0200 Subject: [PATCH] docs: explicitly call out how to run e2e tests in CONTRIBUTING.md (#6672) There was some confusion on how to run the e2e tests in #6447, so I'm adding a small section to CONTRIBUTING.md to make it clearer. --- CONTRIBUTING.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bd13bad381..9860c4fd52 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -148,6 +148,16 @@ If you can't connect to the docker container, check its status by running `docke To fix this, start a new container and make sure you give it the `-p 5432:5432` option. +### Running end-to-end (e2e) tests + +To run the e2e tests, you'll need a running Postgres instance that you can connect to. The easiest way to set this up is to use Docker. This command starts a Postgres instance with the required configuration (according to the details in `src/test/e2e/helpers/database-config.ts`): + +```sh +docker run --name unleash-postgres -p 5432:5432 -e POSTGRES_USER=unleash_user -e POSTGRES_PASSWORD=password -e POSTGRES_DB=unleash_test -d postgres:15 +``` + +Unleash will attempt to connect using the connection string in `src/test/e2e/helpers/database-config.ts` or the environment variable `TEST_DATABASE_URL`. + ## Nice to know ### Controllers