From 2059ea90309fe2d250df0d51e2e7196298457237 Mon Sep 17 00:00:00 2001 From: Fabian Wiles Date: Sat, 14 Sep 2019 08:15:59 +1200 Subject: [PATCH] feat(builtin): enable coverage on nodejs_test BREAKING CHANGE: jasmine_node_test not longer has the `coverage` attribute --- BUILD.bazel | 1 + common.bazelrc | 4 + e2e/jasmine/BUILD.bazel | 9 - e2e/jasmine/coverage.spec.js | 10 - internal/coverage/BUILD.bazel | 40 ++++ internal/coverage/lcov_merger-js.js | 70 +++++++ internal/coverage/lcov_merger.sh | 24 +++ internal/coverage/lcov_merger.ts | 112 +++++++++++ internal/node/launcher.sh | 73 ++++++-- internal/node/node.bzl | 17 ++ package.json | 14 +- packages/jasmine/src/jasmine_node_test.bzl | 8 +- packages/jasmine/src/jasmine_runner.js | 76 +------- packages/jasmine/src/package.json | 2 +- packages/jasmine/test/BUILD.bazel | 9 +- packages/jasmine/test/coverage_source.js | 9 - .../jasmine/test/coverage_source.ts | 4 +- packages/terser/test/exec/BUILD.bazel | 1 - yarn.lock | 176 ++++++------------ 19 files changed, 413 insertions(+), 246 deletions(-) delete mode 100644 e2e/jasmine/coverage.spec.js create mode 100644 internal/coverage/BUILD.bazel create mode 100644 internal/coverage/lcov_merger-js.js create mode 100755 internal/coverage/lcov_merger.sh create mode 100644 internal/coverage/lcov_merger.ts delete mode 100644 packages/jasmine/test/coverage_source.js rename e2e/jasmine/coverage_source.js => packages/jasmine/test/coverage_source.ts (60%) diff --git a/BUILD.bazel b/BUILD.bazel index 0534a756f0..a56e2b873d 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -77,6 +77,7 @@ pkg_npm( "//internal/bazel_integration_test:package_contents", "//internal/common:package_contents", "//internal/copy_repository:package_contents", + "//internal/coverage:package_contents", "//internal/golden_file_test:package_contents", "//internal/js_library:package_contents", "//internal/linker:package_contents", diff --git a/common.bazelrc b/common.bazelrc index 19e6d72d13..0f94d61c26 100644 --- a/common.bazelrc +++ b/common.bazelrc @@ -76,6 +76,10 @@ common --experimental_allow_incremental_repository_updates build --incompatible_strict_action_env run --incompatible_strict_action_env +# When running `bazel coverage` --instrument_test_targets needs to be set in order to +# collect coverage information from test targets +coverage --instrument_test_targets + # Load any settings specific to the current user. # .bazelrc.user should appear in .gitignore so that settings are not shared with team members # This needs to be last statement in this diff --git a/e2e/jasmine/BUILD.bazel b/e2e/jasmine/BUILD.bazel index 707b58abef..7684c48fb7 100644 --- a/e2e/jasmine/BUILD.bazel +++ b/e2e/jasmine/BUILD.bazel @@ -18,12 +18,3 @@ jasmine_node_test( "@npm//zone.js", ], ) - -jasmine_node_test( - name = "coverage_test", - srcs = [ - "coverage.spec.js", - "coverage_source.js", - ], - coverage = True, -) diff --git a/e2e/jasmine/coverage.spec.js b/e2e/jasmine/coverage.spec.js deleted file mode 100644 index a0151a1df6..0000000000 --- a/e2e/jasmine/coverage.spec.js +++ /dev/null @@ -1,10 +0,0 @@ -const {isString} = require('./coverage_source'); - -describe('coverage function', () => { - it('should cover one branch', () => { - expect(isString(2)).toBe(false); - }); - it('should cover the other branch', () => { - expect(isString('some string')).toBe(true); - }); -}); diff --git a/internal/coverage/BUILD.bazel b/internal/coverage/BUILD.bazel new file mode 100644 index 0000000000..29b8606d2a --- /dev/null +++ b/internal/coverage/BUILD.bazel @@ -0,0 +1,40 @@ +load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary") + +exports_files([ + "lcov_merger-js.js", +]) + +# BEGIN-INTERNAL +load("//packages/typescript:checked_in_ts_project.bzl", "checked_in_ts_project") + +checked_in_ts_project( + name = "lcov_merger_js_lib", + src = "lcov_merger.ts", + checked_in_js = "lcov_merger-js.js", + visibility = ["//visibility:public"], + deps = ["@npm//@types/node"], +) +# END-INTERNAL + +nodejs_binary( + name = "lcov_merger_js", + entry_point = "lcov_merger.js", + visibility = ["//visibility:public"], +) + +sh_binary( + name = "lcov_merger_sh", + srcs = ["lcov_merger.sh"], + visibility = ["//visibility:public"], +) + +filegroup( + name = "package_contents", + srcs = glob([ + "*.sh", + "*.js", + ]) + [ + "BUILD.bazel", + ], + visibility = ["//:__pkg__"], +) diff --git a/internal/coverage/lcov_merger-js.js b/internal/coverage/lcov_merger-js.js new file mode 100644 index 0000000000..7d6ac99d77 --- /dev/null +++ b/internal/coverage/lcov_merger-js.js @@ -0,0 +1,70 @@ +/* THIS FILE GENERATED FROM .ts; see BUILD.bazel */ /* clang-format off */"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto = require("crypto"); +const fs = require("fs"); +const path = require("path"); +function _getArg(argv, key) { + return argv.find(a => a.startsWith(key)).split('=')[1]; +} +function main() { + return __awaiter(this, void 0, void 0, function* () { + const argv = process.argv; + const coverageDir = _getArg(argv, '--coverage_dir='); + const outputFile = _getArg(argv, '--output_file='); + const sourceFileManifest = _getArg(argv, '--source_file_manifest='); + const tmpdir = process.env.TEST_TMPDIR; + if (!sourceFileManifest || !tmpdir || !outputFile) { + throw new Error(); + } + const instrumentedSourceFiles = fs.readFileSync(sourceFileManifest).toString('utf8').split('\n'); + const c8OutputDir = path.join(tmpdir, crypto.randomBytes(4).toString('hex')); + fs.mkdirSync(c8OutputDir); + const includes = instrumentedSourceFiles + .filter(f => ['.js', '.jsx', '.cjs', '.ts', '.tsx', '.mjs'].includes(path.extname(f))) + .map(f => { + const p = path.parse(f); + let targetExt; + switch (p.ext) { + case '.mjs': + targetExt = '.mjs'; + default: + targetExt = '.js'; + } + return path.format(Object.assign(Object.assign({}, p), { base: undefined, ext: targetExt })); + }); + let c8; + try { + c8 = require('c8'); + } + catch (e) { + if (e.code == 'MODULE_NOT_FOUND') { + console.error('ERROR: c8 npm package is required for bazel coverage'); + process.exit(1); + } + throw e; + } + yield new c8 + .Report({ + include: includes, + exclude: includes.length === 0 ? ['**'] : [], + reportsDirectory: c8OutputDir, + tempDirectory: coverageDir, + resolve: '', + reporter: ['lcovonly'] + }) + .run(); + fs.copyFileSync(path.join(c8OutputDir, 'lcov.info'), outputFile); + }); +} +if (require.main === module) { + main(); +} diff --git a/internal/coverage/lcov_merger.sh b/internal/coverage/lcov_merger.sh new file mode 100755 index 0000000000..539b5ff1ac --- /dev/null +++ b/internal/coverage/lcov_merger.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +# @license +# Copyright 2017 The Bazel Authors. 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. + +# This is a workaround for bazelbuild/bazel#6293. Since Bazel 0.18.0, Bazel +# expects tests to have an "$lcov_merger' or "_lcov_merger" attribute that +# points to an executable. If this is missing, the test driver fails. + +# Copied from https://github.com/bazelbuild/rules_go/blob/64c97b54ea2918fc7f1a59d68cd27d1fdb0bd663/go/tools/builders/lcov_merger.sh + +exit 0 \ No newline at end of file diff --git a/internal/coverage/lcov_merger.ts b/internal/coverage/lcov_merger.ts new file mode 100644 index 0000000000..1185dd7c8c --- /dev/null +++ b/internal/coverage/lcov_merger.ts @@ -0,0 +1,112 @@ +/** + * @license + * Copyright 2017 The Bazel Authors. 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. + */ + +import * as crypto from 'crypto'; +import * as fs from 'fs'; +import * as path from 'path'; + +function _getArg(argv: string[], key: string): string { + return argv.find(a => a.startsWith(key))!.split('=')[1]; +} + +/** + * This is designed to collect the coverage of one target, since in nodejs + * and using NODE_V8_COVERAGE it may produce more than one coverage file, however bazel expects + * there to be only one lcov file. So this collects up the v8 coverage json's merges them and + * converts them to lcov for bazel to pick up later. + */ +async function main() { + // Using the standard args for a bazel lcov merger binary: + // https://github.com/bazelbuild/bazel/blob/master/tools/test/collect_coverage.sh#L175-L181 + const argv = process.argv; + const coverageDir = _getArg(argv, '--coverage_dir='); + const outputFile = _getArg(argv, '--output_file='); + const sourceFileManifest = _getArg(argv, '--source_file_manifest='); + const tmpdir = process.env.TEST_TMPDIR; + + if (!sourceFileManifest || !tmpdir || !outputFile) { + throw new Error(); + } + + const instrumentedSourceFiles = fs.readFileSync(sourceFileManifest).toString('utf8').split('\n'); + // c8 will name the output report file lcov.info + // so we give it a dir that it can write to + // later on we'll move and rename it into output_file as bazel expects + const c8OutputDir = path.join(tmpdir!, crypto.randomBytes(4).toString('hex')); + fs.mkdirSync(c8OutputDir); + + const includes = + instrumentedSourceFiles + // the manifest may include files such as .bash so we want to reduce that down to the set + // we can run coverage on in JS + .filter(f => ['.js', '.jsx', '.cjs', '.ts', '.tsx', '.mjs'].includes(path.extname(f))) + .map(f => { + // at runtime we only run .js or .mjs + // meaning that the coverage written by v8 will only include urls to .js or .mjs + // so the source files need to be mapped from their input to output extensions + // TODO: how do we know what source files produce .mjs or .cjs? + const p = path.parse(f); + let targetExt; + switch (p.ext) { + case '.mjs': + targetExt = '.mjs'; + default: + targetExt = '.js'; + } + + return path.format({...p, base: undefined, ext: targetExt}); + }); + + // only require in c8 when we're actually going to do some coverage + let c8; + try { + c8 = require('c8'); + } catch (e) { + if (e.code == 'MODULE_NOT_FOUND') { + console.error('ERROR: c8 npm package is required for bazel coverage'); + process.exit(1); + } + throw e; + } + // see https://github.com/bcoe/c8/blob/master/lib/report.js + // for more info on this function + // TODO: enable the --all functionality + await new c8 + .Report({ + include: includes, + // the test-exclude lib will include everything if our includes array is empty + // so instead when it's empty exclude everything + // but when it does have a value, we only want to use those includes, so don't exclude + // anything + exclude: includes.length === 0 ? ['**'] : [], + reportsDirectory: c8OutputDir, + // tempDirectory as actually the dir that c8 will read from for the v8 json files + tempDirectory: coverageDir, + resolve: '', + // TODO: maybe add an attribute to allow more reporters + // or maybe an env var? + reporter: ['lcovonly'] + }) + .run(); + // moves the report into the files bazel expects + // lcovonly names this file lcov.info + fs.copyFileSync(path.join(c8OutputDir, 'lcov.info'), outputFile); +} + +if (require.main === module) { + main(); +} diff --git a/internal/node/launcher.sh b/internal/node/launcher.sh index 61eec6d1ff..4f475a6ac0 100644 --- a/internal/node/launcher.sh +++ b/internal/node/launcher.sh @@ -158,6 +158,7 @@ MAIN=$(rlocation "TEMPLATED_loader_script") readonly repository_args=$(rlocation "TEMPLATED_repository_args") readonly link_modules_script=$(rlocation "TEMPLATED_link_modules_script") +readonly lcov_merger_script=$(rlocation "TEMPLATED_lcov_merger_script") node_patches_script=$(rlocation "TEMPLATED_node_patches_script") require_patch_script=${BAZEL_NODE_PATCH_REQUIRE} @@ -254,31 +255,67 @@ fi # a binary fails to run. Otherwise any failure would make such a test # fail before we could assert that we expected that failure. readonly EXPECTED_EXIT_CODE="TEMPLATED_expected_exit_code" -if [ "${EXPECTED_EXIT_CODE}" -eq "0" ]; then - # Replace the current process (bash) with a node process. - # This means that stdin, stdout, signals, etc will be transparently - # handled by the node process. - # If we had merely forked a child process here, we'd be responsible - # for forwarding those OS interactions. - exec "${node}" "${LAUNCHER_NODE_OPTIONS[@]:-}" "${USER_NODE_OPTIONS[@]:-}" "${MAIN}" ${ARGS[@]+"${ARGS[@]}"} - # exec terminates execution of this shell script, nothing later will run. + +if [[ -n "${COVERAGE_DIR:-}" ]]; then + if [[ -n "${VERBOSE_LOGS:-}" ]]; then + echo "Turning on node coverage with NODE_V8_COVERAGE=${COVERAGE_DIR}" + fi + # Setting NODE_V8_COVERAGE=${COVERAGE_DIR} causes NodeJS to write coverage + # information our to the COVERAGE_DIR once the process exits + export NODE_V8_COVERAGE=${COVERAGE_DIR} fi +# Bash does not forward termination signals to any child process when +# running in docker so need to manually trap and forward the signals +_term() { + kill -TERM "${child}" 2>/dev/null +} + +_int() { + kill -INT "${child}" 2>/dev/null +} + +# Execute the main program set +e -"${node}" "${LAUNCHER_NODE_OPTIONS[@]:-}" "${USER_NODE_OPTIONS[@]:-}" "${MAIN}" ${ARGS[@]+"${ARGS[@]}"} +"${node}" "${LAUNCHER_NODE_OPTIONS[@]:-}" "${USER_NODE_OPTIONS[@]:-}" "${MAIN}" ${ARGS[@]+"${ARGS[@]}"} <&0 & +readonly child=$! +trap _term SIGTERM +trap _int SIGINT +wait "${child}" RESULT="$?" set -e -if [ ${RESULT} != ${EXPECTED_EXIT_CODE} ]; then - echo "Expected exit code to be ${EXPECTED_EXIT_CODE}, but got ${RESULT}" >&2 - if [ "${RESULT}" -eq "0" ]; then - # This exit code is handled specially by Bazel: - # https://github.com/bazelbuild/bazel/blob/486206012a664ecb20bdb196a681efc9a9825049/src/main/java/com/google/devtools/build/lib/util/ExitCode.java#L44 - readonly BAZEL_EXIT_TESTS_FAILED=3; - exit ${BAZEL_EXIT_TESTS_FAILED} +if [ "${EXPECTED_EXIT_CODE}" != "0" ]; then + if [ ${RESULT} != ${EXPECTED_EXIT_CODE} ]; then + echo "Expected exit code to be ${EXPECTED_EXIT_CODE}, but got ${RESULT}" >&2 + if [ "${RESULT}" -eq "0" ]; then + # This exit code is handled specially by Bazel: + # https://github.com/bazelbuild/bazel/blob/486206012a664ecb20bdb196a681efc9a9825049/src/main/java/com/google/devtools/build/lib/util/ExitCode.java#L44 + readonly BAZEL_EXIT_TESTS_FAILED=3; + exit ${BAZEL_EXIT_TESTS_FAILED} + fi + else + exit 0 + fi +fi + +# Post process the coverage information after the process has exited +if [[ -n "${COVERAGE_DIR:-}" ]]; then + if [[ -n "${VERBOSE_LOGS:-}" ]]; then + echo "Running coverage lcov merger script with arguments" + echo " --coverage_dir="${COVERAGE_DIR}"" + echo " --output_file="${COVERAGE_OUTPUT_FILE}"" + echo " --source_file_manifest="${COVERAGE_MANIFEST}"" + fi + + set +e + "${node}" "${lcov_merger_script}" --coverage_dir="${COVERAGE_DIR}" --output_file="${COVERAGE_OUTPUT_FILE}" --source_file_manifest="${COVERAGE_MANIFEST}" + RESULT="$?" + set -e + + if [ ${RESULT} -ne 0 ]; then + exit ${RESULT} fi -else - exit 0 fi exit ${RESULT} \ No newline at end of file diff --git a/internal/node/node.bzl b/internal/node/node.bzl index fd3d583ae3..e83de69d97 100644 --- a/internal/node/node.bzl +++ b/internal/node/node.bzl @@ -225,6 +225,7 @@ fi node_tool_files.append(ctx.file._link_modules_script) node_tool_files.append(ctx.file._runfiles_helper_script) node_tool_files.append(ctx.file._node_patches_script) + node_tool_files.append(ctx.file._lcov_merger_script) node_tool_files.append(node_modules_manifest) is_builtin = ctx.attr._node.label.workspace_name in ["nodejs_%s" % p for p in BUILT_IN_NODE_PLATFORMS] @@ -248,6 +249,7 @@ fi "TEMPLATED_args": " ".join(expanded_args), "TEMPLATED_env_vars": env_vars, "TEMPLATED_expected_exit_code": str(expected_exit_code), + "TEMPLATED_lcov_merger_script": _to_manifest_path(ctx, ctx.file._lcov_merger_script), "TEMPLATED_link_modules_script": _to_manifest_path(ctx, ctx.file._link_modules_script), "TEMPLATED_loader_script": _to_manifest_path(ctx, ctx.outputs.loader_script), "TEMPLATED_modules_manifest": _to_manifest_path(ctx, node_modules_manifest), @@ -315,6 +317,11 @@ fi deps = depset([ctx.file.entry_point], transitive = [node_modules, sources]), pkgs = ctx.attr.data, ), + # indicates that the this binary should be instrumented by coverage + # see https://docs.bazel.build/versions/master/skylark/lib/coverage_common.html + # since this will be called from a nodejs_test, where the entrypoint is going to be the test file + # we shouldn't add the entrypoint as a attribute to collect here + coverage_common.instrumented_files_info(ctx, dependency_attributes = ["data"], extensions = ["js", "ts"]), ] _NODEJS_EXECUTABLE_ATTRS = { @@ -561,6 +568,10 @@ Predefined genrule variables are not supported in this context. default = Label("//internal/node:launcher.sh"), allow_single_file = True, ), + "_lcov_merger_script": attr.label( + default = Label("//internal/coverage:lcov_merger-js.js"), + allow_single_file = True, + ), "_link_modules_script": attr.label( default = Label("//internal/linker:index.js"), allow_single_file = True, @@ -628,6 +639,12 @@ nodejs_test = rule( doc = "The expected exit code for the test. Defaults to 0.", default = 0, ), + # See the content of lcov_merger_sh for the reason we need this + "_lcov_merger": attr.label( + executable = True, + default = Label("@build_bazel_rules_nodejs//internal/coverage:lcov_merger_sh"), + cfg = "target", + ), }), doc = """ Identical to `nodejs_binary`, except this can be used with `bazel test` as well. diff --git a/package.json b/package.json index fcc6a54051..6e8b7885c1 100644 --- a/package.json +++ b/package.json @@ -74,27 +74,27 @@ "protractor": "^5.4.2", "requirejs": "2.3.6", "rollup": "1.3.1", - "rollup-plugin-amd": "^3.0.0", - "rollup-plugin-commonjs": "^9.2.1", + "rollup-plugin-amd": "3.0.0", + "rollup-plugin-commonjs": "9.3.4", "rollup-plugin-json": "4.0.0", - "rollup-plugin-node-resolve": "~4.2.0", + "rollup-plugin-node-resolve": "4.2.4", "rxjs": "^6.5.2", "semver": "5.6.0", "shelljs": "0.8.3", "sinon": "^7.3.2", "source-map": "^0.7.3", "source-map-support": "0.5.9", - "terser": "^4.4.0", + "terser": "4.4.0", "testy": "file:./tools/npm_packages/testy", "tmp": "0.1.0", - "ts-lit-plugin": "^1.1.9", + "ts-lit-plugin": "1.1.9", "tsickle": "0.38.0", "tsutils": "2.27.2", "typeorm": "0.2.18", "typescript": "^3.7.5", "unidiff": "1.0.1", - "v8-coverage": "1.0.9", - "yarn": "1.22.0", + "yarn": "1.21.1", + "c8": "7.1.0", "zone.js": "0.8.29" }, "// resolutions/**/jest-serializer": "need to resolve to a version that doesn't have a /// in build/index.d.ts which exposes a bug in ts_library", diff --git a/packages/jasmine/src/jasmine_node_test.bzl b/packages/jasmine/src/jasmine_node_test.bzl index a1706fa971..7ecd3399ef 100644 --- a/packages/jasmine/src/jasmine_node_test.bzl +++ b/packages/jasmine/src/jasmine_node_test.bzl @@ -62,7 +62,6 @@ def jasmine_node_test( expected_exit_code = 0, tags = [], config_file = None, - coverage = False, # Replaced by pkg_npm with jasmine = "@npm//@bazel/jasmine", jasmine = "@npm_bazel_jasmine//:jasmine__pkg", # Replaced by pkg_npm with jasmine_entry_point = "@npm//:node_modules/@bazel/jasmine/jasmine_runner.js", @@ -92,11 +91,13 @@ def jasmine_node_test( See https://jasmine.github.io/setup/nodejs.html#configuration - coverage: Enables code coverage collection and reporting. jasmine: A label providing the `@bazel/jasmine` npm dependency. jasmine_entry_point: A label providing the `@bazel/jasmine` entry point. **kwargs: Remaining arguments are passed to the test rule """ + if kwargs.pop("coverage", False): + fail("The coverage attribute has been removed, run your target with \"bazel coverage\" instead") + _devmode_js_sources( name = "%s_devmode_srcs" % name, srcs = srcs + deps, @@ -110,7 +111,7 @@ def jasmine_node_test( # Only used when running tests in the rules_nodejs repo. # Avoid adding duplicate deps though, some rules use this from source and declared the dep if not "@npm//jasmine" in all_data and not str(Label("@npm//jasmine")) in all_data and not "no-local-jasmine-deps" in tags: - all_data.extend(["@npm//jasmine", "@npm//jasmine-reporters", "@npm//v8-coverage"]) + all_data.extend(["@npm//jasmine", "@npm//jasmine-reporters", "@npm//c8"]) # END-INTERNAL all_data += [":%s_devmode_srcs.MF" % name] @@ -121,7 +122,6 @@ def jasmine_node_test( # specs to consume. templated_args = [ "$(rootpath :%s_devmode_srcs.MF)" % name, - "--coverage" if coverage else "--nocoverage", "$(rootpath %s)" % config_file if config_file else "--noconfig", ] + kwargs.pop("templated_args", []) diff --git a/packages/jasmine/src/jasmine_runner.js b/packages/jasmine/src/jasmine_runner.js index 0d9ed4f7ae..8124b29153 100644 --- a/packages/jasmine/src/jasmine_runner.js +++ b/packages/jasmine/src/jasmine_runner.js @@ -62,26 +62,20 @@ function readArg() { } function main(args) { - if (args.length < 3) { + if (args.length < 2) { throw new Error('expected argument missing'); } // first args is always the path to the manifest const manifest = runfiles.resolveWorkspaceRelative(readArg()); - // second is always a flag to enable coverage or not - const coverageArg = readArg(); - const enableCoverage = coverageArg === '--coverage'; // config file is the next arg const configFile = readArg(); - // the relative directory the coverage reporter uses to find anf filter the files - const cwd = process.cwd(); - const jrunner = new JasmineRunner({jasmineCore: jasmineCore}); if (configFile !== '--noconfig') { jrunner.loadConfigFile(runfiles.resolveWorkspaceRelative(configFile)); } - const allFiles = fs.readFileSync(manifest, UTF8) + fs.readFileSync(manifest, UTF8) .split('\n') .filter(l => l.length > 0) // Filter out files from node_modules @@ -89,15 +83,13 @@ function main(args) { // Use runfiles resolve to resolve the file path that // bazel passes to the runner to its absolute path .map(f => runfiles.resolveWorkspaceRelative(f)) - - allFiles - // Filter here so that only files ending in `spec.js` and `test.js` - // are added to jasmine as spec files. This is important as other - // deps such as "@npm//typescript" if executed may cause the test to - // fail or have unexpected side-effects. "@npm//typescript" would - // try to execute tsc, print its help, and process.exit(1) - .filter(f => IS_TEST_FILE.test(f)) - .forEach(f => jrunner.addSpecFile(f)); + // Filter here so that only files ending in `spec.js` and `test.js` + // are added to jasmine as spec files. This is important as other + // deps such as "@npm//typescript" if executed may cause the test to + // fail or have unexpected side-effects. "@npm//typescript" would + // try to execute tsc, print its help, and process.exit(1) + .filter(f => IS_TEST_FILE.test(f)) + .forEach(f => jrunner.addSpecFile(f)); var noSpecsFound = true; jrunner.addReporter({ @@ -124,59 +116,11 @@ function main(args) { // so we need to add it back jrunner.configureDefaultReporter({}); - let covExecutor; - let covDir; - if (enableCoverage) { - // lazily pull these deps in for only when we want to collect coverage - const crypto = require('crypto'); - const Execute = require('v8-coverage/src/execute'); - - // Filter out all .spec and .test files so we only report coverage against the source files - const sourceFiles = allFiles - .filter(f => !IS_TEST_FILE.test(f)) - // the jasmine_runner.js gets in here as a file to run - .filter(f => !f.endsWith('jasmine_runner.js')) - // the reporting lib resolves the relative path to our cwd instead of - // using the absolute one so match it here - .map(f => path.relative(cwd, f)) - - // make a tmpdir inside our tmpdir for just this run - covDir = path.join(process.env['TEST_TMPDIR'], String(crypto.randomBytes(4).readUInt32LE(0))); - covExecutor = new Execute({include: sourceFiles, exclude: []}); - covExecutor.startProfiler(); - } - jrunner.onComplete((passed) => { let exitCode = passed ? 0 : BAZEL_EXIT_TESTS_FAILED; if (noSpecsFound) exitCode = BAZEL_EXIT_NO_TESTS_FOUND; - if (enableCoverage) { - const Report = require('v8-coverage/src/report'); - covExecutor.stopProfiler((err, data) => { - if (err) { - console.error(err); - process.exit(1); - } - const sourceCoverge = covExecutor.filterResult(data.result); - // we could do this all in memory if we wanted - // just take a look at v8-coverage/src/report.js and reimplement some of those methods - // but we're going to have to write a file at some point for bazel coverage - // so may as well support it now - // the lib expects these paths to exist for some reason - fs.mkdirSync(covDir); - fs.mkdirSync(path.join(covDir, 'tmp')); - // only do a text summary for now - // once we know what format bazel coverage wants we can output - // lcov or some other format - const report = new Report(covDir, ['text-summary']); - report.store(sourceCoverge); - report.generateReport(); - - process.exit(exitCode); - }); - } else { - process.exit(exitCode); - } + process.exit(exitCode); }); if (TOTAL_SHARDS) { diff --git a/packages/jasmine/src/package.json b/packages/jasmine/src/package.json index 1a7468fdb1..8d81e8a389 100644 --- a/packages/jasmine/src/package.json +++ b/packages/jasmine/src/package.json @@ -20,7 +20,7 @@ "jasmine": "~3.5.0", "jasmine-core": "~3.5.0", "jasmine-reporters": "~2.3.2", - "v8-coverage": "1.0.9" + "c8": "~7.1.0" }, "bazelWorkspaces": { "npm_bazel_jasmine": { diff --git a/packages/jasmine/test/BUILD.bazel b/packages/jasmine/test/BUILD.bazel index cd6f20c0b0..f17f7bea7c 100644 --- a/packages/jasmine/test/BUILD.bazel +++ b/packages/jasmine/test/BUILD.bazel @@ -1,5 +1,6 @@ load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") load("//internal/common:copy_to_bin.bzl", "copy_to_bin") +load("//packages/typescript:index.bzl", "ts_library") jasmine_node_test( name = "underscore_spec_test", @@ -106,13 +107,17 @@ jasmine_node_test( expected_exit_code = 3, ) +ts_library( + name = "coverage_test_srcs", + srcs = ["coverage_source.ts"], +) + jasmine_node_test( name = "coverage_test", srcs = [ "coverage.spec.js", - "coverage_source.js", + ":coverage_test_srcs", ], - coverage = True, ) jasmine_node_test( diff --git a/packages/jasmine/test/coverage_source.js b/packages/jasmine/test/coverage_source.js deleted file mode 100644 index aac2ee3afe..0000000000 --- a/packages/jasmine/test/coverage_source.js +++ /dev/null @@ -1,9 +0,0 @@ -function isString(input) { - if (typeof input === 'string') { - return true; - } else { - return false; - } -} - -exports.isString = isString; diff --git a/e2e/jasmine/coverage_source.js b/packages/jasmine/test/coverage_source.ts similarity index 60% rename from e2e/jasmine/coverage_source.js rename to packages/jasmine/test/coverage_source.ts index 7d29ee1ceb..45f569b949 100644 --- a/e2e/jasmine/coverage_source.js +++ b/packages/jasmine/test/coverage_source.ts @@ -1,9 +1,7 @@ -function isString(input) { +export function isString(input: string) { if (typeof input === 'string') { return true; } else { return false; } } - -exports.isString = isString; diff --git a/packages/terser/test/exec/BUILD.bazel b/packages/terser/test/exec/BUILD.bazel index 5e689b8e71..ed70e5dc6a 100644 --- a/packages/terser/test/exec/BUILD.bazel +++ b/packages/terser/test/exec/BUILD.bazel @@ -3,7 +3,6 @@ load("@npm_bazel_jasmine//:index.bzl", "jasmine_node_test") jasmine_node_test( name = "test", srcs = ["spec.js"], - coverage = True, data = [ "//packages/terser:index.js", ], diff --git a/yarn.lock b/yarn.lock index 7a3d6c3def..9355acebf1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1573,6 +1573,11 @@ resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.35.tgz#7b7c950c7d54593e23bffc8d2b4feba9866a7277" integrity sha512-4mUIMSZ2U4UOWq1b+iV7XUTE4w+Kr3x+Zb/Qz5ROO6BTZLw2c8/ftjq0aRgluguLs4KRuBnrOy/s389HVn1/zA== +"@types/is-windows@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/is-windows/-/is-windows-1.0.0.tgz#1011fa129d87091e2f6faf9042d6704cdf2e7be0" + integrity sha512-tJ1rq04tGKuIJoWIH0Gyuwv4RQ3+tIu7wQrC0MV47raQ44kIzXSSFKfrxFUOWVRvesoF7mrTqigXmqoZJsXwTg== + "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff" @@ -2432,6 +2437,25 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +c8@7.1.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/c8/-/c8-7.1.0.tgz#3978192fd94b0349bffd0ffd12b87b3219386c38" + integrity sha512-r4ba14DehwROz7Sm/JpwqL+s2FGGMiVmgnhAtYJ/jQcPpR7L+yEO3MUoQXHOFBetqd+mpTY5XiNY79QY6bYpnw== + dependencies: + "@bcoe/v8-coverage" "^0.2.3" + "@istanbuljs/schema" "^0.1.2" + find-up "^4.0.0" + foreground-child "^2.0.0" + furi "^2.0.0" + istanbul-lib-coverage "^3.0.0" + istanbul-lib-report "^3.0.0" + istanbul-reports "^3.0.0" + rimraf "^3.0.0" + test-exclude "^6.0.0" + v8-to-istanbul "^4.1.2" + yargs "^15.0.0" + yargs-parser "^16.0.0" + cacache@^12.0.0, cacache@^12.0.2, cacache@^12.0.3: version "12.0.3" resolved "https://registry.yarnpkg.com/cacache/-/cacache-12.0.3.tgz#be99abba4e1bf5df461cd5a2c1071fc432573390" @@ -3196,14 +3220,6 @@ create-error-class@^3.0.0: dependencies: capture-stack-trace "^1.0.0" -cross-spawn@^4: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - integrity sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE= - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - cross-spawn@^5.0.1: version "5.1.0" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" @@ -4158,13 +4174,13 @@ for-in@^1.0.2: resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -foreground-child@^1.5.6: - version "1.5.6" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" - integrity sha1-T9ca0t/elnibmApcCilZN8svXOk= +foreground-child@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-2.0.0.tgz#71b32800c9f15aa8f2f83f4a6bd9bff35d861a53" + integrity sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA== dependencies: - cross-spawn "^4" - signal-exit "^3.0.0" + cross-spawn "^7.0.0" + signal-exit "^3.0.2" forever-agent@~0.6.1: version "0.6.1" @@ -4301,6 +4317,14 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +furi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/furi/-/furi-2.0.0.tgz#13d85826a1af21acc691da6254b3888fc39f0b4a" + integrity sha512-uKuNsaU0WVaK/vmvj23wW1bicOFfyqSsAIH71bRZx8kA4Xj+YCHin7CJKJJjkIsmxYaPFLk9ljmjEyB7xF7WvQ== + dependencies: + "@types/is-windows" "^1.0.0" + is-windows "^1.0.2" + gauge@~2.7.3: version "2.7.4" resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7" @@ -4576,7 +4600,7 @@ grpc-web@^1.0.7: resolved "https://registry.yarnpkg.com/grpc-web/-/grpc-web-1.0.7.tgz#9e4fbcf63d3734515332ab59e42baa7d0d290015" integrity sha512-Fkbz1nyvvt6GC6ODcxh9Fen6LLB3OTCgGHzHwM2Eni44SUhzqPz1UQgFp9sfBEfInOhx3yBdwo9ZLjZAmJ+TtA== -handlebars@^4.0.3, handlebars@^4.1.2: +handlebars@^4.1.2: version "4.5.3" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.5.3.tgz#5cf75bd8714f7605713511a56be7c349becb0482" integrity sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA== @@ -4619,11 +4643,6 @@ has-cors@1.1.0: resolved "https://registry.yarnpkg.com/has-cors/-/has-cors-1.1.0.tgz#5e474793f7ea9843d1bb99c23eef49ff126fff39" integrity sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk= -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - integrity sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo= - has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" @@ -5352,11 +5371,6 @@ isstream@~0.1.2: resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= -istanbul-lib-coverage@^1.2.0, istanbul-lib-coverage@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.2.1.tgz#ccf7edcd0a0bb9b8f729feeb0930470f9af664f0" - integrity sha512-PzITeunAgyGbtY1ibVIUiV679EFChHjoMNRibEIobvmrCRaIgwLxNucOSimtNWUhEib/oO7QY2imD75JVgCJWQ== - istanbul-lib-coverage@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec" @@ -5375,16 +5389,6 @@ istanbul-lib-instrument@^4.0.0: istanbul-lib-coverage "^3.0.0" semver "^6.3.0" -istanbul-lib-report@^1.1.3: - version "1.1.5" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.5.tgz#f2a657fc6282f96170aaf281eb30a458f7f4170c" - integrity sha512-UsYfRMoi6QO/doUshYNqcKJqVmFe9w51GZz8BS3WB0lYxAllQYklka2wP9+dGZeHYaWIdcXUx8JGdbqaoXRXzw== - dependencies: - istanbul-lib-coverage "^1.2.1" - mkdirp "^0.5.1" - path-parse "^1.0.5" - supports-color "^3.1.2" - istanbul-lib-report@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" @@ -5403,14 +5407,7 @@ istanbul-lib-source-maps@^4.0.0: istanbul-lib-coverage "^3.0.0" source-map "^0.6.1" -istanbul-reports@^1.3.0: - version "1.5.1" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.5.1.tgz#97e4dbf3b515e8c484caea15d6524eebd3ff4e1a" - integrity sha512-+cfoZ0UXzWjhAdzosCPP3AN8vvef8XDkWtTfgaN+7L3YTpNYITnCaEkceo5SEYy644VkHka/P1FvkWvrG/rrJw== - dependencies: - handlebars "^4.0.3" - -istanbul-reports@^3.0.2: +istanbul-reports@^3.0.0, istanbul-reports@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.2.tgz#d593210e5000683750cb09fc0644e4b6e27fd53b" integrity sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw== @@ -7442,7 +7439,7 @@ optionator@^0.8.1: type-check "~0.3.2" wordwrap "~1.0.0" -os-homedir@^1.0.0, os-homedir@^1.0.1: +os-homedir@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= @@ -7724,7 +7721,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.5, path-parse@^1.0.6: +path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== @@ -8181,14 +8178,6 @@ read-pkg-up@^3.0.0: find-up "^2.0.0" read-pkg "^3.0.0" -read-pkg-up@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-4.0.0.tgz#1b221c6088ba7799601c808f91161c66e58f8978" - integrity sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA== - dependencies: - find-up "^3.0.0" - read-pkg "^3.0.0" - read-pkg@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" @@ -8593,7 +8582,7 @@ rimraf@^3.0.0: dependencies: glob "^7.1.3" -rollup-plugin-amd@^3.0.0: +rollup-plugin-amd@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/rollup-plugin-amd/-/rollup-plugin-amd-3.0.0.tgz#c09efa5e00ae092cfe581a62fb6f0b01bf788ec1" integrity sha512-nlazscW4UdlCKef12oxlombIWSicuHZDiY8fyU0dhpB7CQFb3JTX/qq17zDccn+K2QBbIvXlGdTusyQi5eMUIQ== @@ -8601,7 +8590,7 @@ rollup-plugin-amd@^3.0.0: "@buxlabs/amd-to-es6" "^0.12.0" rollup-pluginutils "^2.0.1" -rollup-plugin-commonjs@^9.2.1: +rollup-plugin-commonjs@9.3.4: version "9.3.4" resolved "https://registry.yarnpkg.com/rollup-plugin-commonjs/-/rollup-plugin-commonjs-9.3.4.tgz#2b3dddbbbded83d45c36ff101cdd29e924fd23bc" integrity sha512-DTZOvRoiVIHHLFBCL4pFxOaJt8pagxsVldEXBOn6wl3/V21wVaj17HFfyzTsQUuou3sZL3lEJZVWKPFblJfI6w== @@ -8618,7 +8607,7 @@ rollup-plugin-json@4.0.0: dependencies: rollup-pluginutils "^2.5.0" -rollup-plugin-node-resolve@~4.2.0: +rollup-plugin-node-resolve@4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-4.2.4.tgz#7d370f8d6fd3031006a0032c38262dd9be3c6250" integrity sha512-t/64I6l7fZ9BxqD3XlX4ZeO6+5RLKyfpwE2CiPNUKa+GocPlQhf/C208ou8y3AwtNsc6bjSk/8/6y/YAyxCIvw== @@ -9090,18 +9079,6 @@ sourcemap-codec@^1.4.8: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== -spawn-wrap@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.2.tgz#cff58e73a8224617b6561abdc32586ea0c82248c" - integrity sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg== - dependencies: - foreground-child "^1.5.6" - mkdirp "^0.5.0" - os-homedir "^1.0.1" - rimraf "^2.6.2" - signal-exit "^3.0.2" - which "^1.3.0" - spdx-correct@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" @@ -9401,13 +9378,6 @@ supports-color@^2.0.0: resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= -supports-color@^3.1.2: - version "3.2.3" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.2.3.tgz#65ac0504b3954171d8a64946b2ae3cbb8a5f54f6" - integrity sha1-ZawFBLOVQXHYpklGsq48u4pfVPY= - dependencies: - has-flag "^1.0.0" - supports-color@^5.2.0, supports-color@^5.3.0, supports-color@^5.5.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -9471,7 +9441,7 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser@^4.4.0: +terser@4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/terser/-/terser-4.4.0.tgz#22c46b4817cf4c9565434bfe6ad47336af259ac3" integrity sha512-oDG16n2WKm27JO8h4y/w3iqBGAOSCtq7k8dRmrn4Wf9NouL0b2WpMHGChFGZq4nFAQy1FsNJrVQHfurXOSTmOA== @@ -9480,16 +9450,6 @@ terser@^4.4.0: source-map "~0.6.1" source-map-support "~0.5.12" -test-exclude@^5.2.2: - version "5.2.3" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-5.2.3.tgz#c3d3e1e311eb7ee405e092dac10aefd09091eac0" - integrity sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g== - dependencies: - glob "^7.1.3" - minimatch "^3.0.4" - read-pkg-up "^4.0.0" - require-main-filename "^2.0.0" - test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -10014,31 +9974,7 @@ uuid@^3.3.3: resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -v8-coverage@1.0.9: - version "1.0.9" - resolved "https://registry.yarnpkg.com/v8-coverage/-/v8-coverage-1.0.9.tgz#780889680c0fea0f587adf22e2b5f443b9434745" - integrity sha512-JolsCH1JDI2QULrxkAGZaovJPvg/Q0p20Uj0F5N8fPtYDtz38gNBRPQ/WVXlLLd3d8WHvKN96AfE4XFk4u0g2g== - dependencies: - debug "^3.1.0" - foreground-child "^1.5.6" - istanbul-lib-coverage "^1.2.0" - istanbul-lib-report "^1.1.3" - istanbul-reports "^1.3.0" - mkdirp "^0.5.1" - rimraf "^2.6.2" - signal-exit "^3.0.2" - spawn-wrap "^1.4.2" - test-exclude "^5.2.2" - uuid "^3.3.2" - v8-to-istanbul "1.2.0" - yargs "^11.0.0" - -v8-to-istanbul@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-1.2.0.tgz#f6a22ffb08b2202aaba8c2be497d1d41fe8fb4b6" - integrity sha512-rVSmjdEfJmOHN8GYCbg+XUhbzXZr7DzdaXIslB9DdcopGZEMsW5x5qIdxr/8DcW7msULHNnvs/xUY1TszvhKRw== - -v8-to-istanbul@^4.0.1: +v8-to-istanbul@^4.0.1, v8-to-istanbul@^4.1.2: version "4.1.3" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-4.1.3.tgz#22fe35709a64955f49a08a7c7c959f6520ad6f20" integrity sha512-sAjOC+Kki6aJVbUOXJbcR0MnbfjvBzwKZazEJymA2IX49uoOdEdk+4fBq5cXgYgiyKtAyrrJNtBZdOeDIF+Fng== @@ -10404,6 +10340,14 @@ yargs-parser@^13.1.1: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^16.0.0: + version "16.1.0" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-16.1.0.tgz#73747d53ae187e7b8dbe333f95714c76ea00ecf1" + integrity sha512-H/V41UNZQPkUMIT5h5hiwg4QKIY1RPvoBV4XcjUbRM8Bk2oKqqyZ0DIEbTFZB0XjbtSPG8SAa/0DxCQmiRgzKg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs-parser@^18.1.0, yargs-parser@^18.1.1: version "18.1.2" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.2.tgz#2f482bea2136dbde0861683abea7756d30b504f1" @@ -10470,7 +10414,7 @@ yargs@^13.0.0, yargs@^13.2.1: y18n "^4.0.0" yargs-parser "^13.1.1" -yargs@^15.3.1: +yargs@^15.0.0, yargs@^15.3.1: version "15.3.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b" integrity sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA== @@ -10487,10 +10431,10 @@ yargs@^15.3.1: y18n "^4.0.0" yargs-parser "^18.1.1" -yarn@1.22.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.0.tgz#acf82906e36bcccd1ccab1cfb73b87509667c881" - integrity sha512-KMHP/Jq53jZKTY9iTUt3dIVl/be6UPs2INo96+BnZHLKxYNTfwMmlgHTaMWyGZoO74RI4AIFvnWhYrXq2USJkg== +yarn@1.21.1: + version "1.21.1" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.21.1.tgz#1d5da01a9a03492dc4a5957befc1fd12da83d89c" + integrity sha512-dQgmJv676X/NQczpbiDtc2hsE/pppGDJAzwlRiADMTvFzYbdxPj2WO4PcNyriSt2c4jsCMpt8UFRKHUozt21GQ== yeast@0.1.2: version "0.1.2"