File tree 2 files changed +30
-4
lines changed
main/java/com/google/devtools/build/lib/remote
2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 63
63
class ByteStreamBuildEventArtifactUploader extends AbstractReferenceCounted
64
64
implements BuildEventArtifactUploader {
65
65
private static final Pattern TEST_LOG_PATTERN = Pattern .compile (".*/bazel-out/[^/]*/testlogs/.*" );
66
+ private static final Pattern BUILD_LOG_PATTERN =
67
+ Pattern .compile (".*/bazel-out/_tmp/actions/std(err|out)-.*" );
66
68
67
69
private final Executor executor ;
68
70
private final ExtendedEventHandler reporter ;
@@ -216,14 +218,15 @@ private boolean shouldUpload(PathMetadata path) {
216
218
path .getDigest () != null && !path .isRemote () && !path .isDirectory () && !path .isOmitted ();
217
219
218
220
if (remoteBuildEventUploadMode == RemoteBuildEventUploadMode .MINIMAL ) {
219
- result = result && (isTestLog (path ) || isProfile (path ));
221
+ result = result && (isLog (path ) || isProfile (path ));
220
222
}
221
223
222
224
return result ;
223
225
}
224
226
225
- private boolean isTestLog (PathMetadata path ) {
226
- return TEST_LOG_PATTERN .matcher (path .getPath ().getPathString ()).matches ();
227
+ private boolean isLog (PathMetadata path ) {
228
+ return TEST_LOG_PATTERN .matcher (path .getPath ().getPathString ()).matches ()
229
+ || BUILD_LOG_PATTERN .matcher (path .getPath ().getPathString ()).matches ();
227
230
}
228
231
229
232
private boolean isProfile (PathMetadata path ) {
Original file line number Diff line number Diff line change 269
269
expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
270
270
}
271
271
272
+ function test_upload_minimal_upload_buildlogs() {
273
+ mkdir -p a
274
+ cat > a/BUILD << EOF
275
+ genrule(
276
+ name = 'foo',
277
+ outs = ['foo.txt'],
278
+ cmd = 'echo "stdout" && echo "stderr" >&2 && exit 1',
279
+ tags = ['no-remote'],
280
+ )
281
+ EOF
282
+
283
+ bazel build \
284
+ --remote_executor=grpc://localhost:${worker_port} \
285
+ --experimental_remote_build_event_upload=minimal \
286
+ --build_event_json_file=bep.json \
287
+ //a:foo >& $TEST_log || true
288
+
289
+ cat bep.json > $TEST_log
290
+ expect_log " stdout.*bytestream://" || fail " should upload stdout"
291
+ expect_log " stderr.*bytestream://" || fail " should upload stderr"
292
+ expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
293
+ }
294
+
272
295
function test_upload_minimal_upload_profile() {
273
296
mkdir -p a
274
297
cat > a/BUILD << EOF
290
313
expect_log " mycommand.profile.gz.*bytestream://" || fail " should upload profile data"
291
314
}
292
315
293
- run_suite " Remote build event uploader tests"
316
+ run_suite " Remote build event uploader tests"
You can’t perform that action at this time.
0 commit comments