-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Generate test images at different output scales. #14545
Conversation
As for performance locally, |
test/driver.js
Outdated
this.canvas.height = viewport.height; | ||
// Restrict the test from creating a canvas that is too big. | ||
const MAX_CANVAS_PIXEL_DIMENSION = 4096; | ||
const largetDimension = Math.max(viewport.width, viewport.height); |
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.
Spelling-nit: largetDimension
-> largestDimension
.
test/driver.js
Outdated
MAX_CANVAS_PIXEL_DIMENSION | ||
) { | ||
const rescale = MAX_CANVAS_PIXEL_DIMENSION / largetDimension; | ||
viewport = page.getViewport({ |
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.
While it doesn't matter in this particular case, please note that you generally want to use viewport.clone({ ... })
instead to ensure that only the scale changes (while any other possible parameters stay the same).
test/test.js
Outdated
@@ -970,7 +974,7 @@ async function startBrowser(browserName, startUrl = "") { | |||
} | |||
|
|||
function startBrowsers(initSessionCallback, makeStartUrl = null) { | |||
const browserNames = options.noChrome ? ["firefox"] : ["firefox", "chrome"]; |
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 looks like a left-over from debugging, please revert this.
ea40f0e
to
2fcdc91
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.241.84.105:8877/c95d58933ce0345/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.193.163.58:8877/029a5f9097493fc/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/c95d58933ce0345/output.txt Total script time: 23.58 mins
Image differences available at: http://54.241.84.105:8877/c95d58933ce0345/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/029a5f9097493fc/output.txt Total script time: 25.46 mins
Image differences available at: http://54.193.163.58:8877/029a5f9097493fc/reftest-analyzer.html#web=eq.log |
Should note I expect a few changes because we will now be drawing the PDF's at a smaller size. Also, we may want to add a scale option the reftest analyzer. Looking at the results from a lowdpi device on a highdpi device makes the images pretty small. |
How does this relate to #14534? Does it supersede that one? |
Unless I'm misunderstanding something I don't believe that it does, since this PR is essentially just simulating differing |
@Snuffleupagus anything else you want me to address? |
/botio browsertest |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/e56abd3efa174a5/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/d890aedfb968fc6/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/e56abd3efa174a5/output.txt Total script time: 19.28 mins
Image differences available at: http://54.193.163.58:8877/e56abd3efa174a5/reftest-analyzer.html#web=eq.log |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/d890aedfb968fc6/output.txt Total script time: 20.04 mins
Image differences available at: http://54.241.84.105:8877/d890aedfb968fc6/reftest-analyzer.html#web=eq.log |
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.
r=me, with the one comment addressed; thank you!
test/resources/reftest-analyzer.js
Outdated
@@ -228,10 +228,15 @@ window.onload = function () { | |||
}); | |||
continue; | |||
} | |||
match = line.match(/^ {2}IMAGE[^:]*: (.*)$/); | |||
match = line.match(/^ {2}IMAGE[^:]*\((\d+)x(\d+)x(\d)+\): (.*)$/); |
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.
Is there a typo in the last digit group, i.e. did you mean the following instead?
match = line.match(/^ {2}IMAGE[^:]*\((\d+)x(\d+)x(\d)+\): (.*)$/); | |
match = line.match(/^ {2}IMAGE[^:]*\((\d+)x(\d+)x(\d+)\): (.*)$/); |
This will default to generating test images at the device pixel ratio of the machine the tests are created on unless the test explicitly defines and output scale using the `outputScale` setting. This makes the test look visually like they would on the machine they are running on. It also allows us to test different output scales.
2fcdc91
to
f5c3abb
Compare
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.241.84.105:8877/43574260aa2b895/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @brendandahl received. Current queue size: 0 Live output at: http://54.193.163.58:8877/bdebea6e9049d99/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/43574260aa2b895/output.txt Total script time: 23.89 mins
Image differences available at: http://54.241.84.105:8877/43574260aa2b895/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/bdebea6e9049d99/output.txt Total script time: 24.64 mins
Image differences available at: http://54.193.163.58:8877/bdebea6e9049d99/reftest-analyzer.html#web=eq.log |
/botio makeref |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/d4b53f2147810c2/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 1 Live output at: http://54.193.163.58:8877/a4ab951443760d3/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/d4b53f2147810c2/output.txt Total script time: 20.50 mins
|
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/a4ab951443760d3/output.txt Total script time: 60.00 mins
|
/botio-windows makeref |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/f5f6af7ce9c601e/output.txt |
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/f5f6af7ce9c601e/output.txt Total script time: 20.15 mins
|
This will default to generating test images at the device pixel
ratio of the machine the tests are created on unless the
test explicitly defines and output scale using the
outputScale
setting. This makes the test look visuallylike they would on the machine they are running on. It
also allows us to test different output scales.