Skip to content
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

PHP - Introduce Mutation testing #52

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ciaranmcnulty
Copy link
Contributor

@ciaranmcnulty ciaranmcnulty commented Nov 11, 2022

This introduces mutation testing using Infection, just for the non-generated code

In order to be able to use the acceptance tests with the mutation testing tools, the acceptance testing has been transposed into PHPUnit rather than the existing bash/make version

The gherkin-generate-tokens binary is removed as that was only for testing, but the bin/gherkin is left the same

@ciaranmcnulty
Copy link
Contributor Author

ciaranmcnulty commented Nov 12, 2022

I've cleaned out a lot of the 'fixes' as they were cluttering the PR - I'll do them after this is merged

It looks like the PHP composer install is being rate-limited at GitHub, which I don't think should happen in GHA! Investigating...

ciaranmcnulty added a commit to ciaranmcnulty/cucumber-gherkin that referenced this pull request Nov 13, 2022
This writes the github auth token to a config file in ~/.composer, which then uses it when downloading packages

This will help with github rate limiting, as was happening on cucumber#52

Documentation here: https://github.com/shivammathur/setup-php#github-composer-authentication
@ciaranmcnulty
Copy link
Contributor Author

ok, #55 might fix the rate limits + I'll rebase on top of that when it's merged

@ciaranmcnulty ciaranmcnulty changed the title Draft: [PHP] Introduce Mutation testing PHP - Introduce Mutation testing Nov 13, 2022
mpkorstanje pushed a commit that referenced this pull request Nov 13, 2022
This writes the github auth token to a config file in ~/.composer, which then uses it when downloading packages

This will help with github rate limiting, as was happening on #52

Documentation here: https://github.com/shivammathur/setup-php#github-composer-authentication
@@ -39,12 +29,13 @@ clean: ## Remove all build artifacts and files generated by the acceptance tests

.DELETE_ON_ERROR:

acceptance: .built $(TOKENS) $(ASTS) $(PICKLES) $(ERRORS) $(SOURCES) ## Build acceptance test dir and compare results with reference
acceptance: .built ## Test parser against test data
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this should be .PHONY now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove the goal entirety.

Do update the php/README.md with info about the structure.

@@ -56,8 +57,23 @@ jobs:
run: |
vendor/bin/php-cs-fixer --dry-run --diff fix
vendor/bin/psalm --no-cache
vendor/bin/phpunit
vendor/bin/phpunit --testsuite unit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can run all the tests in a regular run. The separation between acceptance and unit existed only because we had different methods for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants