mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Move sharding logic to the correct context
Bug: b:338087169 Change-Id: I380f03c34ffcee315ef5084263f9f740b6bc4176 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/349642 Commit-Queue: Christoffer Dewerin <jansson@webrtc.org> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42258}
This commit is contained in:
parent
1545cdc76b
commit
35af7ccfb0
1 changed files with 12 additions and 13 deletions
|
@ -143,19 +143,6 @@ class TestMainImpl : public TestMain {
|
||||||
rtc::LogMessage::SetLogToStderr(absl::GetFlag(FLAGS_logs) ||
|
rtc::LogMessage::SetLogToStderr(absl::GetFlag(FLAGS_logs) ||
|
||||||
absl::GetFlag(FLAGS_verbose));
|
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
|
// InitFieldTrialsFromString stores the char*, so the char array must
|
||||||
// outlive the application.
|
// outlive the application.
|
||||||
field_trials_ = absl::GetFlag(FLAGS_force_fieldtrials);
|
field_trials_ = absl::GetFlag(FLAGS_force_fieldtrials);
|
||||||
|
@ -191,6 +178,18 @@ class TestMainImpl : public TestMain {
|
||||||
metrics_to_plot->clear();
|
metrics_to_plot->clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 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(total_shards.data());
|
||||||
|
putenv(shard_index.data());
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(WEBRTC_IOS)
|
#if defined(WEBRTC_IOS)
|
||||||
rtc::test::InitTestSuite(
|
rtc::test::InitTestSuite(
|
||||||
|
|
Loading…
Reference in a new issue