Bug 1583364 - Remove ability to specify platforms/e10s in testing/runtimes/writeruntimes, r=gbrown

The script should just do the thing that we want. Providing options just
increases the chance of user error. I don't see any need to specify either of
these things.

Depends on D53699

Differential Revision: https://phabricator.services.mozilla.com/D53700

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2019-11-23 05:29:37 +00:00
parent 6e17ec47f6
commit ccc0b49e8b

View File

@ -30,16 +30,11 @@ here = os.path.abspath(os.path.dirname(__file__))
ACTIVE_DATA_URL = "https://activedata.allizom.org/query"
PERCENTILE = 0.5 # ignore the bottom PERCENTILE*100% of numbers
def query_activedata(suite, e10s, platforms=None):
platforms = ', "build.platform":%s' % json.dumps(platforms) if platforms else ''
def query_activedata(suite):
last_week = datetime.datetime.now() - datetime.timedelta(days=7)
last_week_timestamp = time.mktime(last_week.timetuple())
e10s_clause = '"eq":{"run.type":"e10s"}'
if not e10s:
e10s_clause = '"not":{%s}' % e10s_clause
query = """
{
"from":"unittest",
@ -47,13 +42,14 @@ def query_activedata(suite, e10s, platforms=None):
"groupby":["result.test"],
"select":{"value":"result.duration","aggregate":"average"},
"where":{"and":[
{"eq":{"run.suite":"%s"%s}},
{%s},
{"eq":{"run.suite.flavor":"%s"}},
{"gt":{"run.timestamp":%s}}
]}
}
""" % (suite, platforms, e10s_clause, last_week_timestamp)
""" % (suite, last_week_timestamp)
print("Running ActiveData query:")
print(query)
response = requests.post(ACTIVE_DATA_URL,
data=query,
stream=True)
@ -61,6 +57,7 @@ def query_activedata(suite, e10s, platforms=None):
data = response.json()["data"]
return data
def write_runtimes(data, suite, indir=here, outdir=here):
data = dict(data)
@ -126,15 +123,9 @@ def cli(args=sys.argv[1:]):
parser.add_argument('-i', '--input-directory', dest='indir',
default=here, help="Directory from which to read current runtime data.")
parser.add_argument('-p', '--platforms', default=None,
help="Comma separated list of platforms from which to generate data.")
parser.add_argument('-s', '--suite', dest='suite', default=None,
help="Suite for which to generate data.")
parser.add_argument('--disable-e10s', dest='e10s', default=True,
action='store_false', help="Generate runtimes for non-e10s tests.")
args = parser.parse_args(args)
if not args.suite:
@ -142,14 +133,8 @@ def cli(args=sys.argv[1:]):
if ',' in args.suite:
raise ValueError("Passing multiple suites is not supported")
if args.platforms:
args.platforms = args.platforms.split(',')
data = query_activedata(args.suite, args.e10s, args.platforms)
suite = args.suite
if args.e10s:
suite = '%s-e10s' % suite
data = query_activedata(suite)
if not data:
print("Not creating runtimes file as no data was found")