-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
chore: Northstar screener should read from screenerStates.json #24848
chore: Northstar screener should read from screenerStates.json #24848
Conversation
Screener is now separated into two workflows for secrets encapsulation, the code to trigger the screener run is actually run on the master branch. The current northstar screener states are generated directly before running, this means that any changes to N* screener tests will never result in updated screenshots Update the `screener:build` gulp command to write all states to a json file and updeates the `screener:runner` gulp tasks to read states from the json file. Since the entire `docs/dist` artifact is uploaded, there should be no changes needed for the pipeline
@@ -24,7 +24,7 @@ function getCurrentHash() { | |||
* @param {string} options.sourceBranchName | |||
* @param {string} options.deployUrl | |||
* @param {string} options.targetBranch | |||
* @returns | |||
* @returns {import('@fluentui/scripts/screener/screener.types').ScreenerRunnerConfig} |
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.
improve typings in screener.config.js files
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 deep import is bit unfortunate. can we expose scripts/screener
api from barrel file ? this whole directory would be move do to separate package later on.
Note: not needed for this PR but as a follow-up
structure: boolean; | ||
layout: boolean; | ||
style: boolean; | ||
content: boolean; | ||
minLayoutPosition: number; // Optional threshold for Layout changes. Defaults to 4 pixels. | ||
minLayoutDimension: number; // Optional threshold for Layout changes. Defaults to 10 pixels. | ||
minShiftGraphic: number; // Optional threshold for pixel shifts in graphics. | ||
compareSVGDOM: number; // Pass if SVG DOM is the same. Defaults to false. | ||
compareSVGDOM: boolean; // Pass if SVG DOM is the same. Defaults to false. |
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 was always typed incorrectly before applying the types to the screener.config.js
}; | ||
|
||
states: ScreenerState[]; | ||
|
||
alwaysAcceptBaseBranch: boolean; | ||
baseBranch: string; | ||
commit: string; | ||
commit?: string; |
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 should be optional because master builds do not require a commit
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 ebde122:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 17278782ca2c1d4051389cf8741224cde6672e88 (build) |
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 1290 | 1300 | 5000 | |
Button | mount | 924 | 925 | 5000 | |
FluentProvider | mount | 1461 | 1496 | 5000 | |
FluentProviderWithTheme | mount | 580 | 570 | 10 | |
FluentProviderWithTheme | virtual-rerender | 533 | 545 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 575 | 576 | 10 | |
MakeStyles | mount | 1964 | 1970 | 50000 | |
SpinButton | mount | 2353 | 2333 | 5000 |
📊 Bundle size reportUnchanged fixtures
|
Perf Analysis (
|
Scenario | Current PR Ticks | Baseline Ticks | Ratio |
---|---|---|---|
CardMinimalPerf.default | 648 | 573 | 1.13:1 |
AttachmentMinimalPerf.default | 171 | 155 | 1.1:1 |
ButtonSlotsPerf.default | 601 | 544 | 1.1:1 |
AvatarMinimalPerf.default | 216 | 198 | 1.09:1 |
RefMinimalPerf.default | 228 | 212 | 1.08:1 |
AlertMinimalPerf.default | 290 | 272 | 1.07:1 |
ReactionMinimalPerf.default | 423 | 397 | 1.07:1 |
StatusMinimalPerf.default | 766 | 717 | 1.07:1 |
LoaderMinimalPerf.default | 711 | 673 | 1.06:1 |
ImageMinimalPerf.default | 435 | 415 | 1.05:1 |
RadioGroupMinimalPerf.default | 501 | 475 | 1.05:1 |
LabelMinimalPerf.default | 414 | 397 | 1.04:1 |
TableMinimalPerf.default | 426 | 409 | 1.04:1 |
BoxMinimalPerf.default | 364 | 352 | 1.03:1 |
ChatMinimalPerf.default | 793 | 773 | 1.03:1 |
FormMinimalPerf.default | 442 | 428 | 1.03:1 |
HeaderMinimalPerf.default | 386 | 373 | 1.03:1 |
ListWith60ListItems.default | 658 | 639 | 1.03:1 |
TreeMinimalPerf.default | 891 | 867 | 1.03:1 |
DatepickerMinimalPerf.default | 6065 | 5934 | 1.02:1 |
DropdownManyItemsPerf.default | 752 | 735 | 1.02:1 |
DropdownMinimalPerf.default | 2799 | 2757 | 1.02:1 |
ItemLayoutMinimalPerf.default | 1284 | 1264 | 1.02:1 |
ListNestedPerf.default | 618 | 604 | 1.02:1 |
MenuMinimalPerf.default | 919 | 905 | 1.02:1 |
RosterPerf.default | 2336 | 2280 | 1.02:1 |
PopupMinimalPerf.default | 658 | 642 | 1.02:1 |
CustomToolbarPrototype.default | 2748 | 2702 | 1.02:1 |
ButtonMinimalPerf.default | 181 | 179 | 1.01:1 |
ChatDuplicateMessagesPerf.default | 303 | 299 | 1.01:1 |
EmbedMinimalPerf.default | 3986 | 3945 | 1.01:1 |
FlexMinimalPerf.default | 297 | 295 | 1.01:1 |
ListCommonPerf.default | 702 | 696 | 1.01:1 |
MenuButtonMinimalPerf.default | 1828 | 1808 | 1.01:1 |
ProviderMinimalPerf.default | 400 | 397 | 1.01:1 |
SegmentMinimalPerf.default | 384 | 380 | 1.01:1 |
TableManyItemsPerf.default | 2136 | 2115 | 1.01:1 |
AttachmentSlotsPerf.default | 1169 | 1166 | 1:1 |
ButtonOverridesMissPerf.default | 1431 | 1436 | 1:1 |
HeaderSlotsPerf.default | 824 | 827 | 1:1 |
LayoutMinimalPerf.default | 380 | 380 | 1:1 |
ListMinimalPerf.default | 544 | 542 | 1:1 |
IconMinimalPerf.default | 697 | 694 | 1:1 |
TextMinimalPerf.default | 371 | 371 | 1:1 |
TreeWith60ListItems.default | 170 | 170 | 1:1 |
CheckboxMinimalPerf.default | 2197 | 2217 | 0.99:1 |
GridMinimalPerf.default | 364 | 368 | 0.99:1 |
PortalMinimalPerf.default | 167 | 168 | 0.99:1 |
ProviderMergeThemesPerf.default | 1255 | 1273 | 0.99:1 |
SkeletonMinimalPerf.default | 372 | 374 | 0.99:1 |
SliderMinimalPerf.default | 1683 | 1697 | 0.99:1 |
ToolbarMinimalPerf.default | 996 | 1008 | 0.99:1 |
VideoMinimalPerf.default | 766 | 775 | 0.99:1 |
AnimationMinimalPerf.default | 547 | 559 | 0.98:1 |
DividerMinimalPerf.default | 373 | 381 | 0.98:1 |
InputMinimalPerf.default | 1180 | 1207 | 0.98:1 |
SplitButtonMinimalPerf.default | 4681 | 4774 | 0.98:1 |
TooltipMinimalPerf.default | 2437 | 2485 | 0.98:1 |
AccordionMinimalPerf.default | 143 | 148 | 0.97:1 |
CarouselMinimalPerf.default | 486 | 499 | 0.97:1 |
TextAreaMinimalPerf.default | 522 | 536 | 0.97:1 |
ChatWithPopoverPerf.default | 389 | 409 | 0.95:1 |
DialogMinimalPerf.default | 805 | 845 | 0.95:1 |
@@ -0,0 +1,21 @@ | |||
import { task, series } from 'gulp'; |
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.
Split up screener.ts
into vr-test.ts
and vr-build.ts
to better reflect the commands since they are actually used as vr:build
and vr:test
.
The two steps have nothing in common with each other either
|
||
// https://www.npmjs.com/package/screener-runner#testing-interactions | ||
steps: getScreenerSteps(pageUrl, `${exampleDir}/${exampleNameWithoutExtension}.steps`), | ||
export default function getScreenerStates() { |
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 file used to require all of northstar, refactored this to be a factory to only require northstar when needed
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.
suggestion: can we stop using/introducing new default exports ? not explicit API contracts / subpar DX ....
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.
the logic for particular library should not live here as it introduces tight coupling. I understand this PR purpose is to quick fix current behaviours, but would be great if we can come up with long term solution.
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
BaseButton | mount | 1460 | 1447 | 5000 | |
Breadcrumb | mount | 3500 | 3575 | 1000 | |
Checkbox | mount | 3176 | 3198 | 5000 | |
CheckboxBase | mount | 2856 | 2804 | 5000 | |
ChoiceGroup | mount | 5408 | 5184 | 5000 | |
ComboBox | mount | 1495 | 1511 | 1000 | |
CommandBar | mount | 11661 | 11584 | 1000 | |
ContextualMenu | mount | 13392 | 13875 | 1000 | |
DefaultButton | mount | 1643 | 1620 | 5000 | |
DetailsRow | mount | 4423 | 4273 | 5000 | |
DetailsRowFast | mount | 4265 | 4259 | 5000 | |
DetailsRowNoStyles | mount | 4163 | 4258 | 5000 | |
Dialog | mount | 3686 | 3652 | 1000 | |
DocumentCardTitle | mount | 713 | 699 | 1000 | |
Dropdown | mount | 3846 | 3926 | 5000 | |
FocusTrapZone | mount | 2458 | 2443 | 5000 | |
FocusZone | mount | 2318 | 2410 | 5000 | |
GroupedList | mount | 63763 | 71930 | 2 | |
GroupedList | virtual-rerender | 29755 | 30235 | 2 | |
GroupedList | virtual-rerender-with-unmount | 110747 | 110896 | 2 | |
GroupedListV2 | mount | 647 | 661 | 2 | |
GroupedListV2 | virtual-rerender | 627 | 636 | 2 | |
GroupedListV2 | virtual-rerender-with-unmount | 674 | 692 | 2 | |
IconButton | mount | 2340 | 2334 | 5000 | |
Label | mount | 864 | 876 | 5000 | |
Layer | mount | 5222 | 5136 | 5000 | |
Link | mount | 1013 | 1030 | 5000 | |
MenuButton | mount | 2043 | 2018 | 5000 | |
MessageBar | mount | 2817 | 2787 | 5000 | |
Nav | mount | 3922 | 3997 | 1000 | |
OverflowSet | mount | 1682 | 1678 | 5000 | |
Panel | mount | 2979 | 3049 | 1000 | |
Persona | mount | 1512 | 1550 | 1000 | |
Pivot | mount | 1976 | 2017 | 1000 | |
PrimaryButton | mount | 1823 | 1866 | 5000 | |
Rating | mount | 8477 | 8507 | 5000 | |
SearchBox | mount | 1868 | 1830 | 5000 | |
Shimmer | mount | 3498 | 3538 | 5000 | |
Slider | mount | 2535 | 2503 | 5000 | |
SpinButton | mount | 5595 | 5544 | 5000 | |
Spinner | mount | 978 | 960 | 5000 | |
SplitButton | mount | 3837 | 3710 | 5000 | |
Stack | mount | 1060 | 1044 | 5000 | |
StackWithIntrinsicChildren | mount | 2787 | 2787 | 5000 | |
StackWithTextChildren | mount | 5828 | 5902 | 5000 | |
SwatchColorPicker | mount | 12797 | 12589 | 5000 | |
TagPicker | mount | 3125 | 3206 | 5000 | |
TeachingBubble | mount | 104258 | 102468 | 5000 | |
Text | mount | 987 | 960 | 5000 | |
TextField | mount | 1901 | 1918 | 5000 | |
ThemeProvider | mount | 1852 | 1876 | 5000 | |
ThemeProvider | virtual-rerender | 1323 | 1270 | 5000 | |
ThemeProvider | virtual-rerender-with-unmount | 2607 | 2596 | 5000 | |
Toggle | mount | 1342 | 1309 | 5000 | |
buttonNative | mount | 660 | 669 | 5000 |
@@ -24,7 +24,7 @@ function getCurrentHash() { | |||
* @param {string} options.sourceBranchName | |||
* @param {string} options.deployUrl | |||
* @param {string} options.targetBranch | |||
* @returns | |||
* @returns {import('@fluentui/scripts/screener/screener.types').ScreenerRunnerConfig} |
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 deep import is bit unfortunate. can we expose scripts/screener
api from barrel file ? this whole directory would be move do to separate package later on.
Note: not needed for this PR but as a follow-up
import fs from 'fs'; | ||
|
||
import config from '../../config'; | ||
import getScreenerStates from '../../screener/screener.states'; |
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.
same public api chore like in former comment
|
||
// https://www.npmjs.com/package/screener-runner#testing-interactions | ||
steps: getScreenerSteps(pageUrl, `${exampleDir}/${exampleNameWithoutExtension}.steps`), | ||
export default function getScreenerStates() { |
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.
suggestion: can we stop using/introducing new default exports ? not explicit API contracts / subpar DX ....
|
||
// https://www.npmjs.com/package/screener-runner#testing-interactions | ||
steps: getScreenerSteps(pageUrl, `${exampleDir}/${exampleNameWithoutExtension}.steps`), | ||
export default function getScreenerStates() { |
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.
the logic for particular library should not live here as it introduces tight coupling. I understand this PR purpose is to quick fix current behaviours, but would be great if we can come up with long term solution.
* master: (28 commits) fix: use trigger prop for aria-haspopup (microsoft#24794) chore(react-dialog): scaffold DialogContent component (microsoft#24844) chore: Northstar screener should read from screenerStates.json (microsoft#24848) applying package updates (web components) Standardize focus treatment (microsoft#24771) Divider - allow default prop override (microsoft#24840) GroupedList: fix virtualization (unstable preview) (microsoft#24460) fix: Add explicit children prop to TeachingBubble to support React 18 (microsoft#24823) feat: Adds `visible` prop to `TableCellActions` (microsoft#24831) [Northstar][Dropdown] Fix styling mutation when merging themes (microsoft#24787) fix: export `tableCellActionsClassNames` from unstable (microsoft#24830) bugfix(react-dialog): Adds color style to DialogSurface (microsoft#24832) applying package updates Prevent group toggling from selecting the whole group (microsoft#24822) feat(react-textarea): Add shadow variant of filled appearance (microsoft#24512) applying package updates Adding lib-commonjs top-level entries to exports map (microsoft#24792) Created shim packages (microsoft#24780) feat(react-menu): replace keydown handlers by useARIAButtonShorthand on MenuItem (microsoft#24738) fix: update version mismatches triggered by v9 release (microsoft#24812) ...
Screener is now separated into two workflows for secrets encapsulation, the code to trigger the screener run is actually run on the master branch.
Current Behavior
The current northstar screener states are generated directly before running, this means that any changes to N* screener tests in a PR will never result in updated screenshots
New Behavior
Update the
screener:build
gulp command to write all states to a json file and updeates thescreener:runner
gulp tasks to read states from the json file as a result of the build.Since the entire
docs/dist
artifact is uploaded, there should be no changes needed for the pipelineRelated Issue(s)
Fixes #24842