Remove base-* directories from gm expected/actual paths; just use platform names

BUG=skia:1512

The buildbot master continues to set gm_image_subdir, but the slaves no longer
use that component when building GM paths (they just use builder_name instead).
But gm_image_subdir is still used for SKP storage paths under
gs://chromium-skia-gm/playback/gm-actual , for now...

Immediately before committing this CL, I will copy the actual-results.json files
from their old locations to their new locations (within the skia-autogen repo)
so that both old and new versions of rebaseline.py will be able to retrieve
actual results, like so:

svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Debug/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Debug
svn cp base-android-galaxy-nexus/Test-Android-GalaxyNexus-SGX540-Arm7-Release/base-android-galaxy-nexus Test-Android-GalaxyNexus-SGX540-Arm7-Release
svn cp base-android-nexus-10/Test-Android-Nexus10-MaliT604-Arm7-Debug/base-android-nexus-10 Test-Android-Nexus10-MaliT604-Arm7-Debug
...
svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Debug/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Debug
svn cp base-shuttle-win7-intel-float/Test-Win7-ShuttleA-HD2000-x86-Release/base-shuttle-win7-intel-float Test-Win7-ShuttleA-HD2000-x86-Release


Once we see this CL land successfully, I will delete the actual-results.json
files from their OLD location within skia-autogen, like so:

svn rm base-android-galaxy-nexus
svn rm base-android-nexus-10
...
svn rm base-shuttle-win7-intel-directwrite
svn rm base-shuttle-win7-intel-float

R=borenet@google.com, rmistry@google.com

Review URL: https://codereview.chromium.org/23120002

git-svn-id: http://skia.googlecode.com/svn/trunk@10821 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
epoger@google.com 2013-08-20 16:21:55 +00:00
parent c5dffe4b52
commit fd040116c5
70 changed files with 95651 additions and 84 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,12 @@
Baseline images originally generated on a Mac Mini
Model Name: Mac mini
Model Identifier: Macmini4,1
Processor Name: Intel Core 2 Duo
Chipset Model: NVIDIA GeForce 320M
Ran these commands to generate:
GYP_DEFINES="skia_scalar=float" make gm
out/Debug/gm -w gm/base-macmini

View File

@ -0,0 +1,12 @@
Baseline images originally generated on a Mac Mini
Model Name: Mac mini
Model Identifier: Macmini4,1
Processor Name: Intel Core 2 Duo
Chipset Model: NVIDIA GeForce 320M
Ran these commands to generate:
GYP_DEFINES="skia_scalar=float" make gm
out/Debug/gm -w gm/base-macmini

View File

@ -0,0 +1,12 @@
Baseline images originally generated on a Mac Mini
Model Name: Mac mini
Model Identifier: Macmini4,1
Processor Name: Intel Core 2 Duo
Chipset Model: NVIDIA GeForce 320M
Ran these commands to generate:
GYP_DEFINES="skia_scalar=float" make gm
out/Debug/gm -w gm/base-macmini

View File

@ -0,0 +1,11 @@
Baseline images originally generated on our Skia_MacMiniLion_Float builtbot slave.
Model Name: Mac mini
Model Identifier: Macmini4,1
Processor Name: Intel Core 2 Duo
Chipset Model: NVIDIA GeForce 320M
OS: Mac OS 10.7.2

View File

@ -0,0 +1,11 @@
Baseline images originally generated on our Skia_MacMiniLion_Float builtbot slave.
Model Name: Mac mini
Model Identifier: Macmini4,1
Processor Name: Intel Core 2 Duo
Chipset Model: NVIDIA GeForce 320M
OS: Mac OS 10.7.2

View File

@ -0,0 +1,11 @@
Baseline images originally generated on our Skia_MacMiniLion_Float builtbot slave.
Model Name: Mac mini
Model Identifier: Macmini4,1
Processor Name: Intel Core 2 Duo
Chipset Model: NVIDIA GeForce 320M
OS: Mac OS 10.7.2

View File

@ -0,0 +1,9 @@
{
"actual-results": {
"failed": null,
"failure-ignored": null,
"no-comparison": null,
"succeeded": null
},
"expected-results": null
}

View File

@ -0,0 +1,9 @@
{
"actual-results": {
"failed": null,
"failure-ignored": null,
"no-comparison": null,
"succeeded": null
},
"expected-results": null
}

View File

@ -0,0 +1,9 @@
{
"actual-results": {
"failed": null,
"failure-ignored": null,
"no-comparison": null,
"succeeded": null
},
"expected-results": null
}

View File

@ -0,0 +1,9 @@
{
"actual-results": {
"failed": null,
"failure-ignored": null,
"no-comparison": null,
"succeeded": null
},
"expected-results": null
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
Baseline images generated on:
Shuttle PC with Intel Core i7-2600
with Windows 7 installed
and using the CPU's built-in GPU (so-called "Intel HD Graphics 3000")

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
Baseline images generated on:
Shuttle PC with Intel Core i7-2600
with Windows 7 installed
and using the CPU's built-in GPU (so-called "Intel HD Graphics 3000")

View File

@ -0,0 +1,7 @@
Baseline images generated on:
Shuttle PC with Intel Core i7-2600
with Windows 7 installed
and using the CPU's built-in GPU (so-called "Intel HD Graphics 3000")

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
Baseline images generated on:
Shuttle PC with Intel Core i7-2600
with Windows 7 installed
and using the CPU's built-in GPU (so-called "Intel HD Graphics 3000")

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
Baseline images generated on:
Shuttle PC with Intel Core i7-2600
with Windows 7 installed
and using the CPU's built-in GPU (so-called "Intel HD Graphics 3000")

File diff suppressed because it is too large Load Diff

30
tools/buildbot_globals.py Executable file
View File

@ -0,0 +1,30 @@
#!/usr/bin/python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Provides read access to buildbot's global_variables.json .
"""
import json
import svn
_global_vars = None
class NoSuchGlobalVariable(KeyError):
pass
def Get(var_name):
'''Return the value associated with this name in global_variables.json.
Raises NoSuchGlobalVariable if there is no variable with that name.'''
global _global_vars
if not _global_vars:
_global_vars = json.loads(svn.Cat('http://skia.googlecode.com/svn/'
'buildbot/site_config/'
'global_variables.json'))
try:
return _global_vars[var_name]['value']
except KeyError:
raise NoSuchGlobalVariable(var_name)

View File

@ -13,6 +13,7 @@ Rebaselines the given GM tests, on all bots and all configurations.
# System-level imports
import argparse
import json
import os
import re
import subprocess
@ -34,38 +35,15 @@ GM_DIRECTORY = os.path.realpath(
os.path.join(os.path.dirname(os.path.dirname(__file__)), 'gm'))
if GM_DIRECTORY not in sys.path:
sys.path.append(GM_DIRECTORY)
import buildbot_globals
import gm_json
# Mapping of expectations/gm subdir (under
# https://skia.googlecode.com/svn/trunk/expectations/gm/ )
# to builder name (see list at http://108.170.217.252:10117/builders )
SUBDIR_MAPPING = {
'base-shuttle-win7-intel-float':
'Test-Win7-ShuttleA-HD2000-x86-Release',
'base-shuttle-win7-intel-angle':
'Test-Win7-ShuttleA-HD2000-x86-Release-ANGLE',
'base-shuttle-win7-intel-directwrite':
'Test-Win7-ShuttleA-HD2000-x86-Release-DirectWrite',
'base-shuttle_ubuntu12_ati5770':
'Test-Ubuntu12-ShuttleA-ATI5770-x86_64-Release',
'base-macmini':
'Test-Mac10.6-MacMini4.1-GeForce320M-x86-Release',
'base-macmini-lion-float':
'Test-Mac10.7-MacMini4.1-GeForce320M-x86-Release',
'base-android-galaxy-nexus':
'Test-Android-GalaxyNexus-SGX540-Arm7-Debug',
'base-android-nexus-7':
'Test-Android-Nexus7-Tegra3-Arm7-Release',
'base-android-nexus-s':
'Test-Android-NexusS-SGX540-Arm7-Release',
'base-android-xoom':
'Test-Android-Xoom-Tegra2-Arm7-Release',
'base-android-nexus-10':
'Test-Android-Nexus10-MaliT604-Arm7-Release',
'base-android-nexus-4':
'Test-Android-Nexus4-Adreno320-Arm7-Release',
}
MASTER_HOST_URL = 'http://%s:%s' % (buildbot_globals.Get('master_host'),
buildbot_globals.Get('external_port'))
ALL_BUILDERS = list(json.load(urllib2.urlopen(
MASTER_HOST_URL + '/json/builders')))
TEST_BUILDERS = filter(lambda x: 'Trybot' not in x and 'Test' in x,
ALL_BUILDERS)
class _InternalException(Exception):
pass
@ -213,17 +191,15 @@ class JsonRebaseliner(object):
return results_to_return
# Rebaseline all tests/types we specified in the constructor,
# within this expectations/gm subdir.
# within this builder's subdirectory in expectations/gm .
#
# params:
# subdir : e.g. 'base-shuttle-win7-intel-float'
# builder : e.g. 'Test-Win7-ShuttleA-HD2000-x86-Release'
def RebaselineSubdir(self, subdir, builder):
def RebaselineSubdir(self, builder):
# Read in the actual result summary, and extract all the tests whose
# results we need to update.
actuals_url = '/'.join([self._actuals_base_url,
subdir, builder, subdir,
self._actuals_filename])
builder, self._actuals_filename])
# In most cases, we won't need to re-record results that are already
# succeeding, but including the SUCCEEDED results will allow us to
# re-record expectations if they somehow get out of sync.
@ -236,7 +212,7 @@ class JsonRebaseliner(object):
# Read in current expectations.
expectations_input_filepath = os.path.join(
self._expectations_root, subdir, self._expectations_input_filename)
self._expectations_root, builder, self._expectations_input_filename)
expectations_dict = gm_json.LoadFromFile(expectations_input_filepath)
expected_results = expectations_dict[gm_json.JSONKEY_EXPECTEDRESULTS]
@ -261,7 +237,7 @@ class JsonRebaseliner(object):
# Write out updated expectations.
expectations_output_filepath = os.path.join(
self._expectations_root, subdir, self._expectations_output_filename)
self._expectations_root, builder, self._expectations_output_filename)
gm_json.WriteToFile(expectations_dict, expectations_output_filepath)
# Mark the JSON file as plaintext, so text-style diffs can be applied.
@ -278,7 +254,7 @@ parser.add_argument('--actuals-base-url',
'summaries of actual GM results; defaults to %(default)s',
default='http://skia-autogen.googlecode.com/svn/gm-actual')
parser.add_argument('--actuals-filename',
help='filename (within platform-specific subdirectories ' +
help='filename (within builder-specific subdirectories ' +
'of ACTUALS_BASE_URL) to read a summary of results from; ' +
'defaults to %(default)s',
default='actual-results.json')
@ -288,6 +264,10 @@ parser.add_argument('--add-new', action='store_true',
'updating expectations for failing tests, add ' +
'expectations for tests which don\'t have expectations ' +
'yet.')
parser.add_argument('--builders', metavar='BUILDER', nargs='+',
help='which platforms to rebaseline; ' +
'if unspecified, rebaseline all platforms, same as ' +
'"--builders %s"' % ' '.join(sorted(TEST_BUILDERS)))
# TODO(epoger): Add test that exercises --configs argument.
parser.add_argument('--configs', metavar='CONFIG', nargs='+',
help='which configurations to rebaseline, e.g. ' +
@ -308,17 +288,13 @@ parser.add_argument('--expectations-filename-output',
default='')
parser.add_argument('--expectations-root',
help='root of expectations directory to update-- should ' +
'contain one or more base-* subdirectories. Defaults to ' +
'contain one or more builder subdirectories. Defaults to ' +
'%(default)s',
default=os.path.join('expectations', 'gm'))
parser.add_argument('--keep-going-on-failure', action='store_true',
help='instead of halting at the first error encountered, ' +
'keep going and rebaseline as many tests as possible, ' +
'and then report the full set of errors at the end')
parser.add_argument('--subdirs', metavar='SUBDIR', nargs='+',
help='which platform subdirectories to rebaseline; ' +
'if unspecified, rebaseline all subdirs, same as ' +
'"--subdirs %s"' % ' '.join(sorted(SUBDIR_MAPPING.keys())))
# TODO(epoger): Add test that exercises --tests argument.
parser.add_argument('--tests', metavar='TEST', nargs='+',
help='which tests to rebaseline, e.g. ' +
@ -328,27 +304,19 @@ parser.add_argument('--tests', metavar='TEST', nargs='+',
args = parser.parse_args()
exception_handler = ExceptionHandler(
keep_going_on_failure=args.keep_going_on_failure)
if args.subdirs:
subdirs = args.subdirs
if args.builders:
builders = args.builders
missing_json_is_fatal = True
else:
subdirs = sorted(SUBDIR_MAPPING.keys())
builders = sorted(TEST_BUILDERS)
missing_json_is_fatal = False
for subdir in subdirs:
if not subdir in SUBDIR_MAPPING.keys():
raise Exception(('unrecognized platform subdir "%s"; ' +
for builder in builders:
if not builder in TEST_BUILDERS:
raise Exception(('unrecognized builder "%s"; ' +
'should be one of %s') % (
subdir, SUBDIR_MAPPING.keys()))
builder = SUBDIR_MAPPING[subdir]
builder, TEST_BUILDERS))
# We instantiate different Rebaseliner objects depending
# on whether we are rebaselining an expected-results.json file, or
# individual image files. Different expectations/gm subdirectories may move
# from individual image files to JSON-format expectations at different
# times, so we need to make this determination per subdirectory.
#
# See https://goto.google.com/ChecksumTransitionDetail
expectations_json_file = os.path.join(args.expectations_root, subdir,
expectations_json_file = os.path.join(args.expectations_root, builder,
args.expectations_filename)
if os.path.isfile(expectations_json_file):
rebaseliner = JsonRebaseliner(
@ -362,7 +330,7 @@ for subdir in subdirs:
exception_handler=exception_handler,
add_new=args.add_new)
try:
rebaseliner.RebaselineSubdir(subdir=subdir, builder=builder)
rebaseliner.RebaselineSubdir(builder=builder)
except BaseException as e:
exception_handler.RaiseExceptionOrContinue(e)
else:

View File

@ -21,14 +21,7 @@ import subprocess
import svn
import sys
GLOBAL_VARIABLES = json.loads(svn.Cat('http://skia.googlecode.com/svn/'
'buildbot/site_config/'
'global_variables.json'))
def GetGlobalVariable(var_name):
return GLOBAL_VARIABLES[var_name]['value']
import buildbot_globals
# Alias which can be used to run a try on every builder.
@ -43,8 +36,8 @@ REGEX = 'regex'
ALL_ALIASES = [ALL_BUILDERS, COMPILE_BUILDERS, CQ_BUILDERS, REGEX]
# Contact information for the build master.
SKIA_BUILD_MASTER_HOST = str(GetGlobalVariable('master_host'))
SKIA_BUILD_MASTER_PORT = str(GetGlobalVariable('external_port'))
SKIA_BUILD_MASTER_HOST = str(buildbot_globals.Get('master_host'))
SKIA_BUILD_MASTER_PORT = str(buildbot_globals.Get('external_port'))
# All try builders have this suffix.
TRYBOT_SUFFIX = '-Trybot'

View File

@ -1 +1 @@
python tools/rebaseline.py --expectations-root tools/tests/rebaseline/output/using-json1-expectations/output-actual/gm-expectations --actuals-base-url tools/tests/rebaseline/input/json1 --subdirs base-android-galaxy-nexus base-shuttle-win7-intel-float
python tools/rebaseline.py --expectations-root tools/tests/rebaseline/output/using-json1-expectations/output-actual/gm-expectations --actuals-base-url tools/tests/rebaseline/input/json1 --builders Test-Android-GalaxyNexus-SGX540-Arm7-Debug Test-Win7-ShuttleA-HD2000-x86-Release

View File

@ -131,9 +131,9 @@ function benchgraph_test {
# Test rebaseline.py's JSON-format expectations rebaselining capability.
#
# Copy expected-result.json files from $1 into a dir where they can be modified.
# Copy expected-results.json files from $1 into a dir where they can be modified.
# Run rebaseline.py with arguments in $2, recording its output.
# Then compare the output (and modified expected-result.json files) to the
# Then compare the output (and modified expected-results.json files) to the
# content of $2/output-expected.
function rebaseline_test {
if [ $# != 3 ]; then
@ -148,18 +148,31 @@ function rebaseline_test {
rm -rf $ACTUAL_OUTPUT_DIR
mkdir -p $ACTUAL_OUTPUT_DIR
EXPECTATIONS_TO_MODIFY_DIR="$ACTUAL_OUTPUT_DIR/gm-expectations"
SUBDIRS=$(ls $COPY_EXPECTATIONS_FROM_DIR)
for SUBDIR in $SUBDIRS; do
mkdir -p $EXPECTATIONS_TO_MODIFY_DIR/$SUBDIR
cp $COPY_EXPECTATIONS_FROM_DIR/$SUBDIR/expected-results.json \
$EXPECTATIONS_TO_MODIFY_DIR/$SUBDIR
# TODO(epoger): Temporarily exclude expectations subdirs with old base-* names,
# during a transition period (we need the svn rm of those subdirs to take
# effect)
BUILDERS=$(ls $COPY_EXPECTATIONS_FROM_DIR | grep -v ^base-)
for BUILDER in $BUILDERS; do
mkdir -p $EXPECTATIONS_TO_MODIFY_DIR/$BUILDER
cp $COPY_EXPECTATIONS_FROM_DIR/$BUILDER/expected-results.json \
$EXPECTATIONS_TO_MODIFY_DIR/$BUILDER
done
COMMAND="python tools/rebaseline.py --expectations-root $EXPECTATIONS_TO_MODIFY_DIR $ARGS"
echo "$COMMAND" >$ACTUAL_OUTPUT_DIR/command_line
$COMMAND &>$ACTUAL_OUTPUT_DIR/stdout
echo $? >$ACTUAL_OUTPUT_DIR/return_value
compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR
# TODO(epoger): Temporarily override compare_directories with a comparison
# that excludes expectations subdirs with old base-* names,
# during a transition period (we need the svn rm of those subdirs to take
# effect)
#
# WAS: compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR
diff --recursive --exclude=.* --exclude=base-* $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR
if [ $? != 0 ]; then
echo "failed in: compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR"
exit 1
fi
}
# Run jsondiff.py with arguments in $1, recording its output.
@ -242,7 +255,7 @@ fi
REBASELINE_INPUT=tools/tests/rebaseline/input
REBASELINE_OUTPUT=tools/tests/rebaseline/output
rebaseline_test "$REBASELINE_INPUT/json1" "--actuals-base-url $REBASELINE_INPUT/json1 --subdirs base-android-galaxy-nexus base-shuttle-win7-intel-float" "$REBASELINE_OUTPUT/using-json1-expectations"
rebaseline_test "$REBASELINE_INPUT/json1" "--actuals-base-url $REBASELINE_INPUT/json1 --builders Test-Android-GalaxyNexus-SGX540-Arm7-Debug Test-Win7-ShuttleA-HD2000-x86-Release" "$REBASELINE_OUTPUT/using-json1-expectations"
#
# Test jsondiff.py ...

View File

@ -47,8 +47,8 @@ def FindURLSInJSON(json_file, gs_urls):
Example gs_urls:
{ 'gs://chromium-skia-gm/gm/sometest/12345.png': [
'http://skia-autogen.googlecode.com/svn/gm-actual/base-macmini/Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug/base-macmini/actual-results.json',
'http://skia-autogen.googlecode.com/svn/gm-actual/base-macmini-10_8/Test-Mac10.8-MacMini4.1-GeForce320M-x86-Debug/base-macmini-10_8/actual-results.json',
'http://skia-autogen.googlecode.com/svn/gm-actual/Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug/actual-results.json',
'http://skia-autogen.googlecode.com/svn/gm-actual/Test-Mac10.8-MacMini4.1-GeForce320M-x86-Debug/actual-results.json',
]
}
"""
@ -111,8 +111,8 @@ def FindURLs(url):
Example output:
{ 'gs://chromium-skia-gm/gm/sometest/12345.png': [
'http://skia-autogen.googlecode.com/svn/gm-actual/base-macmini/Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug/base-macmini/actual-results.json',
'http://skia-autogen.googlecode.com/svn/gm-actual/base-macmini-10_8/Test-Mac10.8-MacMini4.1-GeForce320M-x86-Debug/base-macmini-10_8/actual-results.json',
'http://skia-autogen.googlecode.com/svn/gm-actual/Test-Mac10.6-MacMini4.1-GeForce320M-x86-Debug/actual-results.json',
'http://skia-autogen.googlecode.com/svn/gm-actual/Test-Mac10.8-MacMini4.1-GeForce320M-x86-Debug/actual-results.json',
]
}
"""