-   Notifications  
You must be signed in to change notification settings  - Fork 1.3k
 
Add Tests to measure activation times of extension #1813
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
Add Tests to measure activation times of extension #1813
Conversation
| console.log(`Analysis Engine Loaded in ${analysisEngineActivationAvgTime}ms`); | ||
|   |  ||
| expect(devActivationAvgTime - releaseActivationAvgTime).to.be.lessThan(AllowedIncreaaseInActivationDelayInMS, 'Activation times have increased above allowed threshold.'); | ||
| expect(devActivationAvgTime).to.be.lessThan(1000, 'Activation time has exceed 1s.'); | 
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.
With analysis engine may be a bit more than a second, depends on the machine/VM.
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.
Agreed, will remove that.
| import { commands, extensions } from 'vscode'; | ||
| import { StopWatch } from '../../client/common/stopWatch'; | ||
|   |  ||
| const AllowedIncreaaseInActivationDelayInMS = 50; | 
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.
Typo in name.
| For Extension activation times, we load both extensions x times, and re-load the window y times in each x load. | ||
| I.e. capture averages by giving the extensions sufficient time to warm up. | ||
| This block of code merely launches the tests by using either the dev or release version of the extension, | ||
| and spawning the tests (mimic user starting tests from command line), this way we can run tests multiple times. | 
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.
We can also set a maximum perf number to help deal with skew, e.g. we never want this to average above 500 ms and we fail if that occurs. This prevents drift by saying we allow up to a 10% shift by being absolute instead of relative. It would also potentially negate needing to do a comparison against a current version.
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.
Done
 Codecov Report
 @@ Coverage Diff @@ ## master #1813 +/- ## ========================================== - Coverage 74.37% 74.32% -0.06%  ========================================== Files 282 282 Lines 13218 13191 -27 Branches 2375 2346 -29 ========================================== - Hits 9831 9804 -27  Misses 3256 3256 Partials 131 131
 Continue to review full report at Codecov. 
  |  
1927481 to 3707b2c   Compare   c85a3cd to f05e27a   Compare   
Fixes #932
This pull request: