File tree Expand file tree Collapse file tree 2 files changed +30
-4
lines changed
main/java/com/google/devtools/build/lib/remote Expand file tree Collapse file tree 2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change 6363class ByteStreamBuildEventArtifactUploader extends AbstractReferenceCounted
6464 implements BuildEventArtifactUploader {
6565 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)-.*" );
6668
6769 private final Executor executor ;
6870 private final ExtendedEventHandler reporter ;
@@ -216,14 +218,15 @@ private boolean shouldUpload(PathMetadata path) {
216218 path .getDigest () != null && !path .isRemote () && !path .isDirectory () && !path .isOmitted ();
217219
218220 if (remoteBuildEventUploadMode == RemoteBuildEventUploadMode .MINIMAL ) {
219- result = result && (isTestLog (path ) || isProfile (path ));
221+ result = result && (isLog (path ) || isProfile (path ));
220222 }
221223
222224 return result ;
223225 }
224226
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 ();
227230 }
228231
229232 private boolean isProfile (PathMetadata path ) {
Original file line number Diff line number Diff line change 269269 expect_log " command.profile.gz.*bytestream://" || fail " should upload profile data"
270270}
271271
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+
272295function test_upload_minimal_upload_profile() {
273296 mkdir -p a
274297 cat > a/BUILD << EOF
290313 expect_log " mycommand.profile.gz.*bytestream://" || fail " should upload profile data"
291314}
292315
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