* wip * bump jobpipeline dependency * bump pest dependency * fix composer.json syntax * minor changes to docker setup * more docker changes * compact pest output, remove unnecessary env vars from composer.json * minor pest tweaks * mssql fix * try enabling colors in CI * try setting --columns=max for pest in CI * try setting columns using env var instead of --columns in CI * Revert "try setting columns using env var instead of --columns in CI" This reverts commit eb3c177aefa97b0a3140d7f0e89c5012a854ff42. * replace --compact with --no-progress * try setting a hardcoded columns value in CI * remove --columns (doesn't work), add back --compact * try setting COLUMNS to a hardcoded value in CI * remove alternative env syntax from CI * fix PrefixCacheBootstrapperTest on L11, skip on L10 * add one more skip() call * fix validate.yml * Simplify schema dump, skip dump-related tests in L10 * Rename 'dump' table to 'example' * Bring schema dump-related tests together, add comments * Merge schema path-related tests into one, add comments * Rename dataset parameter --------- Co-authored-by: lukinovec <lukinovec@gmail.com>
1.8 KiB
Contributing
Code style
php-cs-fixer will fix code style violations in your pull requests.
To run it locally, use composer cs.
Running tests
Run composer docker-up to start the containers. Then run composer test to run the tests.
If you need to pass additional flags to phpunit, use composer test --, e.g. composer test -- --filter="foo". Alternatively, you can use ./test --filter="foo"
If you want to run a specific test (or test file), you can also use ./t 'name of the test'. This is equivalent to ./test --no-coverage --filter 'name of the test' (--no-coverage speeds up the execution time).
When you're done testing, run composer docker-down to shut down the containers.
Debugging tests
If you're developing some feature and you encounter SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry errors, it's likely that some PHP errors were thrown in past test runs and prevented the test cleanup from running properly.
To fix this, simply delete the database memory by shutting down containers and starting them again: composer docker-down && composer docker-up.
Docker on M1
Run composer docker-m1 to symlink docker-compose-m1.override.yml to docker-compose.override.yml. This will reconfigure a few services in the docker compose config to be compatible with M1.
Coverage reports
To run tests and generate coverage reports, use composer test-full.
To view the coverage reports in your browser, use composer coverage (works on macOS; on other operating systems you can manually open coverage/phpunit/html/index.html in your browser).
Rebuilding containers
If you need to rebuild the container for any reason (e.g. a change in Dockerfile), you can use composer docker-rebuild.
PHPStan
Use composer phpstan to run our phpstan suite.