skia2/tools/skqp/get_gold_results.py
Hal Canary 6a11fb0a09 SkQP: branching tools updated.
1.  get_gold_export_url.py becomes get_gold_results.py

2.  README_GENERATING_MODELS.md updated with changed and more
    complete instructions.

No-Try: true
Change-Id: I7fb84ad99e3049717ea9a572f8558ed2f73d412c
Reviewed-on: https://skia-review.googlesource.com/c/184600
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2019-01-17 15:29:50 +00:00

43 lines
1.2 KiB
Python
Executable File

#! /usr/bin/env python
# Copyright 2018 Google LLC.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import subprocess
import sys
import time
import urllib
def gold_export_url(first_commit, last_commit):
query = [
('fbegin', first_commit),
('fend', last_commit),
('query', 'config=gles&config=vk&source_type=gm'),
('pos', 'true'),
('neg', 'false'),
('unt', 'false')
]
return 'https://public-gold.skia.org/json/export?' + urllib.urlencode(query)
def git_rev_parse(rev):
return subprocess.check_output(['git', 'rev-parse', rev]).strip()
def main(args):
if len(args) != 2:
sys.stderr.write('Usage:\n %s FIRST_COMMIT LAST_COMMIT\n' % __file__)
sys.exit(1)
c1 = git_rev_parse(args[0])
c2 = git_rev_parse(args[1])
now = time.strftime("%Y%m%d_%H%M%S", time.gmtime())
url = gold_export_url(c1, c2)
sys.stdout.write(url + '\n')
filename = 'meta_%s_%s_%s.json' % (now, c1[:16], c2[:16])
urllib.urlretrieve(url, filename)
sys.stdout.write('\n' + filename + '\n')
if __name__ == '__main__':
main(sys.argv[1:])