-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update docker and test configs #2678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from composer scripts, I don't think these changes improve anything.
Thanks for the suggestion.
Apart from composer scripts, I don't think these changes improve anything.
I don't want to improve performance or anything else. I just want to update the docker configuration to be more effective and make developing easier.
If you look at the current dockerfile, in the last line, it is installing dependencies and run the tests. which means to run the tests, I have to build the dockerfile each time?
It's obvious developers must build dockerfile the first time and then run the tests using command line inside of the countainer.
Another update for the project's structure can be using StyleCI instead of PHP Code Sniffer. StyleCI can be configured to fix the code style using an automated merge commit.
Fixing code style after every change (after the pipeline failed mostly😅) is annoying.
If you look at the current dockerfile, in the last line, it is installing dependencies and run the tests. which means to run the tests, I have to build the
dockerfileeach time? It's obvious developers must builddockerfilethe first time and then run the tests using command line inside of thecountainer.
The last line is the default command when you run the container.
docker-compose run --rm tests
Note that I don't use this docker image to develop because the integration with PHPStorm and xdebug set-by-step debugging is hard to setup.
So I just found that the memory limit is too low. This lines should be added after docker-php-ext-install -j$(nproc) zip.
cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini && \
echo "memory_limit=-1" >> /usr/local/etc/php/php.ini
Another update for the project's structure can be using StyleCI instead of PHP Code Sniffer. StyleCI can be configured to fix the code style using an automated merge commit.
Fixing code style after every change (after the pipeline failed mostly😅) is annoying.
Not all CS issues can be fixed automatically, but in 90% of cases, we could make it easier for external contributors to contribute by automatically committing modifications proposed by phpcbf.
The last line is the default command when you run the container.
It had never run tests on my computer. It is even mentioned here.
we could make it easier for external contributors to contribute by automatically committing modifications proposed by phpcbf.
So you mean it can be done automatically? How?
Dockerfile
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xdebug mode is set to coverage.
I don't have any more changes to propose and I think it's the end of this PR.
Please take every feature that you find helpful and revert the rest.
If you want to merge this PR, you can do it after merging #2664. I think there are some conflicts.
Conflicts resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this change is based on a comment in another PR, but I wonder if it belongs in this PR. As in my eyes it is a code style thing, which adds a lot of noise to the PR. Personally I would create a separate PR to add these changes.
Though personally I don't see a benefit to these changes, but that's me and the project style is leading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to the changes, as those are CS changes.
From the action-runners docs/readme
Both Xdebug and PCOV extensions are installed, but only Xdebug is enabled.
Does this get overridden with setting the extensions manually?
Co-Authored-By: Tonko Mulder <tonko@tonkomulder.nl>
...ll vendors and run phpunit, fix composer script aliases
I updated the branch with the followings:
- Revert the
PHP_VERSIONargument, so it's easy to test with other PHP versions. Even if that's not the main usage, but it would necessary to debug errors specific to a PHP version. - Set the ini config in
phpunit.xml.dist, it's possible to change them by creating thephpunit.xml - Composer scripts automatically resolves binaries in
vendor/bin - Add a default command for
docker-compose run app, that install vendors and run tests.docker-compose run app bashis recommanded if you need to tests many times without restarting the container.
Thank you @hans-thomas
Hello there,
I updated the
Dockerfileanddocker-composefiles. I also added some scripts to thecomposerthat might be used very often.