Skip to content

Conversation

Abijeet
Copy link
Member

@Abijeet Abijeet commented Jan 31, 2021

This creates another mysql_testing database during db service setup

Replace server with env tags in phpunit.xml in order to force
override certain parameters when tests are run. See:
sebastianbergmann/phpunit#2353 for more
information.

Rename primary developer Docker database from bookstack-test to
bookstack-dev. bookstack-test is used as the mysql_testing database

Fixes the following error: glob error: [Error: EACCES: permission denied, scandir '/root/.npm/_logs'] { errno: -13, code: 'EACCES', syscall: 'scandir', path: '/root/.npm/_logs' } On Linux, these lines ensure file ownership is set to your host user/group
This creates another mysql_testing database during db service setup Replace server with env tags in phpunit.xml in order to force override certain parameters when tests are run. See: sebastianbergmann/phpunit#2353 for more information. Rename primary developer Docker database from bookstack-test to bookstack-dev. bookstack-test is used as the mysql_testing database
@Abijeet Abijeet requested a review from ssddanbrown January 31, 2021 13:25
@Abijeet Abijeet self-assigned this Jan 31, 2021
Copy link
Member

@ssddanbrown ssddanbrown left a comment

Choose a reason for hiding this comment

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

Thanks for this @Abijeet.

I really don't want to have to alter an app files just to suit the docker setup unless absolutely required, Especially those changes in phpunit.xml as I'm sure I'll end up spending time in the future trying to understand the difference in variables or I'll get caught out when trying to override them in testing.

The mysql_testing database connection takes a TEST_DATABASE_URL env option, This should take priority over other options and takes the format of mysql://user:password@host/table so that could be used if needed.

With this, test database migration is done automatically during init but seeding is done manually via command. I think it'd be better, and consistent with the non-docker flow, if both of these were done manually. Auto migrating alongside the non-test DB could cause confusion if errors are thrown and will slow down start-up and increase the output.

@ssddanbrown ssddanbrown merged commit 371033a into master Mar 21, 2021
@ssddanbrown ssddanbrown deleted the docker-tests branch March 21, 2021 17:44
@ssddanbrown
Copy link
Member

Thanks again @Abijeet.

I made the changes advised above within commit 43c2fc3.

@ssddanbrown ssddanbrown added this to the v0.32.0 milestone Mar 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants