-
Notifications
You must be signed in to change notification settings - Fork 483
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
POC: Speed optimize class-loading for levels tests #2916
Merged
Merged
Changes from 3 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
57bcbd2
Speed optimize class-loading for levels tests
staabm 9d04fe6
Prevent unnecessary IO in ComposerJsonAndInstalledJsonSourceLocatorMaker
staabm 11ffaa8
fix warnings
staabm 37e325c
Revert "fix warnings"
staabm 4eb6d67
Revert "Speed optimize class-loading for levels tests"
staabm 030b8c0
Implement parallelized test levels via github actions matrix
staabm b025c05
separate test-levels-matrix job
staabm 45b12b0
fix deprecation
staabm 36f26cf
fix typo
staabm 9adf76d
backslash escapeing
staabm 947ddb7
review feedback
staabm 6185833
typo
staabm 5fe67ce
use list-tests-xml
staabm 6dc056d
simplify
staabm 0bcd114
Update tests.yml
staabm b77b48a
use escapeshellarg()
staabm f5aeead
added back escaping
staabm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
diff --git a/composer.json b/composer.json | ||
index 6dde20b5f..7ea244ee1 100644 | ||
--- a/composer.json | ||
+++ b/composer.json | ||
@@ -116,8 +116,11 @@ | ||
] | ||
}, | ||
"classmap": [ | ||
- "tests/e2e", | ||
- "tests/PHPStan" | ||
+ "tests/PHPStan/Rules/Methods/data/returnTypes.php", | ||
+ "tests/PHPStan/Rules/Methods/data/returnTypes-defined.php", | ||
+ "tests/PHPStan/Rules/Properties/data/access-properties.php", | ||
+ "tests/PHPStan/Generics", | ||
+ "tests/PHPStan/Levels" | ||
] | ||
}, | ||
"minimum-stability": "dev", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 understand the intention, but I don't love it. It's going to be really hard to maintain this list and debug problems as time goes on.
I'd be more interested in parallelizing running the tests. Basically each "topic" in LevelsTestCase could have its own GitHub Actions job.
It's not exactly the same but the idea is here: https://rias.be/blog/running-phpunit-tests-in-parallel-using-github-actions
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 have adjusted the PR. It now filters the existing tests based on class-name and builds a dynamic matrix with it.
this means we run now 40 tests in parallel (which each takes ~1m 15s) instead of one large job which runs ~10 minutes
the
tests.yml
github action workflow for this PR finished in 4m 15s, while it takes ~10m 30s before this PR 🚀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 very similar to what i did in psalm years ago:
vimeo/psalm#4985
But in psalm, each job also runs test in parallel.
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.
@bendavies the tests jobs - even before this PR - are already highly parallelized - within the github action jobs and also across several jobs.
This PR splits up one very slow part of the pre-existing tests into even more jobs because these were particular slow
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.
👍 apologies.
i couldn't see (still can't) where tests are split across jobs.
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.
no worries.
see the screen in my above comment. there you can see the "levels test" matrix, with several jobs.
if you compare to other existing PR, this step is just a single job.
the PR implements this by inspecting the test-suite level-tests test-cases. Because of the used dataprovider, this means the
testLevels
method represents several test-cases. each of these test-cases is run in a separate github action job, because I feed this list of test-cases as a json array into the "test-levels" github action job matrix.