-
Notifications
You must be signed in to change notification settings - Fork 25
Add TEST_DATABASE_URL to the default .env #123
Conversation
Currently it is a bit implicit that you can use the `TEST_DATABASE_URL` env variable. I was able to figure this out by looking through the source code, and since someone posted this on the issue tracker it means more people find it a bit implicit. Fixes: redwoodjs/redwood#1620
Should Since
is in defaults? Would Or a different database? Perhaps a comment describes its purpose? |
@dthyresson I was in doubt about this. The reason for me not to include it was that the DATABASE_URL in What I want to achieve with this is mostly awareness that this option is available for you to set, since this caused me a bunch of confusion. |
Thanks @jvanbaarsen -- perhaps @thedavidprice @cannikin or @peterp can determine if it should or not. Agree that the goals is not to be confused if you need to test against a postgres database |
My first thought is to add to # These environment variables will be used by default if you do not create any
# yourself in .env. This file should be safe to check into your version control
# system. Any custom values should go in .env and .env should *not* be checked
# into version control.
# schema.prisma defaults
DATABASE_URL=file:./dev.db
# location of the test database for api service scenarios (defaults to ./.redwood/test.db it not set)
# TEST_DATABASE_URL=file:./.redwood/test.db
# disables Prisma CLI update notifier
PRISMA_HIDE_UPDATE_MESSAGE=true |
I +1 Rob's suggestion above. Also, we most definitely need to finish the Test Documentation! I've added a note about this on that PR as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding to .env
, add to .env.defaults
with the current default path of .redwood/test.db
but commented out with a note about usage:
# These environment variables will be used by default if you do not create any
# yourself in .env. This file should be safe to check into your version control
# system. Any custom values should go in .env and .env should *not* be checked
# into version control.
# schema.prisma defaults
DATABASE_URL=file:./dev.db
# location of the test database for api service scenarios (defaults to ./.redwood/test.db it not set)
# TEST_DATABASE_URL=file:./.redwood/test.db
# disables Prisma CLI update notifier
PRISMA_HIDE_UPDATE_MESSAGE=true
Yes, this should go in |
Allright! I'll update this PR 👍 |
Currently it is a bit implicit that you can use the
TEST_DATABASE_URL
env variable. I was able to figure this out by looking through the
source code, and since someone posted this on the issue tracker it means
more people find it a bit implicit.
Fixes: redwoodjs/redwood#1620