-
-
Notifications
You must be signed in to change notification settings - Fork 170
Add targets to Makefile to run everything in docker #2074
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
base: master
Are you sure you want to change the base?
Conversation
| ]; | ||
| } | ||
|
|
||
| public function test_all_docker_test_targets_are_properly_declared(): void |
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.
Looking for ~10 minutes to this test and the second one that is removed, I didn't get it and it looks like it works incorrectly making incorrect assumption regarding targets naming.
@theofidry do you have any idea what does it do and why it fails with the current Makefile?
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'll comment in each tests
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.
This test ensures that we follow the pattern that for each phony target test-*-docker, it contains all test-*-*-docker.
For instance:
test-dockercontainstest-unit-docker,test-e2e-dockerandtest-infection-docker.test-unit-dockercontainstest-unit-82-docker,test-unit-83-docker, etc.
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.
@maks-rafalko I couldn't check which ones were failing, but IIRC there was some hardcoding to deal with autoreview that was not really following the conventions at that time
| -type f \ | ||
| -not -name "*.cache" \ | ||
| -not -name "*.log" \ | ||
| -not -path "./.DS_Store" \ |
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.
is it really related?
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.
well, implicitly, without this make autoreview-docker doesn't pass
| ]; | ||
| } | ||
|
|
||
| public function test_all_docker_test_targets_are_properly_declared(): void |
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'll comment in each tests
| $this->assertEqualsCanonicalizing($rootTestTargets, $testPrerequisites); | ||
| } | ||
|
|
||
| public function test_the_docker_test_target_runs_all_the_tests(): void |
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.
This test was to ensure the (phony) test-docker executes all (phony) tests, i.e. thattest-docker executes:
autoreviewtest-unit-dockertest-e2e-dockertest-infection-docker- and if added any
test-x-docker
| $testRules = self::getTestRules(true); | ||
|
|
||
| // Exclude itself | ||
| $testPrerequisites = array_shift($testRules)->getPrerequisites(); |
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.
this is getting all the pre-requesites of test-docker
| // Exclude itself | ||
| $testPrerequisites = array_shift($testRules)->getPrerequisites(); | ||
|
|
||
| $rootTestTargets = self::getRootTestTargets($testRules, 2); |
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.
this is getting all the test-*-* (phony) targets
| ]; | ||
| } | ||
|
|
||
| public function test_all_docker_test_targets_are_properly_declared(): void |
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.
This test ensures that we follow the pattern that for each phony target test-*-docker, it contains all test-*-*-docker.
For instance:
test-dockercontainstest-unit-docker,test-e2e-dockerandtest-infection-docker.test-unit-dockercontainstest-unit-82-docker,test-unit-83-docker, etc.
|
If I may, I think part of the confusion is that this PR does two things:
*: previously we had for instance In any case, removing |
|
for some reason I can't comment under you comment, so will leave here:
here is the problem I think, because we have At the same time we have So this convention is not followed. We should either rename |
I don't think we need all the supported versions to be tested locally, we have CI for that. My goal is simple - to have dockerized targets only for "base" supported version, which is 8.2 atm. This is needed e.g. for those who don't have 8.2 installed locally (like me) |
|
I am just pointing out it didn't use to be like that hence the conventions, because we didn't want that if we add I agree with the simplification though, IMO if you hit an issue with a specific version, it shouldn't be hard to adjust the PHP docker image used locally to run the same command as the makefile, or even change the makefile temporarily |
I think it's fine to update the test, the test already had a special case handling for autoreview anyway |
My goal is to update
CONTRIBUTION.mdguide to explain how Infection should be developed and checked/tested for contributors, because this file is outdated.During analyzing it, I found that our makefile docker commands are broken, so I want to make them work, at least the most useful ones:
make autoreview-dockermake test-unit-dockermake cs-docker