-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
tests(smoke): convert core tests to single-expectations format #12819
Conversation
@@ -0,0 +1,42 @@ | |||
/** |
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.
moved from dbw-expectations.js
as dbw is kind of its own thing and issues are worthy of their own smoke tests
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.
names mostly seem fine to me! 🎉
thanks for trudging through this super mechanical drudgery :D
/** | ||
* @type {Smokehouse.ExpectedRunnerResult} | ||
*/ | ||
const ricShort = { |
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.
idleCallbackShort?
ric
lowercase is harder to remember what it is than rIC
, probably should've done that with the ric-shim
filename originally 😊
/** | ||
* @type {Smokehouse.ExpectedRunnerResult} | ||
*/ | ||
const ricLong = { |
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
// TODO: what's the describable difference between this and the above? Also, better names. | ||
/** | ||
* @type {Smokehouse.ExpectedRunnerResult} | ||
* Expected Lighthouse audit values for a site with a client-side redirect (2s + 5s), | ||
* paints at 2s, then a server-side redirect (1s). | ||
*/ | ||
const clientPaintServer2 = { |
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.
// TODO: what's the describable difference between this and the above? Also, better names. | |
/** | |
* @type {Smokehouse.ExpectedRunnerResult} | |
* Expected Lighthouse audit values for a site with a client-side redirect (2s + 5s), | |
* paints at 2s, then a server-side redirect (1s). | |
*/ | |
const clientPaintServer2 = { | |
/** | |
* @type {Smokehouse.ExpectedRunnerResult} | |
* Expected Lighthouse audit values for a site with a client-side redirect (2s + 5s), | |
* paints at 2s, then a server-side redirect (1s), followed by a history.pushState to an unrelated URL. | |
*/ | |
const historyPushState = { |
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.
NOTE: will require a few other historyPushState
renames as well
config: require('./seo/seo-config.js'), | ||
}, { | ||
id: 'offline', | ||
expectations: require('./offline-local/offline-expectations.js'), | ||
id: 'seo-tap-target', |
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.
id: 'seo-tap-target', | |
id: 'seo-tap-targets', |
expectations: redirects.singleClient, | ||
config: require('./redirects/redirects-config.js'), | ||
}, { | ||
id: 'redirects-client-paint-server-2', |
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.
id: 'redirects-client-paint-server-2', | |
id: 'redirects-history-pushstate', |
yay death to pwa2 and pwa3! :)
yeah. i think doing that allows us to fix the file/folder structure of test-definitions which i'm really excited about. i think it makes sense as a follow up PR; the scope of this one is great.
eh, nah.
yeah lets leave it alone. shorter is better, so lets only elongate when we have to. i'm happy with these slugs (except for csp-base which should be csp-basics or something) woo! |
7cad115
to
4de7358
Compare
SG. We'll go with these (except for the CSP ones, @adamraine is about to take a look) but we have a second chance to discuss them in the next PR. |
requestedUrl: 'http://localhost:10200/csp.html', | ||
finalUrl: 'http://localhost:10200/csp.html', | ||
audits: {}, | ||
const base = { |
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.
const base = { | |
const noCsp = { |
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.
Alternative: allowAll
/** | ||
* @type {Smokehouse.ExpectedRunnerResult} | ||
*/ | ||
const exceptInline = { |
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.
const exceptInline = { | |
const blockAllM91 = { |
This CSP blocks everything, with a special exception for one inline script that has a source map.
We will probably remove this once M91 hits stable, so I would add the version suffix to this one.
/** | ||
* @type {Smokehouse.ExpectedRunnerResult} | ||
*/ | ||
const exceptInlineM92 = { |
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.
const exceptInlineM92 = { | |
const blockAll = { |
looks great. Thanks! |
id: 'issues-mixed-content', | ||
expectations: require('./issues/mixed-content.js'), | ||
}, { | ||
id: 'redirects-single-server', |
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.
how about going one step further and moving this entire object to what expectations.js
exports? there is overhead in separating "this is what the test does" and "this is the id we give it and the config it uses"
then core-tests.js
is just bringing it all together as an array.
(separate PR would be best)
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.
Yeah, it's a little silly to have filenames for separate files and then IDs for them in a different file. That'll be in the above-mentioned (but undescribed, sorry) next PR.
part 2/2 of #11950. PR currently based on top of #12818
This splits up our core tests so there's a separate testDefn and ID for every smoke expectation. The splitting up is done here and tentative IDs are chosen, but I wanted some bike shedding input before I tried to put everything in the same format.
For reviewers:
core-tests.js
, as that's where the test IDs are set.(I'll be honest: there are a lot of these, and about halfway through this I stopped trying very hard with the names if the tests weren't super obvious how they were different from each other. I'm looking at you
redirects
andcsp
:P Please suggest better IDs than I have here)For bikeshedders:
errors
becomeserrors-infinite-loop
,errors-expired-ssl
etc. Handy for running with justyarn smoke errors
, but:category-specific
naming format?oopif
tests, so it's still just calledoopif
. Is that ok or should we preemptively call itoopif-requests
just in case one day we haveoopif-some-other-thing
?