1# Copyright 2020 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4"""Utilities for determining if a test is being run locally or not.""" 5 6import os 7 8 9def IsOnSwarming(): 10 """Determines whether we are on swarming or not. 11 12 Returns: 13 True if the test is being run on swarming, otherwise False. 14 """ 15 # Look for the presence of the SWARMING_SERVER environment variable as a 16 # heuristic to determine whether we're running on a workstation or a bot. 17 # This should always be set on swarming, but would be strange to be set on 18 # a workstation. 19 return 'SWARMING_SERVER' in os.environ 20