[MM-62409] Generate and publish code coverage for webapp (#31144)
* Generate and publish code coverage for webapp * Upate coverage output path * Simplify coverage patterns * Disable coverage file search --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
50d81c2a38
Коммит
65c5f40c6a
3
.github/codecov.yml
поставляемый
3
.github/codecov.yml
поставляемый
@@ -9,5 +9,8 @@ coverage:
|
||||
project:
|
||||
default:
|
||||
threshold: 1.0
|
||||
codecov:
|
||||
notify:
|
||||
after_n_builds: 2 # Server and webapp at this point
|
||||
ignore:
|
||||
- ^store/storetest.*
|
||||
|
||||
1
.github/workflows/webapp-ci-pr.yml
поставляемый
1
.github/workflows/webapp-ci-pr.yml
поставляемый
@@ -18,3 +18,4 @@ concurrency:
|
||||
jobs:
|
||||
pr-ci:
|
||||
uses: ./.github/workflows/webapp-ci-template.yml
|
||||
secrets: inherit
|
||||
|
||||
6
.github/workflows/webapp-ci-template.yml
поставляемый
6
.github/workflows/webapp-ci-template.yml
поставляемый
@@ -75,6 +75,12 @@ jobs:
|
||||
NODE_OPTIONS: --max_old_space_size=5120
|
||||
run: |
|
||||
npm run test-ci
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v5
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
disable_search: true
|
||||
files: ./webapp/channels/coverage/lcov.info
|
||||
|
||||
build:
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
@@ -8,15 +8,11 @@ const config = {
|
||||
testPathIgnorePatterns: ['/node_modules/'],
|
||||
clearMocks: true,
|
||||
collectCoverageFrom: [
|
||||
'actions/src/**/*.{js,jsx,ts,tsx}',
|
||||
'client/src/**/*.{js,jsx,ts,tsx}',
|
||||
'components/src/**/*.{jsx,tsx}',
|
||||
'plugins/src/**/*.{js,jsx,ts,tsx}',
|
||||
'reducers/src/**/*.{js,jsx,ts,tsx}',
|
||||
'routes/src/**/*.{js,jsx,ts,tsx}',
|
||||
'selectors/src/**/*.{js,jsx,ts,tsx}',
|
||||
'stores/src/**/*.{js,jsx,ts,tsx}',
|
||||
'utils/src/**/*.{js,jsx,ts,tsx}',
|
||||
'src/**/*.{js,jsx,ts,tsx}',
|
||||
],
|
||||
coveragePathIgnorePatterns: [
|
||||
'/node_modules/',
|
||||
'mattermost-redux/src/selectors/create_selector',
|
||||
],
|
||||
coverageReporters: ['lcov', 'text-summary'],
|
||||
fakeTimers: {
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
"test:watch": "cross-env TZ=Etc/UTC jest --watch",
|
||||
"test:updatesnapshot": "cross-env TZ=Etc/UTC jest --updateSnapshot",
|
||||
"test:debug": "cross-env TZ=Etc/UTC jest --forceExit --detectOpenHandles --verbose",
|
||||
"test-ci": "cross-env TZ=Etc/UTC jest --ci --maxWorkers=100%",
|
||||
"test-ci": "cross-env TZ=Etc/UTC jest --ci --maxWorkers=100% --coverage",
|
||||
"clean": "rm -rf dist node_modules .eslintcache .stylelintcache tsconfig.tsbuildinfo",
|
||||
"stats": "cross-env NODE_ENV=production webpack --profile --json > webpack_stats.json",
|
||||
"mmjstool": "mmjstool",
|
||||
|
||||
Ссылка в новой задаче
Block a user