stress-test: add cli application#24551
Conversation
Adds a CLI application for Stress Test that allows test configurations to easily be generated and run. This makes running large test suites as simple as a single command and eliminates the need for most npm scripts that previously existed for this package.
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit c2d3b20:
|
📊 Bundle size reportUnchanged fixtures
|
Asset size changesUnable to find bundle size details for Baseline commit: 28f5559 Possible causes
Recommendations
|
| // Make sure we run these in sequence. | ||
| // We don't want to run several tests at once as they | ||
| // may unduly influence each other. | ||
| const res = await execAsync(cmd); | ||
| console.log(res.stdout); |
There was a problem hiding this comment.
FYI: you can use execSync from @fluentui/scripts.
There was a problem hiding this comment.
What do I need to do to use @fluentui/scripts? I added the package to Stress Test's devDeps but I get
Error: Cannot find module '@fluentui/scripts'
When attempting to require() the module.
There was a problem hiding this comment.
FYI: you can use execSync from @fluentui/scripts.
note: I would recommend to not use that scripts abstraction, it's kinda shady and not proper part of public API of this package
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 1313 | 1297 | 5000 | |
| Button | mount | 877 | 955 | 5000 | |
| FluentProvider | mount | 1466 | 1536 | 5000 | |
| FluentProviderWithTheme | mount | 626 | 627 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 594 | 587 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 622 | 628 | 10 | |
| MakeStyles | mount | 1854 | 1930 | 50000 | |
| SpinButton | mount | 2457 | 2492 | 5000 |
Perf Analysis (
|
| Scenario | Current PR Ticks | Baseline Ticks | Ratio |
|---|---|---|---|
| AccordionMinimalPerf.default | 126 | 115 | 1.1:1 |
| AttachmentMinimalPerf.default | 123 | 116 | 1.06:1 |
| RefMinimalPerf.default | 186 | 176 | 1.06:1 |
| IconMinimalPerf.default | 558 | 527 | 1.06:1 |
| AvatarMinimalPerf.default | 157 | 150 | 1.05:1 |
| ChatDuplicateMessagesPerf.default | 250 | 237 | 1.05:1 |
| AnimationMinimalPerf.default | 442 | 427 | 1.04:1 |
| CarouselMinimalPerf.default | 390 | 375 | 1.04:1 |
| ListNestedPerf.default | 458 | 442 | 1.04:1 |
| LoaderMinimalPerf.default | 566 | 543 | 1.04:1 |
| SegmentMinimalPerf.default | 282 | 272 | 1.04:1 |
| ButtonSlotsPerf.default | 466 | 453 | 1.03:1 |
| ChatMinimalPerf.default | 600 | 580 | 1.03:1 |
| DividerMinimalPerf.default | 290 | 282 | 1.03:1 |
| GridMinimalPerf.default | 278 | 269 | 1.03:1 |
| ReactionMinimalPerf.default | 306 | 296 | 1.03:1 |
| TextMinimalPerf.default | 284 | 276 | 1.03:1 |
| ButtonMinimalPerf.default | 135 | 133 | 1.02:1 |
| DropdownManyItemsPerf.default | 549 | 539 | 1.02:1 |
| FlexMinimalPerf.default | 235 | 231 | 1.02:1 |
| FormMinimalPerf.default | 311 | 304 | 1.02:1 |
| HeaderMinimalPerf.default | 291 | 285 | 1.02:1 |
| ListMinimalPerf.default | 423 | 413 | 1.02:1 |
| PortalMinimalPerf.default | 141 | 138 | 1.02:1 |
| SliderMinimalPerf.default | 1336 | 1310 | 1.02:1 |
| TableManyItemsPerf.default | 1567 | 1535 | 1.02:1 |
| TooltipMinimalPerf.default | 1952 | 1922 | 1.02:1 |
| CheckboxMinimalPerf.default | 1737 | 1717 | 1.01:1 |
| DropdownMinimalPerf.default | 2253 | 2229 | 1.01:1 |
| ItemLayoutMinimalPerf.default | 967 | 955 | 1.01:1 |
| LabelMinimalPerf.default | 310 | 307 | 1.01:1 |
| MenuButtonMinimalPerf.default | 1413 | 1399 | 1.01:1 |
| PopupMinimalPerf.default | 526 | 522 | 1.01:1 |
| ProviderMinimalPerf.default | 332 | 330 | 1.01:1 |
| TableMinimalPerf.default | 326 | 322 | 1.01:1 |
| TreeMinimalPerf.default | 667 | 660 | 1.01:1 |
| TreeWith60ListItems.default | 127 | 126 | 1.01:1 |
| AttachmentSlotsPerf.default | 902 | 906 | 1:1 |
| BoxMinimalPerf.default | 274 | 275 | 1:1 |
| DialogMinimalPerf.default | 634 | 631 | 1:1 |
| HeaderSlotsPerf.default | 622 | 625 | 1:1 |
| InputMinimalPerf.default | 940 | 936 | 1:1 |
| ListWith60ListItems.default | 509 | 507 | 1:1 |
| MenuMinimalPerf.default | 702 | 701 | 1:1 |
| RosterPerf.default | 1768 | 1768 | 1:1 |
| ProviderMergeThemesPerf.default | 1050 | 1055 | 1:1 |
| SplitButtonMinimalPerf.default | 3624 | 3612 | 1:1 |
| CustomToolbarPrototype.default | 2231 | 2236 | 1:1 |
| VideoMinimalPerf.default | 585 | 584 | 1:1 |
| AlertMinimalPerf.default | 224 | 226 | 0.99:1 |
| ButtonOverridesMissPerf.default | 1089 | 1097 | 0.99:1 |
| EmbedMinimalPerf.default | 3028 | 3051 | 0.99:1 |
| ImageMinimalPerf.default | 315 | 318 | 0.99:1 |
| LayoutMinimalPerf.default | 286 | 288 | 0.99:1 |
| ListCommonPerf.default | 509 | 514 | 0.99:1 |
| ToolbarMinimalPerf.default | 754 | 758 | 0.99:1 |
| CardMinimalPerf.default | 431 | 442 | 0.98:1 |
| DatepickerMinimalPerf.default | 4685 | 4768 | 0.98:1 |
| SkeletonMinimalPerf.default | 277 | 284 | 0.98:1 |
| StatusMinimalPerf.default | 556 | 565 | 0.98:1 |
| RadioGroupMinimalPerf.default | 349 | 358 | 0.97:1 |
| TextAreaMinimalPerf.default | 369 | 381 | 0.97:1 |
| ChatWithPopoverPerf.default | 288 | 318 | 0.91:1 |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| BaseButton | mount | 760 | 770 | 5000 | |
| Breadcrumb | mount | 2462 | 2471 | 1000 | |
| Checkbox | mount | 2227 | 2236 | 5000 | |
| CheckboxBase | mount | 1942 | 1953 | 5000 | |
| ChoiceGroup | mount | 3959 | 3967 | 5000 | |
| ComboBox | mount | 836 | 818 | 1000 | |
| CommandBar | mount | 9144 | 9241 | 1000 | |
| ContextualMenu | mount | 11204 | 11049 | 1000 | |
| DefaultButton | mount | 964 | 960 | 5000 | |
| DetailsRow | mount | 3282 | 3262 | 5000 | |
| DetailsRowFast | mount | 3235 | 3258 | 5000 | |
| DetailsRowNoStyles | mount | 3133 | 3141 | 5000 | |
| Dialog | mount | 2651 | 2695 | 1000 | |
| DocumentCardTitle | mount | 140 | 152 | 1000 | |
| Dropdown | mount | 2825 | 2814 | 5000 | |
| FocusTrapZone | mount | 1629 | 1566 | 5000 | |
| FocusZone | mount | 1536 | 1542 | 5000 | |
| IconButton | mount | 1519 | 1492 | 5000 | |
| Label | mount | 301 | 289 | 5000 | |
| Layer | mount | 3811 | 3833 | 5000 | |
| Link | mount | 401 | 399 | 5000 | |
| MenuButton | mount | 1276 | 1251 | 5000 | |
| MessageBar | mount | 1885 | 1823 | 5000 | |
| Nav | mount | 2891 | 2867 | 1000 | |
| OverflowSet | mount | 937 | 942 | 5000 | |
| Panel | mount | 2092 | 2126 | 1000 | |
| Persona | mount | 845 | 850 | 1000 | |
| Pivot | mount | 1212 | 1219 | 1000 | |
| PrimaryButton | mount | 1108 | 1106 | 5000 | |
| Rating | mount | 6569 | 6599 | 5000 | |
| SearchBox | mount | 1095 | 1095 | 5000 | |
| Shimmer | mount | 2466 | 2480 | 5000 | |
| Slider | mount | 1674 | 1712 | 5000 | |
| SpinButton | mount | 4274 | 4289 | 5000 | |
| Spinner | mount | 356 | 375 | 5000 | |
| SplitButton | mount | 2678 | 2681 | 5000 | |
| Stack | mount | 428 | 441 | 5000 | |
| StackWithIntrinsicChildren | mount | 1929 | 1917 | 5000 | |
| StackWithTextChildren | mount | 4394 | 4365 | 5000 | |
| SwatchColorPicker | mount | 10019 | 10068 | 5000 | |
| TagPicker | mount | 2228 | 2204 | 5000 | |
| TeachingBubble | mount | 88427 | 93178 | 5000 | |
| Text | mount | 377 | 361 | 5000 | |
| TextField | mount | 1177 | 1191 | 5000 | |
| ThemeProvider | mount | 1112 | 1101 | 5000 | |
| ThemeProvider | virtual-rerender | 657 | 647 | 5000 | |
| ThemeProvider | virtual-rerender-with-unmount | 1741 | 1735 | 5000 | |
| Toggle | mount | 691 | 692 | 5000 | |
| buttonNative | mount | 113 | 108 | 5000 |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
| const { getBrowsers } = require('./getBrowsers'); | ||
|
|
||
| /** | ||
| * @typedef {Object.<string, import('yargs').Options} YargsOptions |
There was a problem hiding this comment.
It passed type-check but I see a missing > so I'm not sure how thoroughly the JSDocs are actually being checked. 🤔🤔🤔
I have a follow up PR where I need to do some more work with types so I'll investigate further there.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |

Current Behavior
Running Stress Test requires lots of npm scripts which are difficult to maintain and understand.
New Behavior
Stress Test is run by a CLI application that eliminates the need for most npm scripts (the remaining ones are focused on development).
Testing
yarnyarn workspace @fluentui/stress-test build:localyarn workspace @fluentui/stress-test stress-test run --scenario simple-stress --sample-size 2 --test-cases mount --browsers firefox --sizes xsRelated Issue(s)
Fixes #24309