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 { |