Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove code coverage setup #11198

Merged
merged 4 commits into from
Nov 1, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
build
build-module
coverage
node_modules
test/e2e/test-plugins
vendor
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
build
build-module
build-style
coverage
node_modules
gutenberg.zip
languages/gutenberg.pot
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Gutenberg
[![Build Status](https://img.shields.io/travis/WordPress/gutenberg/master.svg)](https://travis-ci.org/WordPress/gutenberg)
[![Coverage](https://img.shields.io/codecov/c/github/WordPress/gutenberg/master.svg)](https://codecov.io/gh/WordPress/gutenberg)
[![lerna](https://img.shields.io/badge/maintained%20with-lerna-cc00ff.svg)](https://lernajs.io/)

Printing since 1440.
Expand Down
9 changes: 0 additions & 9 deletions codecov.yml

This file was deleted.

5 changes: 0 additions & 5 deletions docs/reference/testing-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,6 @@ test( 'should contain mars if planets is true', () => {

It's tempting to snapshot deep renders, but that makes for huge snapshots. Additionally, deep renders no longer test a single component, but an entire tree. With `shallow`, we snapshot just the components that are directly rendered by the component we want to test.

### Code Coverage

Code coverage is measured for each PR using the [codecov.io](https://codecov.io/gh/WordPress/gutenberg) tool.
[Code coverage](https://en.wikipedia.org/wiki/Code_coverage) is a way of measuring the amount of code covered by the tests in the test suite of a project. In Gutenberg, it is currently measured for JavaScript code only.

## End to end Testing

If you're using the built-in [local environment](https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md#local-environment), you can run the e2e tests locally using this command:
Expand Down
1 change: 0 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"exclude": [
"build",
"build-module",
"coverage",
"node_modules",
"test/e2e/test-plugins",
"vendor"
Expand Down
23 changes: 0 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"babel-loader": "8.0.0",
"chalk": "2.4.1",
"check-node-version": "3.1.1",
"codecov": "3.0.2",
"concurrently": "3.5.0",
"copy-webpack-plugin": "4.5.2",
"core-js": "2.5.7",
Expand Down Expand Up @@ -152,7 +151,7 @@
"check-licenses": "concurrently \"wp-scripts check-licenses --prod --gpl2\" \"wp-scripts check-licenses --dev\"",
"precheck-local-changes": "npm run docs:build",
"check-local-changes": "( git diff -U0 | xargs -0 node bin/process-git-diff ) || ( echo \"There are local uncommitted changes after one or both of 'npm install' or 'npm run docs:build'!\" && exit 1 );",
"ci": "concurrently \"npm run lint\" \"npm run test-unit:coverage-ci\" \"npm run check-local-changes\"",
"ci": "concurrently \"npm run lint\" \"npm run test-unit:ci\" \"npm run check-local-changes\"",
"predev": "npm run check-engines",
"dev": "npm run build:packages && concurrently \"cross-env webpack --watch\" \"npm run dev:packages\"",
"dev:packages": "node ./bin/packages/watch.js",
Expand Down Expand Up @@ -185,10 +184,9 @@
"test-mobile": "yarn --cwd gutenberg-mobile test:inside-gb",
"test-php": "npm run lint-php && npm run test-unit-php",
"test-unit": "wp-scripts test-unit-js --config test/unit/jest.config.json",
"test-unit:coverage": "npm run test-unit -- --coverage",
"test-unit:coverage-ci": "npm run test-unit -- --coverage --maxWorkers 1 && codecov",
"test-unit:update": "npm run test-unit -- --updateSnapshot",
"test-unit:watch": "npm run test-unit -- --watch",
"test-unit:ci": "npm run test-unit -- --ci --runInBand",
"test-unit-php": "docker-compose run --rm wordpress_phpunit phpunit",
"test-unit-php-multisite": "docker-compose run -e WP_MULTISITE=1 --rm wordpress_phpunit phpunit"
},
Expand Down
2 changes: 0 additions & 2 deletions packages/jest-preset-default/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ npm install @wordpress/jest-preset-default --save-dev

#### Brief explanations of options included

* `coverageDirectory` - the directory where Jest outputs its coverage files is set to `coverage`.
Copy link
Member

@gziolo gziolo Oct 31, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update changelog as this looks as a breaking change, or we can keep it as is 😄

I'm aware that probably nobody is using it.

* `coveragePathIgnorePatterns` - coverage information will be skipped for all folders named `build` and `build-module`.
* `moduleNameMapper` - all `css` and `scss` files containing CSS styles will be stubbed out.
* `modulePaths` - the root dir of the project is used as a location to search when resolving modules.
* `setupFiles` - runs code before each test which sets up global variables required in the testing environment.
Expand Down
7 changes: 0 additions & 7 deletions packages/jest-preset-default/jest-preset.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"coverageDirectory": "coverage",
"coveragePathIgnorePatterns": [
"/node_modules/",
"<rootDir>/.*/build/",
"<rootDir>/.*/build-module/",
"<rootDir>/.*/test/"
],
"moduleNameMapper": {
"\\.(scss|css)$": "<rootDir>/node_modules/@wordpress/jest-preset-default/scripts/style-mock.js"
},
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"rootDir": "../../",
"coveragePathIgnorePatterns": [
"/node_modules/",
"<rootDir>/gutenberg-mobile/"
],
"preset": "jest-puppeteer",
"setupTestFrameworkScriptFile": "<rootDir>/test/e2e/support/setup-test-framework.js",
"testMatch": [
Expand Down
9 changes: 0 additions & 9 deletions test/unit/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
{
"rootDir": "../../",
"collectCoverageFrom": [ "packages/**/*.js" ],
"coveragePathIgnorePatterns": [
"/node_modules/",
"<rootDir>/.*/build/",
"<rootDir>/.*/build-module/",
"<rootDir>/packages/.*/benchmark/",
"<rootDir>/packages/.*/test/",
"<rootDir>/gutenberg-mobile/"
],
"moduleNameMapper": {
"@wordpress\\/(block-serialization-spec-parser|is-shallow-equal)$": "packages/$1",
"@wordpress\\/([a-z0-9-]+)$": "packages/$1/src"
Expand Down