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

Use a (local) test DB for load tests so it doesn't wipe out the regular local DB #1074

Merged
merged 3 commits into from
May 15, 2024

Conversation

somesylvie
Copy link
Contributor

@somesylvie somesylvie commented May 8, 2024

Use a (local) test DB for load tests so it doesn't wipe out the regular local DB

Add a docker-compose.postgres-test.yml file that sets up an intermediary-test DB and have the load tests use that DB - then the regular local intermediary DB won't be wiped out by running load tests

Issue

#1044.

Checklist

  • I have updated the documentation accordingly

@somesylvie somesylvie marked this pull request as ready for review May 8, 2024 17:49
Copy link

sonarqubecloud bot commented May 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

POSTGRES_PASSWORD: "changeIT!" # pragma: allowlist secret
POSTGRES_USER: "intermediary"
ports:
- 5434:5432
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it supposed to be 5432:5434?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The non-test version is 5433:5432, so this is just incrementing the 5433 to match. I think the first number is the Docker host port (so what any services on your machine or a DB client or whatever would connect to) and the second is the container's port inside docker. Since the two DBs (intermediary and intermediary-test) are running on different containers, it's okay they're both using 5432 (the default postgres port), and then the 5434 is what the load tests connect to

@@ -4,8 +4,8 @@ set -e
start_api() {
echo 'Starting API'
export DB_URL=localhost
export DB_PORT=5433
export DB_NAME=intermediary
export DB_PORT=5434
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this port changed to 5434?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so that if you have the regular local DB already up and running, this won't conflict with or kill it

@somesylvie somesylvie merged commit 82e0652 into main May 15, 2024
16 checks passed
@somesylvie somesylvie deleted the 1044/load-tests-with-test-db branch May 15, 2024 19:52
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.

3 participants