ci: Add test results upload to Codecov (#14410)

This commit is contained in:
Nora Shapiro
2025-04-04 13:58:08 -07:00
committed by GitHub
parent 33e265aaa8
commit c2d39dfbb7
5 changed files with 24 additions and 1 deletions

View File

@@ -85,6 +85,12 @@ jobs:
if: ${{ !inputs.skipFrontendTests }}
run: pnpm test:frontend
- name: Upload test results to Codecov
if: ${{ !cancelled() }} # Run even if tests fail
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage to Codecov
if: inputs.collectCoverage
uses: codecov/codecov-action@v5.1.2

1
.gitignore vendored
View File

@@ -22,3 +22,4 @@ packages/**/.turbo
CHANGELOG-*.md
*.mdx
build-storybook.log
*.junit.xml

View File

@@ -32,6 +32,7 @@ const config = {
collectCoverage: isCoverageEnabled,
coverageReporters: ['text-summary', 'lcov', 'html-spa'],
collectCoverageFrom: ['src/**/*.ts'],
reporters: ['default', 'jest-junit'],
workerIdleMemoryLimit: '1MB',
};

View File

@@ -38,7 +38,7 @@
"start:default": "cd packages/cli/bin && ./n8n",
"start:tunnel": "./packages/cli/bin/n8n start --tunnel",
"start:windows": "cd packages/cli/bin && n8n",
"test": "turbo run test",
"test": "JEST_JUNIT_CLASSNAME={filepath} turbo run test",
"test:backend": "turbo run test:backend --concurrency=1",
"test:frontend": "turbo run test:frontend --concurrency=1",
"test:nodes": "turbo run test:nodes --concurrency=1",
@@ -56,6 +56,7 @@
"jest": "^29.6.2",
"jest-environment-jsdom": "^29.6.2",
"jest-expect-message": "^1.1.3",
"jest-junit": "^16.0.0",
"jest-mock": "^29.6.2",
"jest-mock-extended": "^3.0.4",
"lefthook": "^1.7.15",

14
pnpm-lock.yaml generated
View File

@@ -211,6 +211,9 @@ importers:
jest-expect-message:
specifier: ^1.1.3
version: 1.1.3
jest-junit:
specifier: ^16.0.0
version: 16.0.0
jest-mock:
specifier: ^29.6.2
version: 29.6.2
@@ -9652,6 +9655,10 @@ packages:
resolution: {integrity: sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
jest-junit@16.0.0:
resolution: {integrity: sha512-A94mmw6NfJab4Fg/BlvVOUXzXgF0XIH6EmTgJ5NDPp4xoKq0Kr7sErb+4Xs9nZvu58pJojz5RFGpqnZYJTrRfQ==}
engines: {node: '>=10.12.0'}
jest-leak-detector@29.6.2:
resolution: {integrity: sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
@@ -23344,6 +23351,13 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
jest-junit@16.0.0:
dependencies:
mkdirp: 1.0.4
strip-ansi: 6.0.1
uuid: 8.3.2
xml: 1.0.1
jest-leak-detector@29.6.2:
dependencies:
jest-get-type: 29.4.3