Enable sharding for fuchsia bots.

* Add '--quick' argument to 'low_bandwidth_audio_test' even though it doesn't look like it makes much timing difference.
* Add sharding for 'svc_tests' and 'video_engine_tests'.

Change-Id: I6e3357954d18ad03ea9f62912dd77e0e1a74b97d
Bug: webrtc:14713
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/285100
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@google.com>
Cr-Commit-Position: refs/heads/main@{#38748}
This commit is contained in:
Jeremy Leconte
2022-11-28 18:42:30 +01:00
committed by WebRTC LUCI CQ
parent 6358cbf7bb
commit 370ca9c52c
4 changed files with 47 additions and 7 deletions

View File

@ -100,6 +100,17 @@ ABSL_FLAG(std::string,
"Path to collect trace events (json file) for chrome://tracing. "
"If not set, events aren't captured.");
ABSL_FLAG(std::string,
test_launcher_shard_index,
"",
"Index of the test shard to run, from 0 to "
"the value specified with --test_launcher_total_shards.");
ABSL_FLAG(std::string,
test_launcher_total_shards,
"",
"Total number of shards.");
namespace webrtc {
namespace {
@ -127,6 +138,19 @@ class TestMainImpl : public TestMain {
rtc::LogMessage::SetLogToStderr(absl::GetFlag(FLAGS_logs) ||
absl::GetFlag(FLAGS_verbose));
// The sharding arguments take precedence over the sharding environment
// variables.
if (!absl::GetFlag(FLAGS_test_launcher_shard_index).empty() &&
!absl::GetFlag(FLAGS_test_launcher_total_shards).empty()) {
std::string shard_index =
"GTEST_SHARD_INDEX=" + absl::GetFlag(FLAGS_test_launcher_shard_index);
std::string total_shards =
"GTEST_TOTAL_SHARDS=" +
absl::GetFlag(FLAGS_test_launcher_total_shards);
putenv(shard_index.data());
putenv(total_shards.data());
}
// InitFieldTrialsFromString stores the char*, so the char array must
// outlive the application.
field_trials_ = absl::GetFlag(FLAGS_force_fieldtrials);