test: Add custom reporter for test metrics (#18960)

This commit is contained in:
shortstacked
2025-09-01 13:17:14 +01:00
committed by GitHub
parent ec7eddc364
commit 71b33277f8
8 changed files with 256 additions and 8 deletions

View File

@@ -7,7 +7,7 @@
import { test, expect } from '../../fixtures/cloud';
import type { n8nPage } from '../../pages/n8nPage';
import { measurePerformance } from '../../utils/performance-helper';
import { measurePerformance, attachMetric } from '../../utils/performance-helper';
async function setupPerformanceTest(n8n: n8nPage, size: number) {
await n8n.goHome();
@@ -25,7 +25,7 @@ async function setupPerformanceTest(n8n: n8nPage, size: number) {
}
test.describe('Large Node Performance - Cloud Resources', () => {
test('Large workflow with starter plan resources @cloud:starter', async ({ n8n }) => {
test('Large workflow with starter plan resources @cloud:starter', async ({ n8n }, testInfo) => {
await setupPerformanceTest(n8n, 30000);
const loopSize = 20;
const stats = [];
@@ -49,6 +49,10 @@ test.describe('Large Node Performance - Cloud Resources', () => {
}
const average = stats.reduce((a, b) => a + b, 0) / stats.length;
console.log(`Average open node duration: ${average.toFixed(1)}ms`);
// Attach performance metric using helper method
await attachMetric(testInfo, 'open-node-30000', average, 'ms');
expect(average).toBeLessThan(5000);
});
});