Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2078)

Unified Diff: ct/go/worker_scripts/capture_skps/main.go

Issue 1392173005: [CT] Update worker scripts to use new benchmarks and delete old benchmarks (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Remove staging code Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ct/go/worker_scripts/capture_skps/main.go
diff --git a/ct/go/worker_scripts/capture_skps/main.go b/ct/go/worker_scripts/capture_skps/main.go
index c701cf8a3ac18c6f612405678d3f86db98d58b69..7e487b2b129e0bbb0f52fb977b302e28718bf331 100644
--- a/ct/go/worker_scripts/capture_skps/main.go
+++ b/ct/go/worker_scripts/capture_skps/main.go
@@ -3,6 +3,7 @@ package main
import (
"encoding/csv"
+ "encoding/json"
"flag"
"fmt"
"io/ioutil"
@@ -14,8 +15,6 @@ import (
"github.com/skia-dev/glog"
- "strings"
-
"go.skia.org/infra/ct/go/util"
"go.skia.org/infra/ct/go/worker_scripts/worker_common"
"go.skia.org/infra/go/common"
@@ -159,24 +158,34 @@ func main() {
mutex.RLock()
- pagesetBaseName := filepath.Base(pagesetName)
// Convert the filename into a format consumable by the run_benchmarks
// binary.
- pagesetNameNoExt := strings.TrimSuffix(pagesetBaseName, filepath.Ext(pagesetBaseName))
pagesetPath := filepath.Join(pathToPagesets, pagesetName)
+ pagesetContent, err := os.Open(pagesetPath)
+ if err != nil {
+ glog.Errorf("Could not read %s: %s", pagesetPath, err)
+ continue
+ }
+ decodedPageset := util.PagesetVars{}
+ if err := json.NewDecoder(pagesetContent).Decode(&decodedPageset); err != nil {
+ glog.Errorf("Could not JSON decode %s: %s", pagesetPath, err)
+ continue
+ }
+
glog.Infof("===== Processing %s =====", pagesetPath)
skutil.LogErr(os.Chdir(pathToPyFiles))
args := []string{
- util.BINARY_RUN_BENCHMARK,
- fmt.Sprintf("%s.%s", util.BENCHMARK_SKPICTURE_PRINTER, util.BenchmarksToPagesetName[util.BENCHMARK_SKPICTURE_PRINTER]),
- "--page-set-name=" + pagesetNameNoExt,
- "--page-set-base-dir=" + pathToPagesets,
+ filepath.Join(util.TelemetryBinariesDir, util.BINARY_RUN_BENCHMARK),
+ util.BenchmarksToPagesetName[util.BENCHMARK_SKPICTURE_PRINTER],
"--also-run-disabled-tests",
"--page-repeat=1", // Only need one run for SKPs.
"--skp-outdir=" + pathToSkps,
"--extra-browser-args=" + util.DEFAULT_BROWSER_ARGS,
+ "--user-agent=" + decodedPageset.UserAgent,
+ "--urls-list=" + decodedPageset.UrlsList,
+ "--archive-data-file=" + decodedPageset.ArchiveDataFile,
}
// Figure out which browser should be used.
if *targetPlatform == util.PLATFORM_ANDROID {

Powered by Google App Engine
This is Rietveld 408576698