[infra] Ensure that core dump upload triggers on main builders

https://crrev.com/c/1296514 will add --output_directory to non-shards as
well. BUILDBOT_BUILDERNAME is not set on shards and a more reliable
indication that this is a main bot that should gsutil upload core dumps.

Change-Id: Ic6cddc4937b8e83d2e15da4acd90c193e412773b
Reviewed-on: https://dart-review.googlesource.com/c/81362
Reviewed-by: Jonas Termansen <sortie@google.com>
Commit-Queue: Alexander Thomas <athom@google.com>
diff --git a/tools/utils.py b/tools/utils.py
index a435328..c550045 100644
--- a/tools/utils.py
+++ b/tools/utils.py
@@ -830,10 +830,11 @@
         files.add(core)
       else:
         missing.append(crash)
-    if self._output_directory is None:
+    if (self._output_directory is None
+        or os.environ.containsKey('BUILDBOT_BUILDERNAME')):
       self._upload(files)
     else:
-      # --output_directory is specified, copy the dump to the output_directory instead
+      # This is a sharded test run: copy the dump to the output_directory
       self._copy(files)
 
     if missing: