-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Take screenshot when drive fails to start app or test #96828
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
Conversation
0c7c5d0 to
c77271d
Compare
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.
Most of this patch is whitespace changes.
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 catch is the new part.
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.
Create a DriveCommand to test instead of calling directly from tests.
c77271d to
e21477a
Compare
| ); | ||
| if (testResult != 0 && screenshot != null) { | ||
| await takeScreenshot(device, screenshot, _fileSystem, _logger, _fsUtils); | ||
| if (boolArg('keep-app-running') ?? (argResults['use-existing-app'] != null)) { |
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.
If the code here between 292 and 302 throws, you could get two screenshots, one from the call on 289 and another from the one in the catch. Is that intentional?
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're right. Worse, if testResult fails which would happen often enough, it will take two screenshots, one from line 289, then another on catching the toolExit. Let me fix that up.
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.
Fixed. Also added a test.
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.
Oh right, the screenshot should be taken after the drive test failure but before the app is stopped. Created #96973 to reinstate this behavior.
Help debugging issues like #96401 by taking a screenshot of the device during
drivewhen the app fails to start, or testing otherwise fails.drive --screenshotintroduced in #78822.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.