Hi all,
I'm using a mysql service which is required for some integration tests. This service is seeded with test data. However, it seems in any later step it just re-creates the service again from scratch, so it doesn't have the data pre-filled. So I would need to pre-fill it in every step where I want to use the mysql service.
Is there a way to keep the mysql service running during the whole pipeline? Or what would be the best approach?
This is the current pipeline definition (simplified):
image: davidzapata/php-composer-alpine:8.2
pipelines:
default:
- step:
name: Prepare environment
caches:
- vendor-folder
services:
- mysql
script:
- composer install --no-plugins --no-scripts --no-interaction
- php seed-database.php
- step:
name: Execute PHPUnit tests
size: 2x
services:
- mysql
caches:
- vendor-folder
script:
- phpunit --log-junit ./test-reports/junit.xml
- step:
name: Execute e2e tests
services:
- mysql
caches:
- vendor-folder
script:
- php run-e2e-tests.php
definitions:
caches:
vendor-folder:
key:
files:
- composer.lock
path: vendor
services:
mysql:
image: mysql:8.0
variables:
MYSQL_DATABASE: $MYSQL_DATABASE
MYSQL_ROOT_PASSWORD: $MYSQL_PASSWORD