mirror of
https://github.com/n8n-io/n8n
synced 2026-04-21 15:47:20 +00:00
ci: Improve coverage reports (#27756)
This commit is contained in:
parent
d300568ee1
commit
e947000d97
11 changed files with 50 additions and 14 deletions
4
.github/workflows/test-unit-reusable.yml
vendored
4
.github/workflows/test-unit-reusable.yml
vendored
|
|
@ -62,6 +62,7 @@ jobs:
|
|||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
flags: backend-unit
|
||||
name: backend-unit
|
||||
files: ./packages/**/coverage/cobertura-coverage.xml,./coverage/cobertura-coverage.xml
|
||||
|
||||
integration-test-backend:
|
||||
name: Backend Integration Tests
|
||||
|
|
@ -103,6 +104,7 @@ jobs:
|
|||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
flags: backend-integration
|
||||
name: backend-integration
|
||||
files: ./packages/**/coverage/cobertura-coverage.xml,./coverage/cobertura-coverage.xml
|
||||
|
||||
unit-test-nodes:
|
||||
name: Nodes Unit Tests
|
||||
|
|
@ -144,6 +146,7 @@ jobs:
|
|||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
flags: nodes-unit
|
||||
name: nodes-unit
|
||||
files: ./packages/**/coverage/cobertura-coverage.xml,./coverage/cobertura-coverage.xml
|
||||
|
||||
unit-test-frontend:
|
||||
name: Frontend (${{ matrix.shard }}/2)
|
||||
|
|
@ -191,6 +194,7 @@ jobs:
|
|||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
flags: frontend
|
||||
name: frontend-shard-${{ matrix.shard }}
|
||||
files: ./packages/**/coverage/cobertura-coverage.xml,./coverage/cobertura-coverage.xml
|
||||
|
||||
unit-test:
|
||||
name: Unit tests
|
||||
|
|
|
|||
10
codecov.yml
10
codecov.yml
|
|
@ -53,7 +53,9 @@ component_management:
|
|||
- packages/@n8n/backend-common/**
|
||||
- packages/@n8n/backend-test-utils/**
|
||||
- packages/@n8n/errors/**
|
||||
- packages/@n8n/expression-runtime/**
|
||||
- packages/@n8n/db/**
|
||||
- packages/@n8n/cli/**
|
||||
- packages/@n8n/di/**
|
||||
- packages/@n8n/imap/**
|
||||
- packages/@n8n/permissions/**
|
||||
|
|
@ -78,6 +80,13 @@ component_management:
|
|||
- type: project
|
||||
target: auto
|
||||
threshold: 0% # Enforce: Coverage must not decrease
|
||||
- component_id: utils_packages
|
||||
name: Utils
|
||||
paths:
|
||||
- packages/@n8n/eslint-config/**
|
||||
- packages/@n8n/eslint-plugin-community-nodes/**
|
||||
- packages/@n8n/node-cli/**
|
||||
- packages/@n8n/utils/**
|
||||
|
||||
ignore:
|
||||
- (?s:.*/[^\/]*\.spec\.ts.*)\Z
|
||||
|
|
@ -85,3 +94,4 @@ ignore:
|
|||
- (?s:.*/[^\/]*e2e[^\/]*\.ts.*)\Z
|
||||
- (?s:.*/test_[^\/]*\.py.*)\Z
|
||||
- (?s:.*/scripts/.*)\Z
|
||||
- (?s:.*/__tests__/.*)\Z
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@
|
|||
"lint": "eslint src --quiet",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"watch": "tsc -p tsconfig.build.json --watch",
|
||||
"test": "vitest run"
|
||||
"test": "vitest run",
|
||||
"test:unit": "vitest run"
|
||||
},
|
||||
"oclif": {
|
||||
"bin": "n8n-cli",
|
||||
|
|
@ -39,6 +40,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@n8n/typescript-config": "workspace:*",
|
||||
"@n8n/vitest-config": "workspace:*",
|
||||
"@types/node": "24.10.1",
|
||||
"vitest": "catalog:"
|
||||
}
|
||||
|
|
|
|||
3
packages/@n8n/cli/vitest.config.ts
Normal file
3
packages/@n8n/cli/vitest.config.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import { createVitestConfig } from '@n8n/vitest-config/node';
|
||||
|
||||
export default createVitestConfig();
|
||||
|
|
@ -10,7 +10,8 @@
|
|||
"format:check": "biome ci .",
|
||||
"lint": "eslint . --quiet",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"watch": "tsc -p tsconfig.build.json --watch"
|
||||
"watch": "tsc -p tsconfig.build.json --watch",
|
||||
"test": "jest"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "src/index.ts",
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
"build": "tsc --build tsconfig.build.esm.json tsconfig.build.cjs.json && pnpm build:runtime",
|
||||
"build:runtime": "node esbuild.config.js",
|
||||
"test": "vitest run",
|
||||
"test:unit": "vitest run",
|
||||
"test:dev": "vitest --watch --silent false",
|
||||
"typecheck": "tsc --noEmit"
|
||||
},
|
||||
|
|
@ -42,6 +43,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@n8n/typescript-config": "workspace:*",
|
||||
"@n8n/vitest-config": "workspace:*",
|
||||
"@types/lodash": "catalog:",
|
||||
"@types/luxon": "3.2.0",
|
||||
"@types/md5": "^2.3.5",
|
||||
|
|
|
|||
|
|
@ -1,13 +1,7 @@
|
|||
import { defineConfig } from 'vitest/config';
|
||||
import { createVitestConfig } from '@n8n/vitest-config/node';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'json', 'html'],
|
||||
exclude: ['dist/**', 'bundle/**', '**/*.test.ts', '**/*.config.ts'],
|
||||
},
|
||||
export default createVitestConfig({
|
||||
coverage: {
|
||||
exclude: ['dist/**', 'bundle/**', '**/*.test.ts', '**/*.config.ts'],
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@
|
|||
"typecheck:backend": "tsc --noEmit --project tsconfig.backend.json",
|
||||
"build": "pnpm \"/^typecheck:.+/\" && pnpm clean && tsdown && pnpm create-json-schema",
|
||||
"create-json-schema": "tsx scripts/create-json-schema.ts",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"test": "jest"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "catalog:frontend",
|
||||
|
|
|
|||
|
|
@ -5,5 +5,17 @@ export default defineConfig({
|
|||
globals: true,
|
||||
disableConsoleIntercept: true,
|
||||
setupFiles: ['src/test-utils/setup.ts'],
|
||||
reporters: process.env.CI === 'true' ? ['default', 'junit'] : ['default'],
|
||||
outputFile: { junit: './junit.xml' },
|
||||
...(process.env.COVERAGE_ENABLED === 'true'
|
||||
? {
|
||||
coverage: {
|
||||
enabled: true,
|
||||
provider: 'v8',
|
||||
reporter: process.env.CI === 'true' ? ['cobertura'] : ['text-summary'],
|
||||
all: true,
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@
|
|||
"lint": "eslint src --quiet",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"prepack": "echo \"Building project...\" && rm -rf dist && tsc -b",
|
||||
"watch": "tsc --watch"
|
||||
"watch": "tsc --watch",
|
||||
"test": "jest"
|
||||
},
|
||||
"bin": {
|
||||
"n8n-node-dev": "./bin/n8n-node-dev"
|
||||
|
|
|
|||
|
|
@ -903,6 +903,9 @@ importers:
|
|||
'@n8n/typescript-config':
|
||||
specifier: workspace:*
|
||||
version: link:../typescript-config
|
||||
'@n8n/vitest-config':
|
||||
specifier: workspace:*
|
||||
version: link:../vitest-config
|
||||
'@types/node':
|
||||
specifier: ^20.17.50
|
||||
version: 20.19.21
|
||||
|
|
@ -1349,6 +1352,9 @@ importers:
|
|||
'@n8n/typescript-config':
|
||||
specifier: workspace:*
|
||||
version: link:../typescript-config
|
||||
'@n8n/vitest-config':
|
||||
specifier: workspace:*
|
||||
version: link:../vitest-config
|
||||
'@types/lodash':
|
||||
specifier: 'catalog:'
|
||||
version: 4.17.17
|
||||
|
|
|
|||
Loading…
Reference in a new issue