Upload build metrics after a build is completed.
Soong now supports the ability to upload metrics to another location
by setting the ANDROID_ENABLE_METRICS_UPLOAD to an uploader that
accepts the upload.proto proto buffer message. When the environment
variable is set, a set of build metrics files (soong_metrics,
rbe_metrics.pb and build_error) is uploaded.
Bug: 140638454
Test: * Wrote unit test cases
* Setup the uploader, built a succcessful and failed aosp_arm-eng
target and monitor the uploading of the metrics.
Change-Id: I76a65739c557dc90345e098ca03119a950ece2d2
Merged-In: I76a65739c557dc90345e098ca03119a950ece2d2
diff --git a/ui/build/config_test.go b/ui/build/config_test.go
index 242e3af..e1fb271 100644
--- a/ui/build/config_test.go
+++ b/ui/build/config_test.go
@@ -22,6 +22,7 @@
"testing"
"android/soong/ui/logger"
+ "android/soong/ui/status"
"android/soong/ui/terminal"
)
@@ -30,6 +31,7 @@
Context: context.Background(),
Logger: logger.New(&bytes.Buffer{}),
Writer: terminal.NewWriter(terminal.NewCustomStdio(&bytes.Buffer{}, &bytes.Buffer{}, &bytes.Buffer{})),
+ Status: &status.Status{},
}}
}