Skip to content

Commit

Permalink
feat: test coverage (#456)
Browse files Browse the repository at this point in the history
* feat: add test coverage in GitHub Action

* feat: adding back static code analysis

* coverage instead of test-gh

* deleting unrequired file
  • Loading branch information
SanketD92 committed Apr 22, 2021
1 parent f9b7d62 commit 252b504
Show file tree
Hide file tree
Showing 94 changed files with 141 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/unit-test-code-analysis.yml
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches:
- develop
- 'feat-*'
- "feat-*"
jobs:
static-code-analysis-and-unit-test:
name: Unit Tests & Code Analysis
Expand All @@ -31,10 +31,15 @@ jobs:
- name: Install Node.js dependencies
run: |
npm install -g pnpm
npm install -g codecov
pnpm recursive install --unsafe-perm --stream
- name: Run static code analysis & linting tests
run: |
./scripts/run-static-code-analysis.sh --stream
- name: Run unit tests
run: |
./scripts/run-unit-tests.sh --stream
pnpm run coverage --recursive --if-present --stream
- name: CodeCov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos, but helps in smoother report uploads
1 change: 1 addition & 0 deletions .gitignore
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules
**/npm-debug.log
**/pnpm-debug.log
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -28,6 +28,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
1 change: 1 addition & 0 deletions addons/addon-base-raas-ui/packages/base-raas-ui/.gitignore
Expand Up @@ -2,6 +2,7 @@

**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -80,6 +80,7 @@
"regenerator-runtime": "^0.13.5"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"babel": "babel src/ --out-dir dist/ --source-maps",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"babel:watch": "babel src/ --out-dir dist/ --source-maps --watch",
"build": "pnpm run babel",
"build:watch": "pnpm run babel:watch",
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -28,6 +28,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -28,6 +28,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -33,7 +33,6 @@
"eslint-plugin-jest": "^22.21.0",
"eslint-plugin-prettier": "^3.1.2",
"@aws-ee/base-workflow-core": "workspace:*",
"@aws-ee/environment-type-mgmt-services": "workspace:*",
"husky": "^3.1.0",
"jest": "^24.9.0",
"jest-junit": "^10.0.0",
Expand All @@ -43,6 +42,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -31,6 +31,7 @@
"aws-sdk-mock": "^5.1.0"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -25,6 +25,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -31,6 +31,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -28,6 +28,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -28,6 +28,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -26,6 +26,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
1 change: 1 addition & 0 deletions addons/addon-base-rest-api/packages/services/.gitignore
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
1 change: 1 addition & 0 deletions addons/addon-base-rest-api/packages/services/package.json
Expand Up @@ -35,6 +35,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
1 change: 1 addition & 0 deletions addons/addon-base-ui/packages/base-ui/.gitignore
Expand Up @@ -2,6 +2,7 @@

**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
1 change: 1 addition & 0 deletions addons/addon-base-ui/packages/base-ui/package.json
Expand Up @@ -67,6 +67,7 @@
"webpack": "4.41.2"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"babel": "babel src/ --out-dir dist/ --source-maps",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"pretty-quick": "^1.11.1"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
Expand Up @@ -2,6 +2,7 @@

**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -29,6 +29,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -25,6 +25,7 @@
"source-map-support": "^0.5.16"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"pretty-quick": "^1.11.1"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down
@@ -1,5 +1,6 @@
**/.class
**/.DS_Store
**/coverage
**/node_modules

**/npm-debug.log
Expand Down
Expand Up @@ -27,6 +27,7 @@
"pretty-quick": "^1.11.1"
},
"scripts": {
"coverage": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --verbose --collectCoverage --watchAll=false --coverage && codecov",
"test": "NODE_ENV=test jest --config jest.config.js --passWithNoTests",
"test:watch": "NODE_ENV=test jest --config jest.config.js --passWithNoTests --watchAll",
"lint": "pnpm run lint:eslint && pnpm run lint:prettier",
Expand Down

0 comments on commit 252b504

Please sign in to comment.