From 004d3f0f75461410a068bde6e8a8b76728910515 Mon Sep 17 00:00:00 2001 From: Casey Hillers Date: Fri, 13 Nov 2020 10:38:03 -0800 Subject: [PATCH] [devicelab] LUCI builder flag (#70464) --- dev/devicelab/bin/run.dart | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/dev/devicelab/bin/run.dart b/dev/devicelab/bin/run.dart index 2b34d5ec84..a9ad49d16d 100644 --- a/dev/devicelab/bin/run.dart +++ b/dev/devicelab/bin/run.dart @@ -30,6 +30,12 @@ String localEngine; /// The path to the engine "src/" directory. String localEngineSrcPath; +/// Name of the LUCI builder this test is currently running on. +/// +/// This is only passed on CI runs for Cocoon to be able to uniquely identify +/// this test run. +String luciBuilder; + /// Whether to exit on first test failure. bool exitOnFirstTestFailure; @@ -81,9 +87,10 @@ Future main(List rawArgs) async { } deviceId = args['device-id'] as String; + exitOnFirstTestFailure = args['exit'] as bool; localEngine = args['local-engine'] as String; localEngineSrcPath = args['local-engine-src-path'] as String; - exitOnFirstTestFailure = args['exit'] as bool; + luciBuilder = args['luci-builder'] as String; serviceAccountTokenFile = args['service-account-token-file'] as String; silent = args['silent'] as bool; @@ -111,7 +118,9 @@ Future _runTasks() async { if (serviceAccountTokenFile != null) { final Cocoon cocoon = Cocoon(serviceAccountTokenPath: serviceAccountTokenFile); - await cocoon.sendTaskResult(taskName: taskName, result: result); + /// Cocoon's definition of a task is more specific than [taskName], and to + /// upload we instead send the [luciBuilder] this is running on. + await cocoon.sendTaskResult(taskName: luciBuilder, result: result); } if (!result.succeeded) { @@ -338,6 +347,10 @@ final ArgParser _argParser = ArgParser() 'locally. Defaults to \$FLUTTER_ENGINE if set, or tries to guess at\n' 'the location based on the value of the --flutter-root option.', ) + ..addOption( + 'luci-builder', + help: '[Flutter infrastructure] Name of the LUCI builder being run on.' + ) ..addFlag( 'match-host-platform', defaultsTo: true,