New issue
Advanced search Search tips

Issue 856540 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Aug 1
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug


Participants' hotlists:
Hotlist-Tast


Sign in to add a comment

tast: Take screenshot on failure

Project Member Reported by nya@chromium.org, Jun 26 2018

Issue description

On test failures, screenshots are often useful to diagnose the problem. Let us take screenshots on test failures.

 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 1

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/1f2fa6a38c50a9008ac6d8addf0b73327a0fe7f5

commit 1f2fa6a38c50a9008ac6d8addf0b73327a0fe7f5
Author: Shuhei Takahashi <nya@chromium.org>
Date: Sun Jul 01 00:21:29 2018

screenshot: Add a tiny command to take a screenshot.

This is a simple command to take a screenshot in exactly the same
way as screenshot.py in autotest. This allows Tast to take
screenshots without dependency to autotest, and also is useful for
manual testing.

BUG= chromium:856540 
BUG= chromium:856541 
TEST=build and run on caroline

Change-Id: Ie6517fea8ccbecd3cde6af9e776dd24b6a71975d
Reviewed-on: https://chromium-review.googlesource.com/1107532
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[add] https://crrev.com/1f2fa6a38c50a9008ac6d8addf0b73327a0fe7f5/screenshot/screenshot.gyp
[add] https://crrev.com/1f2fa6a38c50a9008ac6d8addf0b73327a0fe7f5/screenshot/README.md
[modify] https://crrev.com/1f2fa6a38c50a9008ac6d8addf0b73327a0fe7f5/README.md
[add] https://crrev.com/1f2fa6a38c50a9008ac6d8addf0b73327a0fe7f5/screenshot/screenshot.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Jul 1

Blocking: 860375
Project Member

Comment 4 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/2b1256c19d9675480d7a2300b1391d7e370e1707

commit 2b1256c19d9675480d7a2300b1391d7e370e1707
Author: Shuhei Takahashi <nya@chromium.org>
Date: Tue Jul 17 09:26:15 2018

screenshot: Split to multiple files.

Preparing for upcoming enhancements. This should have no functional
change.

Mostly just moved the code to separate files. The only change is
introduction of Crtc class which encupsulates ScopedDrmModeCrtc and
base::File.

BUG= chromium:856540 
BUG= chromium:856541 
TEST=build and run
CQ-DEPEND=CL:1107532

Change-Id: I7314bb0c825e39ad62c6974a6f5f515ee8e76e4f
Reviewed-on: https://chromium-review.googlesource.com/1116207
Commit-Ready: Shuhei Takahashi <nya@chromium.org>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/png.h
[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/crtc.h
[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/capture.h
[modify] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/screenshot.gyp
[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/crtc.cc
[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/ptr_util.h
[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/main.cc
[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/capture.cc
[add] https://crrev.com/2b1256c19d9675480d7a2300b1391d7e370e1707/screenshot/png.cc
[delete] https://crrev.com/be206196f1258bedf0e4274815774e802012f338/screenshot/screenshot.cc

Project Member

Comment 5 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/d85ca2c44e35cef32cebcf5a4f464c8375164e0d

commit d85ca2c44e35cef32cebcf5a4f464c8375164e0d
Author: Shuhei Takahashi <nya@chromium.org>
Date: Tue Jul 17 09:26:15 2018

screenshot: Support specifying a source display.

--internal/--external/--crtc-id flags are added to control the
source display.

To distinguish CRTCs connected to internal/external connectors,
we now scan connectors first and find connected CRTCs.

Also, Crtc class now encapsulates connector/encoder/fb associated
with CRTC.

BUG= chromium:856540 
BUG= chromium:856541 
TEST=build and run
CQ-DEPEND=CL:1116207

Change-Id: I3265fa97bc8691fd03482061c792acf9acf2540a
Reviewed-on: https://chromium-review.googlesource.com/1116208
Commit-Ready: Shuhei Takahashi <nya@chromium.org>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/d85ca2c44e35cef32cebcf5a4f464c8375164e0d/screenshot/capture.cc
[modify] https://crrev.com/d85ca2c44e35cef32cebcf5a4f464c8375164e0d/screenshot/ptr_util.h
[modify] https://crrev.com/d85ca2c44e35cef32cebcf5a4f464c8375164e0d/screenshot/crtc.cc
[modify] https://crrev.com/d85ca2c44e35cef32cebcf5a4f464c8375164e0d/screenshot/crtc.h
[modify] https://crrev.com/d85ca2c44e35cef32cebcf5a4f464c8375164e0d/screenshot/main.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/2eef9d32d109c4eebb800b9f4f0223d0f097911e

commit 2eef9d32d109c4eebb800b9f4f0223d0f097911e
Author: Shuhei Takahashi <nya@chromium.org>
Date: Tue Jul 17 09:26:16 2018

screenshot: Support specifying subregion to capture.

This is far more efficient than cropping the saved PNG image since
we cap skip PNG compression.

BUG= chromium:856540 
BUG= chromium:856541 
TEST=build and run
CQ-DEPEND=CL:1116208

Change-Id: I2209b93706d89804b94b31d8095a0de502c2d56e
Reviewed-on: https://chromium-review.googlesource.com/1116619
Commit-Ready: Shuhei Takahashi <nya@chromium.org>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>

[modify] https://crrev.com/2eef9d32d109c4eebb800b9f4f0223d0f097911e/screenshot/capture.cc
[modify] https://crrev.com/2eef9d32d109c4eebb800b9f4f0223d0f097911e/screenshot/capture.h
[modify] https://crrev.com/2eef9d32d109c4eebb800b9f4f0223d0f097911e/screenshot/main.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Jul 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/b1d7e338293ca2d2b5122d8e5cb349c408d4ed42

commit b1d7e338293ca2d2b5122d8e5cb349c408d4ed42
Author: Shuhei Takahashi <nya@chromium.org>
Date: Wed Jul 18 08:40:11 2018

tast-tests: Add graphics.Screenshot test.

This test runs screenshot command and makes sure it is not corrupted.

Note: screenshot command has a known issue that it does not work on
some boards, so this test is expected to fail on those boards.

BUG= chromium:856540 
TEST=tast -verbose run caroline-DUT graphics.Screenshot
CQ-DEPEND=CL:1107534

Change-Id: I82be2b2beb71fe716eff0764474277dc488f9ce7
Reviewed-on: https://chromium-review.googlesource.com/1118084
Commit-Ready: Shuhei Takahashi <nya@chromium.org>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[add] https://crrev.com/b1d7e338293ca2d2b5122d8e5cb349c408d4ed42/src/chromiumos/tast/local/bundles/cros/graphics/screenshot.go
[modify] https://crrev.com/b1d7e338293ca2d2b5122d8e5cb349c408d4ed42/src/chromiumos/tast/local/bundles/cros/main.go

Blocking: -860375
Project Member

Comment 9 by bugdroid1@chromium.org, Jul 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast/+/acae159a35086cdae12db1938ab982e16a2e62eb

commit acae159a35086cdae12db1938ab982e16a2e62eb
Author: Shuhei Takahashi <nya@chromium.org>
Date: Tue Jul 31 01:15:32 2018

tast: Allow querying if the test has failed.

BUG= chromium:856540 
TEST=tast run DUT example.Fail

Change-Id: Ie439fb132434d90cd4cc915c171112e192575f40
Reviewed-on: https://chromium-review.googlesource.com/1152829
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>

[modify] https://crrev.com/acae159a35086cdae12db1938ab982e16a2e62eb/src/chromiumos/tast/testing/state.go

Project Member

Comment 10 by bugdroid1@chromium.org, Jul 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/tast-tests/+/ff87897ab5a6e6831b344bdbab140cb50b3c9b47

commit ff87897ab5a6e6831b344bdbab140cb50b3c9b47
Author: Shuhei Takahashi <nya@chromium.org>
Date: Tue Jul 31 23:37:13 2018

faillog: Introduce faillog package.

faillog.SaveIfError can be called at end of a test function to save
useful debug logs ("ps" result and screenshot for now) when the
test has failed.

BUG= chromium:856540 
TEST=tast run DUT example.Fail
CQ-DEPEND=CL:1152829

Change-Id: I701bd02d0248ba2709ccb951ac5f683482ea76d4
Reviewed-on: https://chromium-review.googlesource.com/1152765
Commit-Ready: Shuhei Takahashi <nya@chromium.org>
Tested-by: Shuhei Takahashi <nya@chromium.org>
Reviewed-by: Dan Erat <derat@chromium.org>

[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/graphics/screenshot.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/example/pass.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/audio/device_play.go
[add] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/faillog/faillog.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/arc/boot_forever.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/arc/intent_forward.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/security/log_perms.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/example/dbus.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/video/play/play.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/ui/chrome_login.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/ui/mash_login.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/arc/boot.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/example/fail.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/arc/downloads.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/vm/webserver.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/platform/tpm_responsive.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/platform/check_processes.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/vm/start_crosvm.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/power/check_status.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/audio/device_record.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/vm/start_termina_vm.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/ui/chrome_crash_logged_in.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/ui/chrome_crash_not_logged_in.go
[modify] https://crrev.com/ff87897ab5a6e6831b344bdbab140cb50b3c9b47/src/chromiumos/tast/local/bundles/cros/example/data_files.go

Status: Fixed (was: Started)

Sign in to add a comment