diff --git a/.github/codecov.yml b/.github/codecov.yml index d41023ecea..ebb191adfa 100644 --- a/.github/codecov.yml +++ b/.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.* diff --git a/.github/workflows/webapp-ci-pr.yml b/.github/workflows/webapp-ci-pr.yml index 8e6919603f..44f0fc57f1 100644 --- a/.github/workflows/webapp-ci-pr.yml +++ b/.github/workflows/webapp-ci-pr.yml @@ -18,3 +18,4 @@ concurrency: jobs: pr-ci: uses: ./.github/workflows/webapp-ci-template.yml + secrets: inherit diff --git a/.github/workflows/webapp-ci-template.yml b/.github/workflows/webapp-ci-template.yml index 1a70072f5e..174f5afc45 100644 --- a/.github/workflows/webapp-ci-template.yml +++ b/.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 diff --git a/webapp/channels/jest.config.js b/webapp/channels/jest.config.js index ecba2eae6b..6213444593 100644 --- a/webapp/channels/jest.config.js +++ b/webapp/channels/jest.config.js @@ -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: { diff --git a/webapp/channels/package.json b/webapp/channels/package.json index 81e1b5e3a3..66bca562e7 100644 --- a/webapp/channels/package.json +++ b/webapp/channels/package.json @@ -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",