I'm developping a CakePHP application. The application has about 1500 tests which take about 4 hours to run sequentially. Therefore I want to use parallel pipelines to run 10 tests at the same time.
CakePHP tests create, delete and empty tables on most of the tests, so when alle 10 pipelines this can be a problem, when 1 test is using a table and the other one deletes it.
I've configured the 10 pipelines and written a custom PHP script that generates a PHPUnit test-suite for each of these 10 pipelines. Each test suite sets a DB_NAME environment variable so each pipeline can run on another database. I've added custom PHP code to create the database when it does not exists.
Locally, everything works perfect. However, when running the tests in Bitbucket pipelines I get the error: "Access denied for user 'testuser'@'%' to database 'test6'". So the default user can't create new databases next to the default "pipelines" database. And the documentation mentions no other users and also mentions that the root user is not available.
How can I fix this so I can run parallel tests? Waiting 4 hours to finish testing is not an option.
Are you running the MySQL database as a service inside Pipelines? Can you post your bitbucket-pipelines.yml configuration file (with any sensitive information redacted)? Note that if you're using Pipelines services, each step will get a separate whole service, ie. a separate whole MySQL instance, so there is no need to use different database names within MySQL.
We are excited to announce the open beta program for self-hosted runners. Bitbucket Pipelines Runners is available to everyone. Please try it and let us know your feedback. If you have any issue...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events