-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Better primer tests (faster, less duplication, more diverse) #5359
Comments
* Add changelog and warning about unstable API in testutil * Add primer tests, (running pylint on external libs during tests) In order to anticipate crash/fatal messages, false positives are harder to anticipate. Follow-up will be #5359 and later on #5364 Add '__tracebackhide__ = True' so the traceback is manageable Co-authored-by: Daniël van Noord <[email protected]>
@Pierre-Sassoulas Just something I thought of: |
We definitely need to cache everything we can too. (Setting the hash of the repository we lint would help). |
@DanielNoord AFAIK public repos are only limited in the number of concurrent job runners, not the actual time. |
One suggestion for something I saw recently. If the primer tests are moved to a new workflow, you could also add This is how Home Assistant does it: Home-Assistant -> ci.yaml, although it probably isn't necessary to cancel all other jobs as they are quite fast and even partial feedback could be useful. |
Huge first step was done in #5425 by @DanielNoord we still can do:
|
Moving to 2.14 as we have quite a lot to do already for 2.13. |
With the work on the new primer most of the TODOs in this issue have become redundant. I think there are a couple more things I would like to do before closing this:
The last point is mainly because syntax highlighting for |
Once again, terrific work @DanielNoord! |
For point 2, I'd like to get 2/3 namespace packages as well. Preferably one that uses and one that doesn't use |
google packages are a good one. especially google.cloud ones as they have two levels of namespace nesting which is uncommon. Both google is a namespace package and google.cloud is also namespace package. |
@hmc-cs-mdrissi are you talking about something in https://github.com/orgs/GoogleCloudPlatform/repositories?q=&type=all&language=python&sort= ? |
Thanks for all the work here @DanielNoord, much appreciated! It will make all our lives easier when working on a new feature or bug fix. Some question since I didn't follow the discussion closely.
|
No. This is something we should do, as we're running into issues with this with #6780. Should be fairly easy with some additional caching of environments.
It should be! We only disable
The full run was taking more than 45 minutes with
Oh huh. I thought using |
The new primer enables all extensions. There could be some molasses in there.
I doubt that's a big performance impact, but I'll still put together a little refactor; if anything, it would help with more intermediate feedback when using the tool locally. |
I just fired up the primer tool locally and encountered an infinite loop in astroid while linting |
Not sure it's all that useful to enable all other messages and extensions. At least for Home Assistant, we carefully decided what to and what not. to enable. I would recommend to stick with that, even if we might miss some things then. The only overwrites which makes sense IMO are
Yes. An example from pylint.
|
I don't think specific disables and enables matter that much. The primer only shows changes between So we can show that a warning that is disabled in configuration no longer shows up due to a PR fixing a false positive.
Ah, this should be fixed then! |
There are some frequently-disabled messages that are a little opinionated or lead to false positives. I think we still want primer results on those. So we can't just use the project's enable/disable list. I just noticed the old primer run was also enabling all extensions, so that shouldn't be it. I'll add Home Assistant back to the old primer and we can see what the run time is. |
There is a very interesting list of possible project that was done for benchmarks. |
Let's close this at some point. FINAL TODO FOR THIS ISSUE:
|
Makes sense! Do you want to open the PR? |
Sure @DanielNoord. It'll force me to take a closer look at the logic. I'll aim for next couple of days |
Spoiler, but: |
* Add the `coverage` package to the primer suite. Refs #5359 * Update tests/primer/packages_to_prime.json Co-authored-by: Pierre Sassoulas <[email protected]> * Add a fragment. * Remove unnecessary fragment. Co-authored-by: Pierre Sassoulas <[email protected]>
Current problem
Right now the primer tests take more than double the time of the next slower tests. Also the CI configuration is duplicated between primer for stdlib and primer for external tests. The choice of repository to check is also arbitrary.
Desired solution
primer
tests to own file, separate batches and concurrent runs #5425 > Burst theprimer-external
CI job into multiple jobs to cut down on CI run timeprimer
tests to own file, separate batches and concurrent runs #5425 > Remove the duplication in the GitHub action configuration and moveprimer
to its own workflow fileprimer
tests to own file, separate batches and concurrent runs #5425 > Only run when something changes inpylint
internals orprimer
testutilsAdditional context
#5173
The text was updated successfully, but these errors were encountered: