mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
ci: Setup code-coverage reporting (no-changelog) (#5669)
This commit is contained in:
parent
5f238ea641
commit
3831201aaf
5
.github/workflows/ci-master.yml
vendored
5
.github/workflows/ci-master.yml
vendored
|
@ -35,6 +35,11 @@ jobs:
|
|||
- name: Test
|
||||
run: pnpm test
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: packages/cli/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
|
||||
|
||||
- name: Lint
|
||||
env:
|
||||
CI_LINT_MASTER: true
|
||||
|
|
5
.github/workflows/ci-pull-requests.yml
vendored
5
.github/workflows/ci-pull-requests.yml
vendored
|
@ -67,6 +67,11 @@ jobs:
|
|||
- name: Test
|
||||
run: pnpm test
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
files: packages/cli/coverage/cobertura-coverage.xml,packages/nodes-base/coverage/cobertura-coverage.xml,packages/core/coverage/cobertura-coverage.xml,packages/workflow/coverage/cobertura-coverage.xml
|
||||
|
||||
lint:
|
||||
name: Lint changes
|
||||
runs-on: ubuntu-latest
|
||||
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,6 +3,7 @@ node_modules
|
|||
.tmp
|
||||
tmp
|
||||
dist
|
||||
coverage
|
||||
npm-debug.log*
|
||||
yarn.lock
|
||||
google-generated-credentials.json
|
||||
|
|
|
@ -22,11 +22,15 @@ const config = {
|
|||
moduleNameMapper: {
|
||||
'^@/(.*)$': '<rootDir>/src/$1',
|
||||
},
|
||||
collectCoverage: true,
|
||||
coverageReporters: [process.env.COVERAGE_REPORT === 'true' ? 'text' : 'text-summary'],
|
||||
collectCoverageFrom: ['src/**/*.ts'],
|
||||
};
|
||||
|
||||
if (process.env.CI === 'true') {
|
||||
config.maxWorkers = 2;
|
||||
config.workerIdleMemoryLimit = 2048;
|
||||
config.coverageReporters = ['cobertura'];
|
||||
}
|
||||
|
||||
module.exports = config;
|
||||
|
|
|
@ -11,4 +11,5 @@ module.exports = {
|
|||
'^@/(.*)$': '<rootDir>/src/$1',
|
||||
'^@db/(.*)$': '<rootDir>/src/databases/$1',
|
||||
},
|
||||
coveragePathIgnorePatterns: ['/src/databases/migrations/'],
|
||||
};
|
||||
|
|
|
@ -26,7 +26,7 @@ afterAll(async () => {
|
|||
await testDb.terminate();
|
||||
});
|
||||
|
||||
test('user-management:reset should reset DB to default user state', async () => {
|
||||
test.skip('user-management:reset should reset DB to default user state', async () => {
|
||||
await testDb.createUser({ globalRole: globalOwnerRole });
|
||||
|
||||
await Reset.run();
|
||||
|
|
1
packages/design-system/.gitignore
vendored
1
packages/design-system/.gitignore
vendored
|
@ -1,3 +1,2 @@
|
|||
coverage
|
||||
storybook-static
|
||||
**/*.stories.js
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
/** @type {import('jest').Config} */
|
||||
module.exports = require('../../jest.config');
|
||||
module.exports = {
|
||||
...require('../../jest.config'),
|
||||
collectCoverageFrom: ['credentials/**/*.ts', 'nodes/**/*.ts', 'utils/**/*.ts'],
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { readFileSync, readdirSync, mkdtempSync } from 'fs';
|
||||
import { BinaryDataManager, Credentials, loadClassInIsolation } from 'n8n-core';
|
||||
import { BinaryDataManager, Credentials } from 'n8n-core';
|
||||
import {
|
||||
ICredentialDataDecryptedObject,
|
||||
ICredentialsHelper,
|
||||
|
@ -194,10 +194,9 @@ export function setup(testData: Array<WorkflowTestData> | WorkflowTestData) {
|
|||
if (!loadInfo) {
|
||||
throw new Error(`Unknown node type: ${nodeName}`);
|
||||
}
|
||||
const node = loadClassInIsolation(
|
||||
path.join(process.cwd(), loadInfo.sourcePath),
|
||||
loadInfo.className,
|
||||
) as INodeType;
|
||||
const sourcePath = loadInfo.sourcePath.replace(/^dist\//, './').replace(/\.js$/, '.ts');
|
||||
const nodeSourcePath = path.join(process.cwd(), sourcePath);
|
||||
const node = new (require(nodeSourcePath)[loadInfo.className])() as INodeType;
|
||||
nodeTypes.addNode(nodeName, node);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue