-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[test] Add visual regression tests #1081
[test] Add visual regression tests #1081
Conversation
@@ -30,12 +30,17 @@ const MAX_CIRCLE_CI_CONCURRENCY = 83; | |||
module.exports = function setKarmaConfig(config) { | |||
const baseConfig = { | |||
basePath: '../', | |||
browsers: ['ChromeHeadlessNoSandbox'], | |||
browsers: ['chromeHeadless'], |
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.
?
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.
It's an arbitrary name. I have replicated the name we give in the main repo.
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 names are relevant to the CLI. You can do yarn test:karma --browsers browserNameA,browserNameB
.
So the longer the name, the more you have to type in your terminal if you just want to test a subset of browsers. Think of the diff as
- yarn test:karma --browsers ChromeHeadlessNoSandbox
+ yarn test:karma --browsers chromeHeadless
And since we don't have a chromeHeadlessSandbox
I don't see why we need the NoSandbox
qualifier in the first place. I haven't found the information whether we run with or without a sandbox useful.
2b5836b
to
2680307
Compare
@mui-org/x I have pushed a few fixes. Let me know if it's OK to move forward |
client: { | ||
mocha: { | ||
// Some BrowserStack browsers can be slow. | ||
timeout: (process.env.CIRCLECI === 'true' ? 4 : 2) * 1000, |
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.
"test:regressions:dev": "concurrently \"yarn test:regressions:build --watch\" \"yarn test:regressions:server\"", | ||
"test:regressions:run": "mocha --config test/regressions/.mocharc.js --delay 'test/regressions/**/*.test.js'", | ||
"test:regressions:server": "serve test/regressions", | ||
"test:argos": "node ./scripts/pushArgos.js", |
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.
Isn't there a way to reduce the number of scripts?
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.
You only have to run one script yarn test:regressions
locally. The others are here to help debug (when working on improving the regression generation tool.
@@ -33,12 +33,6 @@ const GlobalStyle = createGlobalStyle` | |||
width: 100%; | |||
} | |||
|
|||
.main-container { |
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.
why do we need to change that?
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.
I'm removing dead CSS code (at least, it's the objective)
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.
well I think it should be done in the demo move to the doc PR...
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.
I didn't intend to break the demo-app if it's what you assume. I can definitely revert.
What would be great for this one, is to have a run through and discuss what is happening |
@dtassone For more context, the latest iteration comes from mui/material-ui#23500 we were using vrtest before (setup in 2017). From a high-level perspective:
|
|
To some extent, yes. I have used
The viewport should be 1000x700px. |
I have an idea for the rendering issue with the data grid stories. I will try to apply the same global class name we use to set the dimensions of the gri in storybook. It should do it. |
Don't know if you do things different here but conceptually it's "wait for the demo to be rendered". How we determine when a demo is rendered is a bit more tricky but on the main repo we're just using React+events. We don't rely on any scheduling internals. |
Ok, I'm merging with a follow-up to get proper spacing with the stories |
Makes me think that we document the testing stack in https://github.com/mui-org/material-ui/blob/next/test/README.md#run-the-visual-regression-tests. |
I have noticed a few polish changes we can do in the core, I will apply them in a batch, when I have enough items on my list.
It's less than 2 minutes at 10 credits per minute. On Argos-CI, the cost is so small that isn't even worth mentioning. Chromatic pricing is $0.008/image, so $1 per build, x100 more expensive. Percy, Applitools are likely in the same order.
useData
can be seriously slow. I had to reduce the order of magnitude of the data generated to get the test in a reasonable run duration. We timeout after 2s in dev and 4s in the CI.What's left to do later: