New issue
Advanced search Search tips

Issue 834582 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

tast: Report timestamps for individual errors within tests

Project Member Reported by derat@chromium.org, Apr 19 2018

Issue description

The tast command writes a results.json file containing an array of TestResult structs. Each of these contains an array of testing.Error structs. testing.Error doesn't contain a timestamp since it's passed from test runners to the tast command via TestError control messages that already contains their own timestamps.

As a result, the Autotest server test that parses results.json files needs to fudge error timestamps when synthesizing errors for TKO status.log files.

I'm going to change the tast command to instead write an object for each error that additionally includes the timestamp from the control message. This should be backward-compatible since these JSON objects aren't typed in any way; it'll look the same object as before but with an additional "time" property:

  [
    {
      "name": "example.Fail",
      "errors": [
        {
          "time": "2018-04-18T18:49:30.974718982-07:00",
          "reason": "Here's an error",
          <more existing properties>
 
Project Member

Comment 1 by bugdroid1@chromium.org, Apr 19 2018

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

commit 0a4c9d59f33ce83a683fa8a1c72fd8d6f88a286d
Author: Daniel Erat <derat@chromium.org>
Date: Thu Apr 19 08:13:14 2018

tast: Include error timestamps in test results.

Update the tast command to include error timestamps in
results.json files.

results.json contains an array of TestResult structs. Each
of these formerly contained an array of testing.Error
struct, which don't contain timestamps.

This change makes TestResult instead contain an array of new
TestError structs that embed the testing.Error struct but
add an additional Time field.

BUG= chromium:834582 
TEST=unit tests pass; also verified that results.json looks
     the same as before with the addition of times in errors

Change-Id: I787a12816fa29873c6bae658f706db4627c4d4dd
Reviewed-on: https://chromium-review.googlesource.com/1018536
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Jason Clinton <jclinton@chromium.org>

[modify] https://crrev.com/0a4c9d59f33ce83a683fa8a1c72fd8d6f88a286d/src/chromiumos/cmd/tast/run/results_test.go
[modify] https://crrev.com/0a4c9d59f33ce83a683fa8a1c72fd8d6f88a286d/src/chromiumos/cmd/tast/run/results.go

Project Member

Comment 2 by bugdroid1@chromium.org, Apr 24 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/third_party/autotest/+/c21f4aa52b9d1552f00e150b92255d9984330335

commit c21f4aa52b9d1552f00e150b92255d9984330335
Author: Daniel Erat <derat@chromium.org>
Date: Tue Apr 24 07:30:16 2018

autotest: Make tast test use correct error timestamps.

Make the tast server test use the error timestamps that the
tast command now writes to results.json files when
creating status.log events. It previously just used the test
end time due to error timestamps not being available.

BUG= chromium:834582 
TEST=verified that FAIL entries in status.log have correct
     timestamps

Change-Id: I0357f7098d8024c63375e0ab262d0ea0b5ff2e4e
Reviewed-on: https://chromium-review.googlesource.com/1024966
Commit-Ready: Dan Erat <derat@chromium.org>
Tested-by: Dan Erat <derat@chromium.org>
Reviewed-by: Ilja H. Friedel <ihf@chromium.org>

[modify] https://crrev.com/c21f4aa52b9d1552f00e150b92255d9984330335/server/site_tests/tast/tast.py

Comment 3 by derat@chromium.org, Apr 24 2018

Status: Fixed (was: Started)

Sign in to add a comment