From 88a280c2505759d4fb0c64a00845ea17633d2f03 Mon Sep 17 00:00:00 2001 From: Dzmitry Lemechko Date: Wed, 20 Nov 2024 16:41:30 +0100 Subject: [PATCH] [chore] remove unused nyc configs and dependencies (#200909) ## Summary nyc (istanbuljs) cleanup as we no longer collect code coverage for functional tests --- package.json | 4 -- renovate.json | 2 - .../nyc_config/nyc.functional.config.js | 39 ------------------- .../nyc_config/nyc.server.config.js | 34 ---------------- yarn.lock | 7 ---- 5 files changed, 86 deletions(-) delete mode 100644 src/dev/code_coverage/nyc_config/nyc.functional.config.js delete mode 100644 src/dev/code_coverage/nyc_config/nyc.server.config.js diff --git a/package.json b/package.json index 54a41747033a5..97b697d4bedf4 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,6 @@ "build": "node scripts/build --all-platforms", "build:apidocs": "node scripts/build_api_docs", "checkLicenses": "node scripts/check_licenses --dev", - "cover:functional:merge": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report/functional --reporter=json-summary", - "cover:report": "nyc report --temp-dir target/kibana-coverage/functional --report-dir target/coverage/report --reporter=lcov && open ./target/coverage/report/lcov-report/index.html", "debug": "node --nolazy --inspect scripts/kibana --dev", "debug-break": "node --nolazy --inspect-brk scripts/kibana --dev", "dev-docs": "scripts/dev_docs.sh", @@ -1346,8 +1344,6 @@ "@emotion/babel-preset-css-prop": "^11.11.0", "@emotion/jest": "^11.11.0", "@frsource/cypress-plugin-visual-regression-diff": "^3.3.10", - "@istanbuljs/nyc-config-typescript": "^1.0.2", - "@istanbuljs/schema": "^0.1.2", "@jest/console": "^29.7.0", "@jest/reporters": "^29.7.0", "@jest/transform": "^29.6.1", diff --git a/renovate.json b/renovate.json index b3027d7647062..307f2c86a08ee 100644 --- a/renovate.json +++ b/renovate.json @@ -137,8 +137,6 @@ "groupName": "@elastic/appex-qa dependencies", "matchDepNames": [ "cheerio", - "@istanbuljs/nyc-config-typescript", - "@istanbuljs/schema", "@types/enzyme", "@types/faker", "@types/pixelmatch", diff --git a/src/dev/code_coverage/nyc_config/nyc.functional.config.js b/src/dev/code_coverage/nyc_config/nyc.functional.config.js deleted file mode 100644 index d3a6160b8b6ae..0000000000000 --- a/src/dev/code_coverage/nyc_config/nyc.functional.config.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -const defaultExclude = require('@istanbuljs/schema/default-exclude'); -const extraExclude = [ - 'data/optimize/**', - '**/{__jest__,__test__,__examples__,__fixtures__,__snapshots__,__stories__,*mock*,*storybook,target,types}/**/*', - '**/{integration_tests,test,tests,test_helpers,test_data,test_samples,test_utils,test_utilities,*scripts}/**/*', - '**/{*e2e*,fixtures,manual_tests,stub*}/**', - '**/*mock*.{ts,tsx}', - '**/*.test.{ts,tsx}', - '**/*.spec.{ts,tsx}', - '**/types.ts', - '**/*.d.ts', - '**/index.{js,ts,tsx}', -]; -// const path = require('path'); - -module.exports = { - // 'temp-dir': process.env.COVERAGE_TEMP_DIR - // ? path.resolve(process.env.COVERAGE_TEMP_DIR, 'functional') - // : 'target/kibana-coverage/functional', - 'temp-dir': process.env.COVERAGE_TEMP_DIR - ? process.env.COVERAGE_TEMP_DIR - : 'target/kibana-coverage/functional', - 'report-dir': 'target/kibana-coverage/functional-combined', - reporter: ['html', 'json-summary'], - include: [ - 'src/{core,plugins}/**/*.{js,mjs,jsx,ts,tsx}', - 'x-pack/plugins/**/*.{js,mjs,jsx,ts,tsx}', - ], - exclude: extraExclude.concat(defaultExclude), -}; diff --git a/src/dev/code_coverage/nyc_config/nyc.server.config.js b/src/dev/code_coverage/nyc_config/nyc.server.config.js deleted file mode 100644 index d9432adb7572b..0000000000000 --- a/src/dev/code_coverage/nyc_config/nyc.server.config.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -const path = require('path'); - -module.exports = { - extends: '@istanbuljs/nyc-config-typescript', - 'report-dir': process.env.KIBANA_DIR - ? path.resolve(process.env.KIBANA_DIR, 'target/kibana-coverage/functional') - : 'target/kibana-coverage/functional', - reporter: ['json'], - all: true, - include: [ - 'src/{core,plugins}/**/*.{js,mjs,jsx,ts,tsx}', - 'x-pack/plugins/**/*.{js,mjs,jsx,ts,tsx}', - ], - exclude: [ - '**/{__jest__,__test__,__examples__,__fixtures__,__snapshots__,__stories__,*mock*,*storybook,target,types}/**/*', - '**/{integration_tests,test,tests,test_helpers,test_data,test_samples,test_utils,test_utilities,*scripts}/**/*', - '**/{*e2e*,fixtures,manual_tests,stub*}/**', - '**/*mock*.{ts,tsx}', - '**/*.test.{ts,tsx}', - '**/*.spec.{ts,tsx}', - '**/types.ts', - '**/*.d.ts', - '**/index.{js,ts,tsx}', - ], -}; diff --git a/yarn.lock b/yarn.lock index 849a31b833164..d5acff31b563b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3492,13 +3492,6 @@ js-yaml "^3.13.1" resolve-from "^5.0.0" -"@istanbuljs/nyc-config-typescript@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.2.tgz#1f5235b28540a07219ae0dd42014912a0b19cf89" - integrity sha512-iKGIyMoyJuFnJRSVTZ78POIRvNnwZaWIf8vG4ZS3rQq58MMDrqEX2nnzx0R28V2X8JvmKYiqY9FP2hlJsm8A0w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - "@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": version "0.1.3" resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98"