Skip to content

fix: The DATABASE_URL set in .env.test doesn't include a colon between the username and password.#246

Merged
cullylarson merged 1 commit intocanaryfrom
bug/test-database-url-not-set-correctly
Feb 9, 2022
Merged

fix: The DATABASE_URL set in .env.test doesn't include a colon between the username and password.#246
cullylarson merged 1 commit intocanaryfrom
bug/test-database-url-not-set-correctly

Conversation

@cullylarson
Copy link
Copy Markdown
Contributor

If you provide a database password during setup, the DATABASE_URL set in .env.test will not have a colon between the username and password. If no password is provided, it works fine.

Changes

  • Update _.env.test.ejs to put a colon between the username and password if a password is provided.

Checklist

  • Generating a new app works

# ENV vars here override .env when running tests
DATABASE_URL="postgresql://<%= db.dev.user %><%= db.dev.password %>@<%= db.dev.host %>:<%= db.dev.port %>/<%= db.test.name %>?schema=public"
APP_SECRET=foo No newline at end of file
DATABASE_URL="postgresql://<%= db.dev.user %><% if (db.dev.password) { %>:<%= db.dev.password %><% } %>@<%= db.dev.host %>:<%= db.dev.port %>/<%= db.test.name %>?schema=public"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just copied this from _.env.ejs.

@cullylarson cullylarson merged commit 9d33f77 into canary Feb 9, 2022
@cullylarson cullylarson deleted the bug/test-database-url-not-set-correctly branch February 9, 2022 20:09
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.

2 participants