In the earlier post, we have talked about how to test your Laravel application with Bitbucket Pipelines, but sometimes you may need to run the tests on specific commit and not after you push it, luckily for us Bitbucket Pipelines team has implemented the custom section in the ymal file, which helps us to do so.
It does not differ that much from what we already have, so adding the following to our file which we created in the earlier post will enable us to manually run the pipeline:
- composer install --no-progress --no-suggest --prefer-dist
- cp .env.testing .env
- sed -i "s/DB_DATABASE=.*/DB_DATABASE=mytest_database/" .env
- sed -i "s/DB_USERNAME=.*/DB_USERNAME=root/" .env
- sed -i "s/DB_PASSWORD=.*/DB_PASSWORD=test_user_password/" .env
- php artisan key:generate
- php artisan migrate
- php vendor/bin/phpunit .