generate js coverage report in CI (#12029)

relates to #8771

Add coverage for frontend and improve coverage reports around Backend
and frontend code.
This commit is contained in:
Gabriel Hernandez 2023-06-01 17:46:25 +01:00 committed by GitHub
parent fd1372c3b0
commit 2fcc5ee72e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 11 deletions

View File

@ -103,6 +103,7 @@ jobs:
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with: with:
files: coverage.txt files: coverage.txt
flags: backend
- name: Slack Notification - name: Slack Notification
if: github.event.schedule == '0 4 * * *' && failure() if: github.event.schedule == '0 4 * * *' && failure()

View File

@ -8,20 +8,11 @@ on:
pull_request: pull_request:
paths: paths:
- assets/** - assets/**
- cypress/**
- ee/**
- frontend/** - frontend/**
- pkg/**
- server/**
- tools/**
- go.mod
- go.sum
- package.json - package.json
- yarn.lock - yarn.lock
- docker-compose.yml
- webpack.config.js - webpack.config.js
- tsconfig.json - tsconfig.json
- .github/workflows/test.yml
# This allows a subsequently queued workflow run to interrupt previous runs # This allows a subsequently queued workflow run to interrupt previous runs
concurrency: concurrency:
@ -64,8 +55,12 @@ jobs:
- name: Run JS Tests - name: Run JS Tests
run: | run: |
make test-js yarn test:ci
- name: Upload to Codecov
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70
with:
flags: frontend
lint-js: lint-js:
strategy: strategy:

View File

@ -35,5 +35,8 @@
"html.format.templating": true, "html.format.templating": true,
"html.format.wrapAttributes": "preserve", "html.format.wrapAttributes": "preserve",
"html.format.wrapLineLength": 0, "html.format.wrapLineLength": 0,
"prettier.requireConfig": true "prettier.requireConfig": true,
"yaml.schemas": {
"https://json.schemastore.org/codecov.json": ".github/workflows/codecov.yml"
}
} }

24
codecov.yml Normal file
View File

@ -0,0 +1,24 @@
coverage:
status:
project: false
patch: false
flag_management:
default_rules:
carryforward: true
statuses:
- type: project
informational: true
- type: patch
informational: true
individual_flags:
- name: backend
paths:
- cmd/
- pkg/
- server/
- ee/
- orbit/
- name: frontend
paths:
- frontend/

View File

@ -7,6 +7,7 @@
"lint": "eslint frontend cypress --ext .js,.jsx,.ts,.tsx", "lint": "eslint frontend cypress --ext .js,.jsx,.ts,.tsx",
"prettier:check": "prettier --check frontend/**/*.{jsx,js,tsx,ts} ./cypress/**/*.{js,ts}", "prettier:check": "prettier --check frontend/**/*.{jsx,js,tsx,ts} ./cypress/**/*.{js,ts}",
"test": "jest --config ./frontend/test/jest.config.ts", "test": "jest --config ./frontend/test/jest.config.ts",
"test:ci": "jest --config ./frontend/test/jest.config.ts --ci --coverage",
"e2e-browser": "cypress open", "e2e-browser": "cypress open",
"e2e-browser:free": "yarn cypress open --config-file cypress/cypress-free.json", "e2e-browser:free": "yarn cypress open --config-file cypress/cypress-free.json",
"e2e-browser:premium": "yarn cypress open --config-file cypress/cypress-premium.json", "e2e-browser:premium": "yarn cypress open --config-file cypress/cypress-premium.json",