jfx icon indicating copy to clipboard operation
jfx copied to clipboard

8328716: [TestBug] Screen capturing utility for failed tests

Open andy-goryachev-oracle opened this issue 1 year ago • 8 comments
trafficstars

Created a JUnit5-compatible utility to capture screenshots of failed headful tests. The idea is that a certain annotation can be added to an intermittently failing test or a test that fails on a certain platform to capture the screenshot for debugging:

@ExtendWith(ScreenCaptureTestWatcher.class)

Screenshots of the primary screen will be captured in PNG format, encoded to a Base64 string, and logged to stderr.

A special utility is then needed to extract the actual screenshot image from the log file (I am thinking of Monkey Tester, but it can be a standalone app or a script).

Questions

  • stdout or stderr?
  • do we need a separate decoder script or Monkey Tester is enough?
  • should it emit a valid JSON segment to be compatible with any log viewer applications that understand JSON? i.e. { screenshot:"...base64..." }

Example (partial) of the captured screenshot (in the dedicated viewer):

Screenshot 2024-03-22 at 12 45 41


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8328716: [TestBug] Screen capturing utility for failed tests (Enhancement - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1415/head:pull/1415
$ git checkout pull/1415

Update a local copy of the PR:
$ git checkout pull/1415
$ git pull https://git.openjdk.org/jfx.git pull/1415/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1415

View PR using the GUI difftool:
$ git pr show -t 1415

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1415.diff

andy-goryachev-oracle avatar Mar 21 '24 16:03 andy-goryachev-oracle

:wave: Welcome back angorya! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Mar 21 '24 16:03 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Mar 21 '24 16:03 openjdk[bot]

This needs some discussion before making it RFR. I have more questions than just the ones you listed about the design and implementation of such a feature.

kevinrushforth avatar Mar 21 '24 16:03 kevinrushforth

what are the questions?

andy-goryachev-oracle avatar Mar 21 '24 18:03 andy-goryachev-oracle

@andy-goryachev-oracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar May 16 '24 21:05 bridgekeeper[bot]

keep-alive; discuss-later;

andy-goryachev-oracle avatar May 16 '24 22:05 andy-goryachev-oracle

@andy-goryachev-oracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Jul 11 '24 23:07 bridgekeeper[bot]

keep-alive

andy-goryachev-oracle avatar Jul 11 '24 23:07 andy-goryachev-oracle

@andy-goryachev-oracle This pull request has been inactive for more than 8 weeks and will be automatically closed if another 8 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Sep 05 '24 23:09 bridgekeeper[bot]

has to wait for the next test sprint

andy-goryachev-oracle avatar Sep 23 '24 19:09 andy-goryachev-oracle