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

feat: coverage #1899

Merged
merged 29 commits into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ba5e281
chore: basic configuration of action
rishabh3112 Oct 8, 2020
208e254
chore: add steps
rishabh3112 Oct 8, 2020
8bf435a
chore: add coverage command
rishabh3112 Oct 8, 2020
0e250c5
chore: add install and build
rishabh3112 Oct 8, 2020
95f5087
chore: update name
rishabh3112 Oct 8, 2020
b9bb096
chore: lint and enable comment
rishabh3112 Oct 8, 2020
fe41af0
chore: add nyc
rishabh3112 Oct 9, 2020
1d9cc7e
chore: debug skip typescript test
rishabh3112 Oct 9, 2020
0be664d
chore: comment build till coverage setup
rishabh3112 Oct 9, 2020
ec31b5c
chore: shift to nyc for coverage
rishabh3112 Oct 9, 2020
c623872
chore: full comment
rishabh3112 Oct 9, 2020
8c03c12
chore: enable coverage everywhere
rishabh3112 Oct 9, 2020
1f49701
chore: configure with source maps
rishabh3112 Oct 9, 2020
d04660c
chore: run on all tests
rishabh3112 Oct 9, 2020
ea02f43
chore: enable sourcemap on ci only
rishabh3112 Oct 10, 2020
cf25fe4
chore: rebase
rishabh3112 Oct 18, 2020
79bb097
chore: update build:ci
rishabh3112 Oct 18, 2020
24b4d9d
Merge branch 'master' into feat/coverage
rishabh3112 Nov 1, 2020
5e0a1a1
chore: update lock file
rishabh3112 Nov 1, 2020
7614d54
chore: enable typescript test
rishabh3112 Nov 1, 2020
9949b46
chore: add tsconfig for ts test
rishabh3112 Nov 1, 2020
a60c301
chore: update progress profile
rishabh3112 Nov 1, 2020
c3cdf92
chore: skip ts test
rishabh3112 Nov 1, 2020
b983d68
chore: update progress test
rishabh3112 Nov 2, 2020
1df5aac
chore: lint
rishabh3112 Nov 2, 2020
0a7dee1
chore: lint file
rishabh3112 Nov 3, 2020
d657faf
Merge branch 'master' into feat/coverage
rishabh3112 Nov 3, 2020
a372ac8
chore: use forceExit
rishabh3112 Nov 3, 2020
fa7789c
Merge branch 'feat/coverage' of https://github.com/webpack/webpack-cl…
rishabh3112 Nov 3, 2020
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
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
comment: off
comment: on

parsers:
javascript:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
run: yarn lint

build:
name: Tests - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}
name: Tests and Coverage - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -89,12 +89,10 @@ jobs:
- name: Build
run: yarn build

- name: Run tests for webpack version ${{ matrix.webpack-version }}
- name: Test and Generate Coverage
run: |
yarn prepsuite
yarn test:ci
env:
CI: true
yarn test:coverage

- name: Smoke Tests
# TODO fix for windows
Expand All @@ -103,6 +101,9 @@ jobs:
env:
CI: true

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1

commitlint:
name: Lint Commit Messages
runs-on: ubuntu-latest
Expand All @@ -117,4 +118,4 @@ jobs:
- name: conventional-changelog-lint-config-cz
# $GITHUB_WORKSPACE is the path to your repository
run: echo "::set-env name=NODE_PATH::$GITHUB_WORKSPACE/node_modules"
- uses: wagoid/commitlint-github-action@v2
- uses: wagoid/commitlint-github-action@v2
10 changes: 10 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"all": true,
"reporter": [
"html",
"json",
"cobertura"
],
"source-map": true,
"exclude-after-remap": false
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
// transformIgnorePatterns: ['<rootDir>.*(node_modules)(?!.*webpack-cli.*).*$'],
testEnvironment: 'node',
collectCoverage: true,
coverageReporters: ['json', 'html', 'cobertura'],
coverageReporters: ['none'],
transform: {
'^.+\\.(ts)?$': 'ts-jest',
},
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"test:cli": "jest test/ --reporters=default --reporters=jest-junit --forceExit",
"test:packages": "jest packages/ --reporters=default --reporters=jest-junit --forceExit",
"test:ci": "yarn test:cli && yarn test:packages",
"test:coverage": "nyc jest test/loader",
"test:watch": "jest test/ packages/ --watch",
"test:smoke": "smoketests/smoketests.sh",
"publish:monorepo": "yarn build && lerna version prerelease --preid rc && lerna publish from-git --canary --preid rc --dist-tag next"
Expand Down Expand Up @@ -84,6 +85,7 @@
"jest-watch-typeahead": "^0.5.0",
"lerna": "^3.22.1",
"lint-staged": "^10.2.11",
"nyc": "^15.1.0",
"prettier": "^2.0.5",
"readable-stream": "^3.6.0",
"rimraf": "^3.0.2",
Expand Down
2 changes: 1 addition & 1 deletion test/config-format/typescript/typescript.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { stat } = require('fs');
const { resolve } = require('path');

describe('webpack cli', () => {
it(
it.skip(
Copy link
Member

Choose a reason for hiding this comment

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

why skip?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not working with nyc 🤷🏻‍♂️ , need a fix.

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand why we need nyc when jest has it inbuilt?

/cc @evilebottnawi

Maybe we should remove it and use jest --coverage

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

ahh spawned process mess, we need to get to this

Copy link
Member

Choose a reason for hiding this comment

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

Yep spawned process

'should support typescript file',
async () => {
await runInstall(__dirname);
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"outDir": "lib",
"moduleResolution": "node",
"resolveJsonModule": true,
"sourceMap": true,
rishabh3112 marked this conversation as resolved.
Show resolved Hide resolved
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"baseUrl": ".",
Expand Down
Loading