Skip to content

test(eslint-plugin): split up naming-convention #4599

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

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Feb 27, 2022

PR Checklist

Overview

Splits out the dynamically generated tests from naming-convention.test.ts into their own test case files. This lets Jest run them in parallel. There should be no changes to test logic.

Performance runs

  • Execution: hyperfine -p 'yarn jest --clearCache' --show-output within packages/eslint-plugin. Terminal was in focus and no actions taken on open programs during test runs.
  • Hardware: Surface Laptop 4, 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz.
  • Software: WSL 2.0 in an Ubuntu drive via a VS Code terminal.
Command main naming-convention-split (old - new) / old x 100%
yarn jest 206.237 s ± 3.049 s 174.888 s ± 0.958 s 15% Faster
yarn jest naming-convention 120.003 s ± 1.357 s 60.726 s ± 0.911 s 49% Faster
Raw data

yarn jest on main (reusing time from another PR):

Time (mean ± σ):     206.237 s ±  3.049 s    [User: 1156.814 s, System: 40.173 s]
Range (min … max):   201.867 s … 212.914 s    25 runs

yarn jest on naming-convention-split:

Time (mean ± σ):     174.888 s ±  0.958 s    [User: 1290.055 s, System: 47.218 s]
Range (min … max):   173.611 s … 176.374 s    10 runs

yarn jest naming-convention on main:

Time (mean ± σ):     120.003 s ±  1.357 s    [User: 133.107 s, System: 2.962 s]
Range (min … max):   118.722 s … 122.866 s    10 runs

yarn jest naming-convention on naming-convention-split:

Time (mean ± σ):     60.726 s ±  0.911 s    [User: 436.456 s, System: 13.817 s]
Range (min … max):   59.279 s … 62.716 s    10 runs

@nx-cloud
Copy link

nx-cloud bot commented Feb 27, 2022

☁️ Nx Cloud Report

CI ran the following commands for commit e866d1a. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 48 targets

Sent with 💌 from NxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@netlify
Copy link

netlify bot commented Feb 27, 2022

✔️ Deploy Preview for typescript-eslint ready!

🔨 Explore the source changes: e866d1a

🔍 Inspect the deploy log: https://app.netlify.com/sites/typescript-eslint/deploys/621e4ab2817ed80008162380

😎 Browse the preview: https://deploy-preview-4599--typescript-eslint.netlify.app

@codecov
Copy link

codecov bot commented Feb 27, 2022

Codecov Report

Merging #4599 (e866d1a) into main (fabfc2b) will increase coverage by 1.99%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #4599      +/-   ##
==========================================
+ Coverage   92.41%   94.41%   +1.99%     
==========================================
  Files         350      151     -199     
  Lines       12059     8229    -3830     
  Branches     3430     2623     -807     
==========================================
- Hits        11144     7769    -3375     
+ Misses        642      262     -380     
+ Partials      273      198      -75     
Flag Coverage Δ
unittest 94.41% <100.00%> (+1.99%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...gin/src/rules/naming-convention-utils/validator.ts 95.54% <100.00%> (+0.02%) ⬆️
packages/scope-manager/src/scope/ClassScope.ts
packages/eslint-plugin-tslint/src/custom-linter.ts
packages/visitor-keys/src/visitor-keys.ts
...ges/scope-manager/src/definition/DefinitionType.ts
...pt-estree/src/ts-estree/estree-to-ts-node-types.ts
...gin-internal/src/rules/no-poorly-typed-ts-props.ts
packages/scope-manager/src/lib/esnext.ts
packages/scope-manager/src/lib/es2021.ts
packages/typescript-estree/src/convert-comments.ts
... and 190 more

@bradzacher bradzacher added the tests anything to do with testing label Mar 1, 2022
@bradzacher bradzacher changed the title test: split up naming-convention test(eslint-plugin): split up naming-convention Mar 1, 2022
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review March 1, 2022 16:33
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

thanks for going through to clean this up!
shaving off a few minutes is a big win!

@JoshuaKGoldberg JoshuaKGoldberg merged commit 699ef48 into typescript-eslint:main Mar 1, 2022
@JoshuaKGoldberg JoshuaKGoldberg deleted the naming-convention-split branch March 1, 2022 18:15
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tests anything to do with testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

naming-convention.test.ts takes a very long time to run in series
2 participants