From 6693537f95ae6805da62a46530a704f88a442550 Mon Sep 17 00:00:00 2001 From: Andrey Lushnikov Date: Thu, 8 Nov 2018 18:34:18 -0800 Subject: [PATCH] chore: add utils/bisect.js to bisect chromium revisions (#3511) This patch adds a new utility - `utils/bisect.js` - that accepts a range of Chromium revisions and a pptr script and bisects the range to figure when the script breaks. The Puppeteer Script, given to the tool, should be exiting with non-zero code to signify malfunctioning. Example: ``` $ node utils/bisect.js --good 577361 --bad 599821 a.js ``` --- utils/bisect.js | 194 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100755 utils/bisect.js diff --git a/utils/bisect.js b/utils/bisect.js new file mode 100755 index 00000000000..6b4f2c69548 --- /dev/null +++ b/utils/bisect.js @@ -0,0 +1,194 @@ +#!/usr/bin/env node +/** + * Copyright 2018 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +const URL = require('url'); +const debug = require('debug'); +const pptr = require('..'); +const browserFetcher = pptr.createBrowserFetcher(); +const path = require('path'); +const fs = require('fs'); +const {fork} = require('child_process'); + +const COLOR_RESET = '\x1b[0m'; +const COLOR_RED = '\x1b[31m'; +const COLOR_GREEN = '\x1b[32m'; +const COLOR_YELLOW = '\x1b[33m'; + +const argv = require('minimist')(process.argv.slice(2), {}); + +const help = ` +Usage: + node bisect.js --good --bad