Migrate customer_testing to sharded tests. (#138659)

This will allow Dart Team to run customer tests as part of monorepo and will be a step forward to remove ad_hoc tests.

Bug: https://github.com/dart-lang/sdk/issues/51042
Bug: https://github.com/flutter/flutter/issues/115476
This commit is contained in:
godofredoc
2023-11-27 16:41:53 -08:00
committed by GitHub
parent fc203edcbf
commit fe7299d318
7 changed files with 66 additions and 28 deletions

View File

@@ -68,24 +68,24 @@ String git(String workingDirectory, List<String> arguments, {bool allowFailure =
}
void main(List<String> arguments) {
if (arguments.isEmpty || arguments.length > 2 || arguments.contains('--help') || arguments.contains('-h')) {
if (arguments.isEmpty || arguments.length != 4 || arguments.contains('--help') || arguments.contains('-h')) {
print(
'Usage: dart find_commit.dart [<path-to-primary-repo>] <path-to-secondary-repo>\n'
'Usage: dart find_commit.dart <path-to-primary-repo> <primary-trunk> <path-to-secondary-repo> <secondary-branch>\n'
'This script will find the commit in the secondary repo that was contemporary\n'
'when the commit in the primary repo was created. If that commit is on a\n'
"branch, then the date of the branch's last merge is used instead.\n"
'If <path-to-primary-repo> is omitted, the current directory is used for the\n'
'primary repo.'
"branch, then the date of the branch's last merge is used instead."
);
} else {
final String primaryRepo = arguments.length == 1 ? '.' : arguments.first;
final String secondaryRepo = arguments.last;
final String primaryRepo = arguments.first;
final String primaryTrunk = arguments[1];
final String secondaryRepo = arguments[2];
final String secondaryBranch = arguments.last;
print(findCommit(
primaryRepoDirectory: primaryRepo,
primaryBranch: git(primaryRepo, <String>['rev-parse', '--abbrev-ref', 'HEAD']).trim(),
primaryTrunk: 'master',
primaryTrunk: primaryTrunk,
secondaryRepoDirectory: secondaryRepo,
secondaryBranch: 'master',
secondaryBranch: secondaryBranch,
).trim());
}
}