From 99da64215e2318ee3967dd928e5842680d58f7c9 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 3 Feb 2017 09:58:13 +0000 Subject: Also report about individual attempts in a test For tests known to be flaky, additional attempts are run. Also report about those in the build-event protocol. -- Change-Id: I287b0b78478949abe5e14a9fafb1fd463aba8287 Reviewed-on: https://cr.bazel.build/8570 PiperOrigin-RevId: 146454273 MOS_MIGRATED_REVID=146454273 --- .../google/devtools/build/lib/buildeventstream/BuildEventId.java | 7 ++++++- .../build/lib/buildeventstream/proto/build_event_stream.proto | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/buildeventstream') diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java b/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java index e081671384..360dfdb15c 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/BuildEventId.java @@ -106,17 +106,22 @@ public final class BuildEventId implements Serializable { return new BuildEventId(cause.getIdProto()); } - public static BuildEventId testResult(Label target, Integer run, Integer shard) { + public static BuildEventId testResult(Label target, Integer run, Integer shard, Integer attempt) { BuildEventStreamProtos.BuildEventId.TestResultId resultId = BuildEventStreamProtos.BuildEventId.TestResultId.newBuilder() .setLabel(target.toString()) .setRun(run) .setShard(shard) + .setAttempt(attempt) .build(); return new BuildEventId( BuildEventStreamProtos.BuildEventId.newBuilder().setTestResult(resultId).build()); } + public static BuildEventId testResult(Label target, Integer run, Integer shard) { + return testResult(target, run, shard, 1); + } + public static BuildEventId testSummary(Label target) { BuildEventStreamProtos.BuildEventId.TestSummaryId summaryId = BuildEventStreamProtos.BuildEventId.TestSummaryId.newBuilder() diff --git a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto index 5f86638315..6131112e81 100644 --- a/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto +++ b/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto @@ -68,11 +68,16 @@ message BuildEventId { string primary_output = 1; } - // Identifier of an event reporting on an individual test run. + // Identifier of an event reporting on an individual test run. The label + // identifies the test that is reported about, the remaining fields are + // in such a way as to uniquely identify the action within a build. In fact, + // attempts for the same test, run, shard tripple are counted sequentially, + // starting with 1. message TestResultId { string label = 1; int32 run = 2; int32 shard = 3; + int32 attempt = 4; } // Identifier of an event reporting the summary of a test. -- cgit v1.2.3