I am trying to run unit/integration tests via pipeline and using PHP unit. The DB server is Microsoft SQL.
Here's an excerpt of bitbucket-pipelines.yml
name: New Unit Tests
- mv "env/.env-unit" ".env"
# - php artisan migrate --seed
- mv -f "public/azure.web.config" "public/web.config"
- apt-get update && apt-get install -y unzip zip
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer install
- php artisan migrate --seed
# might need to wait for sqlserver to start properly here
# - sqlcmd -S localhost,1433 -U SA -P 'ThePassword' -i myhsm.sql
- vendor/bin/phpunit --bootstrap vendor/autoload.php
- zip -r unit_deployment.zip .
It will either error out if I tried the php artisan migrate or sqlcmd is not available in this image to import the DB data. Otherwise, in the sqlserver tab things look okay. I think it comes down to getting this script to be able to import the data. Otherwise there'll be lots of
1) Tests\Unit\OrganisationControllerTest::testExample Doctrine\DBAL\Driver\PDOException: could not find driver
errors. Any suggestions on how to get MSSQL connected so my unit/integration tests can proceed?
It looks like that the build image you use - php:7.1.29 - does not have the PDO Driver for MSSQL configured / enabled.
The official PHP docker images have pre-made routines to enable PHP extensions. You can first start with a shell script executing this in context of the pipeline and then port it into a Dockerfile for your own build container that ships with the expected configuration.
Please see https://hub.docker.com/_/php the section How to install more PHP extensions which has this information.
...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...
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