409e92d6ae
Build and Push Docker Images / Build Docker Image (push) Has been cancelled
Build and Push Docker Images / Build Railway Docker Image (push) Has been cancelled
Build and Publish n8n Docker Image / test-image (push) Has been cancelled
Dependency Compatibility Check / Fresh Install Dependency Check (push) Has been cancelled
Build and Publish n8n Docker Image / build-and-push (push) Has been cancelled
Build and Publish n8n Docker Image / create-release (push) Has been cancelled
Automated Release / Detect Version Change (push) Has been cancelled
Automated Release / Generate Release Notes (push) Has been cancelled
Automated Release / Create GitHub Release (push) Has been cancelled
Automated Release / Package MCPB Bundle (push) Has been cancelled
Automated Release / Build and Verify (push) Has been cancelled
Automated Release / Publish to NPM (push) Has been cancelled
Automated Release / Build and Push Docker Images (push) Has been cancelled
Automated Release / Update Documentation (push) Has been cancelled
Automated Release / Notify Release Completion (push) Has been cancelled
Secret Scan / secretlint (push) Has been cancelled
Test Suite / test (push) Has been cancelled
Test Suite / cjs-runtime (push) Has been cancelled
Test Suite / publish-results (push) Has been cancelled
95 lines
2.4 KiB
TypeScript
95 lines
2.4 KiB
TypeScript
#!/usr/bin/env npx tsx
|
|
/**
|
|
* Integration test for the telemetry manager
|
|
*/
|
|
|
|
import { telemetry } from '../src/telemetry/telemetry-manager';
|
|
|
|
async function testIntegration() {
|
|
console.log('🧪 Testing Telemetry Manager Integration\n');
|
|
|
|
// Check status
|
|
console.log('Status:', telemetry.getStatus());
|
|
|
|
// Track session start
|
|
console.log('\nTracking session start...');
|
|
telemetry.trackSessionStart();
|
|
|
|
// Track tool usage
|
|
console.log('Tracking tool usage...');
|
|
telemetry.trackToolUsage('search_nodes', true, 150);
|
|
telemetry.trackToolUsage('get_node_info', true, 75);
|
|
telemetry.trackToolUsage('validate_workflow', false, 200);
|
|
|
|
// Track errors
|
|
console.log('Tracking errors...');
|
|
telemetry.trackError('ValidationError', 'workflow_validation', 'validate_workflow', 'Required field missing: nodes array is empty');
|
|
|
|
// Track a test workflow
|
|
console.log('Tracking workflow creation...');
|
|
const testWorkflow = {
|
|
nodes: [
|
|
{
|
|
id: '1',
|
|
type: 'n8n-nodes-base.webhook',
|
|
name: 'Webhook',
|
|
position: [0, 0],
|
|
parameters: {
|
|
path: '/test-webhook',
|
|
httpMethod: 'POST'
|
|
}
|
|
},
|
|
{
|
|
id: '2',
|
|
type: 'n8n-nodes-base.httpRequest',
|
|
name: 'HTTP Request',
|
|
position: [250, 0],
|
|
parameters: {
|
|
url: 'https://api.example.com/endpoint',
|
|
method: 'POST',
|
|
authentication: 'genericCredentialType',
|
|
genericAuthType: 'httpHeaderAuth',
|
|
sendHeaders: true,
|
|
headerParameters: {
|
|
parameters: [
|
|
{
|
|
name: 'Authorization',
|
|
value: 'Bearer sk-1234567890abcdef'
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
id: '3',
|
|
type: 'n8n-nodes-base.slack',
|
|
name: 'Slack',
|
|
position: [500, 0],
|
|
parameters: {
|
|
channel: '#notifications',
|
|
text: 'Workflow completed!'
|
|
}
|
|
}
|
|
],
|
|
connections: {
|
|
'1': {
|
|
main: [[{ node: '2', type: 'main', index: 0 }]]
|
|
},
|
|
'2': {
|
|
main: [[{ node: '3', type: 'main', index: 0 }]]
|
|
}
|
|
}
|
|
};
|
|
|
|
telemetry.trackWorkflowCreation(testWorkflow, true);
|
|
|
|
// Force flush
|
|
console.log('\nFlushing telemetry data...');
|
|
await telemetry.flush();
|
|
|
|
console.log('\n✅ Telemetry integration test completed!');
|
|
console.log('Check your Supabase dashboard for the telemetry data.');
|
|
}
|
|
|
|
testIntegration().catch(console.error);
|