fraim-framework 2.0.56 → 2.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/bin/fraim-mcp.js +14 -0
- package/bin/fraim.js +23 -0
- package/dist/src/cli/commands/init-project.js +10 -4
- package/dist/src/cli/commands/mcp.js +65 -0
- package/dist/src/cli/setup/mcp-config-generator.js +19 -16
- package/dist/src/fraim/issue-tracking/ado-provider.js +304 -0
- package/dist/src/fraim/issue-tracking/factory.js +63 -0
- package/dist/src/fraim/issue-tracking/github-provider.js +200 -0
- package/dist/src/fraim/issue-tracking/types.js +7 -0
- package/dist/src/fraim/issue-tracking-config.js +83 -0
- package/dist/src/local-mcp-server/stdio-server.js +207 -0
- package/dist/src/utils/workflow-parser.js +81 -0
- package/package.json +17 -12
- package/registry/scripts/pdf-styles.css +172 -0
- package/registry/scripts/prep-issue.sh +46 -4
- package/registry/scripts/profile-server.ts +131 -130
- package/registry/stubs/workflows/customer-development/user-survey-dispatch.md +1 -1
- package/registry/stubs/workflows/customer-development/users-to-target.md +1 -1
- package/registry/stubs/workflows/product-building/design.md +1 -1
- package/registry/stubs/workflows/product-building/implement.md +1 -1
- package/Claude.md +0 -1
- package/dist/registry/ai-manager-rules/customer-development-phases/phase1-customer-profiling.md +0 -101
- package/dist/registry/ai-manager-rules/customer-development-phases/phase2-platform-discovery.md +0 -235
- package/dist/registry/ai-manager-rules/customer-development-phases/phase3-prospect-qualification.md +0 -243
- package/dist/registry/ai-manager-rules/customer-development-phases/phase4-inventory-compilation.md +0 -206
- package/dist/registry/ai-manager-rules/design-phases/design-completeness-review.md +0 -73
- package/dist/registry/ai-manager-rules/design-phases/design-design.md +0 -145
- package/dist/registry/ai-manager-rules/implement-phases/implement-code.md +0 -283
- package/dist/registry/ai-manager-rules/implement-phases/implement-completeness-review.md +0 -120
- package/dist/registry/ai-manager-rules/implement-phases/implement-regression.md +0 -173
- package/dist/registry/ai-manager-rules/implement-phases/implement-repro.md +0 -104
- package/dist/registry/ai-manager-rules/implement-phases/implement-scoping.md +0 -100
- package/dist/registry/ai-manager-rules/implement-phases/implement-smoke.md +0 -237
- package/dist/registry/ai-manager-rules/implement-phases/implement-spike.md +0 -121
- package/dist/registry/ai-manager-rules/implement-phases/implement-validate.md +0 -375
- package/dist/registry/ai-manager-rules/retrospective.md +0 -116
- package/dist/registry/ai-manager-rules/shared-phases/address-pr-feedback.md +0 -188
- package/dist/registry/ai-manager-rules/shared-phases/submit-pr.md +0 -202
- package/dist/registry/ai-manager-rules/shared-phases/wait-for-pr-review.md +0 -170
- package/dist/registry/ai-manager-rules/spec-phases/spec-competitor-analysis.md +0 -105
- package/dist/registry/ai-manager-rules/spec-phases/spec-completeness-review.md +0 -66
- package/dist/registry/ai-manager-rules/spec-phases/spec-spec.md +0 -139
- package/dist/registry/ai-manager-rules/user-survey-phases/phase1-survey-scoping.md +0 -60
- package/dist/registry/ai-manager-rules/user-survey-phases/phase2-survey-build-linkedin.md +0 -23
- package/dist/registry/ai-manager-rules/user-survey-phases/phase3-survey-build-reddit.md +0 -22
- package/dist/registry/ai-manager-rules/user-survey-phases/phase4-survey-build-x.md +0 -21
- package/dist/registry/ai-manager-rules/user-survey-phases/phase5-survey-build-facebook.md +0 -19
- package/dist/registry/ai-manager-rules/user-survey-phases/phase6-survey-build-custom.md +0 -15
- package/dist/registry/ai-manager-rules/user-survey-phases/phase7-survey-dispatch.md +0 -45
- package/dist/registry/providers/ado.json +0 -19
- package/dist/registry/providers/github.json +0 -19
- package/dist/registry/scripts/cleanup-branch.js +0 -287
- package/dist/registry/scripts/evaluate-code-quality.js +0 -66
- package/dist/registry/scripts/exec-with-timeout.js +0 -142
- package/dist/registry/scripts/generate-engagement-emails.js +0 -705
- package/dist/registry/scripts/newsletter-helpers.js +0 -671
- package/dist/registry/scripts/profile-server.js +0 -388
- package/dist/registry/scripts/run-thank-you-workflow.js +0 -92
- package/dist/registry/scripts/send-newsletter-simple.js +0 -85
- package/dist/registry/scripts/send-thank-you-emails.js +0 -54
- package/dist/registry/scripts/validate-openapi-limits.js +0 -311
- package/dist/registry/scripts/validate-test-coverage.js +0 -262
- package/dist/registry/scripts/verify-test-coverage.js +0 -66
- package/dist/registry/templates/bootstrap/ARCHITECTURE-TEMPLATE.md +0 -53
- package/dist/registry/templates/bootstrap/CODE-QUALITY-REPORT-TEMPLATE.md +0 -37
- package/dist/registry/templates/bootstrap/TEST-COVERAGE-REPORT-TEMPLATE.md +0 -35
- package/dist/registry/templates/business-development/IDEATION-REPORT-TEMPLATE.md +0 -29
- package/dist/registry/templates/business-development/PRICING-STRATEGY-TEMPLATE.md +0 -126
- package/dist/registry/templates/customer-development/customer-interview-template.md +0 -99
- package/dist/registry/templates/customer-development/customer-persona-template.md +0 -69
- package/dist/registry/templates/customer-development/follow-up-email-templates.md +0 -132
- package/dist/registry/templates/customer-development/insight-analysis-template.md +0 -74
- package/dist/registry/templates/customer-development/prospect-inventory-template.csv +0 -3
- package/dist/registry/templates/customer-development/search-strategy-template.md +0 -123
- package/dist/registry/templates/customer-development/strategic-recommendations-template.md +0 -53
- package/dist/registry/templates/customer-development/thank-you-email-template.html +0 -124
- package/dist/registry/templates/customer-development/thank-you-note-template.md +0 -16
- package/dist/registry/templates/customer-development/triage-log-template.md +0 -278
- package/dist/registry/templates/customer-development/weekly-newsletter-template.html +0 -204
- package/dist/registry/templates/evidence/Design-Evidence.md +0 -30
- package/dist/registry/templates/evidence/Implementation-BugEvidence.md +0 -94
- package/dist/registry/templates/evidence/Implementation-FeatureEvidence.md +0 -129
- package/dist/registry/templates/evidence/Spec-Evidence.md +0 -19
- package/dist/registry/templates/help/HelpNeeded.md +0 -14
- package/dist/registry/templates/legal/NDA-TEMPLATE.md +0 -170
- package/dist/registry/templates/legal/PATENT-TEMPLATE.md +0 -372
- package/dist/registry/templates/legal/TRADEMARK-TEMPLATE.md +0 -339
- package/dist/registry/templates/legal/contract-review-checklist.md +0 -193
- package/dist/registry/templates/legal/review-report-template.md +0 -198
- package/dist/registry/templates/legal/saas-terms-template.md +0 -174
- package/dist/registry/templates/legal/sow-template.md +0 -117
- package/dist/registry/templates/legal/template-variables.md +0 -131
- package/dist/registry/templates/marketing/DOMAIN-REGISTRATION-TEMPLATE.md +0 -194
- package/dist/registry/templates/marketing/HBR-ARTICLE-TEMPLATE.md +0 -66
- package/dist/registry/templates/marketing/STORYTELLING-TEMPLATE.md +0 -130
- package/dist/registry/templates/marketing/WEBSITE-TEMPLATE.md +0 -262
- package/dist/registry/templates/marketing/github-pages-workflow.yml +0 -64
- package/dist/registry/templates/replicate/implementation-checklist.md +0 -39
- package/dist/registry/templates/replicate/use-cases-template.md +0 -88
- package/dist/registry/templates/retrospective/RETROSPECTIVE-TEMPLATE.md +0 -55
- package/dist/registry/templates/specs/BUGSPEC-TEMPLATE.md +0 -37
- package/dist/registry/templates/specs/FEATURESPEC-TEMPLATE.md +0 -66
- package/dist/registry/templates/specs/TECHSPEC-TEMPLATE.md +0 -39
- package/dist/registry/workflows/bootstrap/create-architecture.md +0 -38
- package/dist/registry/workflows/bootstrap/detect-broken-windows.md +0 -300
- package/dist/registry/workflows/bootstrap/evaluate-code-quality.md +0 -35
- package/dist/registry/workflows/bootstrap/verify-test-coverage.md +0 -36
- package/dist/registry/workflows/brainstorming/blue-sky-brainstorming.md +0 -211
- package/dist/registry/workflows/brainstorming/codebase-brainstorming.md +0 -165
- package/dist/registry/workflows/business-development/create-business-plan.md +0 -737
- package/dist/registry/workflows/business-development/ideate-business-opportunity.md +0 -55
- package/dist/registry/workflows/business-development/price-product.md +0 -325
- package/dist/registry/workflows/compliance/detect-compliance-requirements.md +0 -78
- package/dist/registry/workflows/compliance/generate-audit-evidence.md +0 -75
- package/dist/registry/workflows/compliance/soc2-evidence-generator.md +0 -332
- package/dist/registry/workflows/customer-development/insight-analysis.md +0 -156
- package/dist/registry/workflows/customer-development/insight-triage.md +0 -938
- package/dist/registry/workflows/customer-development/interview-preparation.md +0 -452
- package/dist/registry/workflows/customer-development/linkedin-outreach.md +0 -593
- package/dist/registry/workflows/customer-development/strategic-brainstorming.md +0 -146
- package/dist/registry/workflows/customer-development/thank-customers.md +0 -203
- package/dist/registry/workflows/customer-development/user-survey-dispatch.md +0 -60
- package/dist/registry/workflows/customer-development/users-to-target.md +0 -112
- package/dist/registry/workflows/customer-development/weekly-newsletter.md +0 -366
- package/dist/registry/workflows/deploy/cloud-deployment.md +0 -310
- package/dist/registry/workflows/improve-fraim/contribute.md +0 -32
- package/dist/registry/workflows/improve-fraim/file-issue.md +0 -32
- package/dist/registry/workflows/learning/build-skillset.md +0 -212
- package/dist/registry/workflows/learning/synthesize-learnings.md +0 -284
- package/dist/registry/workflows/legal/contract-review-analysis.md +0 -382
- package/dist/registry/workflows/legal/nda.md +0 -69
- package/dist/registry/workflows/legal/patent-filing.md +0 -76
- package/dist/registry/workflows/legal/saas-contract-development.md +0 -213
- package/dist/registry/workflows/legal/trademark-filing.md +0 -77
- package/dist/registry/workflows/marketing/content-creation.md +0 -37
- package/dist/registry/workflows/marketing/convert-to-pdf.md +0 -235
- package/dist/registry/workflows/marketing/create-modern-website.md +0 -456
- package/dist/registry/workflows/marketing/domain-registration.md +0 -323
- package/dist/registry/workflows/marketing/hbr-article.md +0 -73
- package/dist/registry/workflows/marketing/launch-checklist.md +0 -37
- package/dist/registry/workflows/marketing/marketing-strategy.md +0 -45
- package/dist/registry/workflows/marketing/storytelling.md +0 -65
- package/dist/registry/workflows/performance/analyze-performance.md +0 -65
- package/dist/registry/workflows/product-building/design.md +0 -103
- package/dist/registry/workflows/product-building/implement.md +0 -74
- package/dist/registry/workflows/product-building/iterate-on-pr-comments.md +0 -70
- package/dist/registry/workflows/product-building/prep-issue.md +0 -41
- package/dist/registry/workflows/product-building/prototype.md +0 -65
- package/dist/registry/workflows/product-building/resolve.md +0 -168
- package/dist/registry/workflows/product-building/retrospect.md +0 -86
- package/dist/registry/workflows/product-building/spec.md +0 -181
- package/dist/registry/workflows/product-building/test.md +0 -125
- package/dist/registry/workflows/productivity-report/productivity-report.md +0 -263
- package/dist/registry/workflows/quality-assurance/browser-validation.md +0 -221
- package/dist/registry/workflows/quality-assurance/iterative-improvement-cycle.md +0 -562
- package/dist/registry/workflows/replicate/replicate-discovery.md +0 -336
- package/dist/registry/workflows/replicate/replicate-to-issues.md +0 -324
- package/dist/registry/workflows/reviewer/review-implementation-vs-design-spec.md +0 -638
- package/dist/registry/workflows/reviewer/review-implementation-vs-feature-spec.md +0 -675
- package/dist/registry/workflows/startup-credits/aws-activate-application.md +0 -535
- package/dist/registry/workflows/startup-credits/google-cloud-application.md +0 -647
- package/dist/registry/workflows/startup-credits/microsoft-azure-application.md +0 -538
- package/dist/scripts/build-stub-registry.js +0 -108
- package/dist/src/ai-manager/ai-manager.js +0 -480
- package/dist/src/ai-manager/phase-flow.js +0 -357
- package/dist/src/ai-manager/types.js +0 -5
- package/dist/src/fraim-mcp-server.js +0 -1885
- package/dist/tests/debug-tools.js +0 -80
- package/dist/tests/shared-server-utils.js +0 -57
- package/dist/tests/test-add-ide.js +0 -283
- package/dist/tests/test-ai-coach-edge-cases.js +0 -420
- package/dist/tests/test-ai-coach-mcp-integration.js +0 -450
- package/dist/tests/test-ai-coach-performance.js +0 -328
- package/dist/tests/test-ai-coach-phase-content.js +0 -264
- package/dist/tests/test-ai-coach-workflows.js +0 -514
- package/dist/tests/test-cli.js +0 -228
- package/dist/tests/test-client-scripts-validation.js +0 -167
- package/dist/tests/test-complete-setup-flow.js +0 -110
- package/dist/tests/test-config-system.js +0 -279
- package/dist/tests/test-debug-session.js +0 -134
- package/dist/tests/test-end-to-end-hybrid-validation.js +0 -328
- package/dist/tests/test-enhanced-session-init.js +0 -188
- package/dist/tests/test-first-run-journey.js +0 -368
- package/dist/tests/test-fraim-issues.js +0 -59
- package/dist/tests/test-genericization.js +0 -44
- package/dist/tests/test-hybrid-script-execution.js +0 -340
- package/dist/tests/test-ide-detector.js +0 -46
- package/dist/tests/test-improved-setup.js +0 -121
- package/dist/tests/test-mcp-config-generator.js +0 -99
- package/dist/tests/test-mcp-connection.js +0 -107
- package/dist/tests/test-mcp-issue-integration.js +0 -156
- package/dist/tests/test-mcp-lifecycle-methods.js +0 -240
- package/dist/tests/test-mcp-shared-server.js +0 -308
- package/dist/tests/test-mcp-template-processing.js +0 -160
- package/dist/tests/test-modular-issue-tracking.js +0 -165
- package/dist/tests/test-node-compatibility.js +0 -95
- package/dist/tests/test-npm-install.js +0 -68
- package/dist/tests/test-package-size.js +0 -108
- package/dist/tests/test-pr-review-workflow.js +0 -307
- package/dist/tests/test-prep-issue.js +0 -129
- package/dist/tests/test-productivity-integration.js +0 -157
- package/dist/tests/test-script-location-independence.js +0 -198
- package/dist/tests/test-script-sync.js +0 -557
- package/dist/tests/test-server-utils.js +0 -32
- package/dist/tests/test-session-rehydration.js +0 -148
- package/dist/tests/test-setup-integration.js +0 -98
- package/dist/tests/test-setup-scenarios.js +0 -322
- package/dist/tests/test-standalone.js +0 -143
- package/dist/tests/test-stub-registry.js +0 -136
- package/dist/tests/test-sync-stubs.js +0 -143
- package/dist/tests/test-sync-version-update.js +0 -93
- package/dist/tests/test-telemetry.js +0 -193
- package/dist/tests/test-token-validator.js +0 -30
- package/dist/tests/test-user-journey.js +0 -236
- package/dist/tests/test-users-to-target-workflow.js +0 -253
- package/dist/tests/test-utils.js +0 -109
- package/dist/tests/test-wizard.js +0 -71
- package/dist/tests/test-workflow-discovery.js +0 -242
- package/labels.json +0 -52
- package/registry/agent-guardrails.md +0 -63
- package/registry/fraim.md +0 -48
- package/setup.js +0 -171
- package/tsconfig.json +0 -23
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const axios_1 = __importDefault(require("axios"));
|
|
7
|
-
const test_utils_1 = require("./test-utils");
|
|
8
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
9
|
-
const db_service_js_1 = require("../src/fraim/db-service.js");
|
|
10
|
-
const shared_server_utils_1 = require("./shared-server-utils");
|
|
11
|
-
// Test 1: Basic Connection
|
|
12
|
-
async function testBasicConnection() {
|
|
13
|
-
console.log(' 🧪 Testing basic MCP connection...');
|
|
14
|
-
const BASE_URL = (0, shared_server_utils_1.getTestServerUrl)();
|
|
15
|
-
const MCP_URL = (0, shared_server_utils_1.getMcpEndpoint)();
|
|
16
|
-
const TEST_API_KEY = 'test-fraim-key-shared-basic';
|
|
17
|
-
let dbService;
|
|
18
|
-
try {
|
|
19
|
-
// Wait for server to be ready
|
|
20
|
-
await (0, shared_server_utils_1.waitForServer)();
|
|
21
|
-
// Setup test API key
|
|
22
|
-
dbService = new db_service_js_1.FraimDbService();
|
|
23
|
-
await dbService.connect();
|
|
24
|
-
const db = dbService.db;
|
|
25
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
26
|
-
await db.collection('fraim_api_keys').insertOne({
|
|
27
|
-
key: TEST_API_KEY,
|
|
28
|
-
userId: 'test-user-shared-basic',
|
|
29
|
-
orgId: 'test-org',
|
|
30
|
-
isActive: true,
|
|
31
|
-
createdAt: new Date()
|
|
32
|
-
});
|
|
33
|
-
// Test health endpoint
|
|
34
|
-
const healthRes = await axios_1.default.get(`${BASE_URL}/health`);
|
|
35
|
-
node_assert_1.default.strictEqual(healthRes.status, 200);
|
|
36
|
-
// Test MCP endpoint with initialize
|
|
37
|
-
const initRes = await axios_1.default.post(MCP_URL, {
|
|
38
|
-
jsonrpc: '2.0',
|
|
39
|
-
id: 1,
|
|
40
|
-
method: 'initialize',
|
|
41
|
-
params: {}
|
|
42
|
-
}, {
|
|
43
|
-
headers: { 'x-api-key': TEST_API_KEY }
|
|
44
|
-
});
|
|
45
|
-
node_assert_1.default.strictEqual(initRes.status, 200);
|
|
46
|
-
node_assert_1.default.strictEqual(initRes.data.jsonrpc, '2.0');
|
|
47
|
-
console.log(' ✅ Basic connection test passed');
|
|
48
|
-
return true;
|
|
49
|
-
}
|
|
50
|
-
catch (error) {
|
|
51
|
-
console.error(' ❌ Basic connection test failed:', error.message);
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
finally {
|
|
55
|
-
if (dbService) {
|
|
56
|
-
try {
|
|
57
|
-
const db = dbService.db;
|
|
58
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
59
|
-
await dbService.close();
|
|
60
|
-
}
|
|
61
|
-
catch (e) {
|
|
62
|
-
console.warn(' ⚠️ DB cleanup failed:', e);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
// Test 2: Tools List
|
|
68
|
-
async function testToolsList() {
|
|
69
|
-
console.log(' 🧪 Testing tools/list endpoint...');
|
|
70
|
-
const MCP_URL = (0, shared_server_utils_1.getMcpEndpoint)();
|
|
71
|
-
const TEST_API_KEY = 'test-fraim-key-shared-tools';
|
|
72
|
-
let dbService;
|
|
73
|
-
try {
|
|
74
|
-
// Wait for server to be ready
|
|
75
|
-
await (0, shared_server_utils_1.waitForServer)();
|
|
76
|
-
// Setup test API key
|
|
77
|
-
dbService = new db_service_js_1.FraimDbService();
|
|
78
|
-
await dbService.connect();
|
|
79
|
-
const db = dbService.db;
|
|
80
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
81
|
-
await db.collection('fraim_api_keys').insertOne({
|
|
82
|
-
key: TEST_API_KEY,
|
|
83
|
-
userId: 'test-user-shared-tools',
|
|
84
|
-
orgId: 'test-org',
|
|
85
|
-
isActive: true,
|
|
86
|
-
createdAt: new Date()
|
|
87
|
-
});
|
|
88
|
-
const res = await axios_1.default.post(MCP_URL, {
|
|
89
|
-
jsonrpc: '2.0',
|
|
90
|
-
id: 2,
|
|
91
|
-
method: 'tools/list',
|
|
92
|
-
params: {}
|
|
93
|
-
}, {
|
|
94
|
-
headers: { 'x-api-key': TEST_API_KEY }
|
|
95
|
-
});
|
|
96
|
-
node_assert_1.default.strictEqual(res.status, 200);
|
|
97
|
-
node_assert_1.default.strictEqual(res.data.jsonrpc, '2.0');
|
|
98
|
-
(0, node_assert_1.default)(Array.isArray(res.data.result.tools), 'Should return tools array');
|
|
99
|
-
console.log(` ✅ Tools list returned ${res.data.result.tools.length} tools`);
|
|
100
|
-
return true;
|
|
101
|
-
}
|
|
102
|
-
catch (error) {
|
|
103
|
-
console.error(' ❌ Tools list test failed:', error.message);
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
finally {
|
|
107
|
-
if (dbService) {
|
|
108
|
-
try {
|
|
109
|
-
const db = dbService.db;
|
|
110
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
111
|
-
await dbService.close();
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
console.warn(' ⚠️ DB cleanup failed:', e);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
// Test 3: Tool Call
|
|
120
|
-
async function testToolCall() {
|
|
121
|
-
console.log(' 🧪 Testing tool call (get_fraim_init)...');
|
|
122
|
-
const MCP_URL = (0, shared_server_utils_1.getMcpEndpoint)();
|
|
123
|
-
const TEST_API_KEY = 'test-fraim-key-shared-call';
|
|
124
|
-
let dbService;
|
|
125
|
-
try {
|
|
126
|
-
// Wait for server to be ready
|
|
127
|
-
await (0, shared_server_utils_1.waitForServer)();
|
|
128
|
-
// Setup test API key
|
|
129
|
-
dbService = new db_service_js_1.FraimDbService();
|
|
130
|
-
await dbService.connect();
|
|
131
|
-
const db = dbService.db;
|
|
132
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
133
|
-
await db.collection('fraim_api_keys').insertOne({
|
|
134
|
-
key: TEST_API_KEY,
|
|
135
|
-
userId: 'test-user-shared-call',
|
|
136
|
-
orgId: 'test-org',
|
|
137
|
-
isActive: true,
|
|
138
|
-
createdAt: new Date()
|
|
139
|
-
});
|
|
140
|
-
const res = await axios_1.default.post(MCP_URL, {
|
|
141
|
-
jsonrpc: '2.0',
|
|
142
|
-
id: 3,
|
|
143
|
-
method: 'tools/call',
|
|
144
|
-
params: {
|
|
145
|
-
name: 'get_fraim_init',
|
|
146
|
-
arguments: {}
|
|
147
|
-
}
|
|
148
|
-
}, {
|
|
149
|
-
headers: { 'x-api-key': TEST_API_KEY }
|
|
150
|
-
});
|
|
151
|
-
node_assert_1.default.strictEqual(res.status, 200);
|
|
152
|
-
node_assert_1.default.strictEqual(res.data.jsonrpc, '2.0');
|
|
153
|
-
(0, node_assert_1.default)(res.data.result, 'Should return result');
|
|
154
|
-
console.log(' ✅ Tool call test passed');
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
157
|
-
catch (error) {
|
|
158
|
-
console.error(' ❌ Tool call test failed:', error.message);
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
finally {
|
|
162
|
-
if (dbService) {
|
|
163
|
-
try {
|
|
164
|
-
const db = dbService.db;
|
|
165
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
166
|
-
await dbService.close();
|
|
167
|
-
}
|
|
168
|
-
catch (e) {
|
|
169
|
-
console.warn(' ⚠️ DB cleanup failed:', e);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
// Test 4: Error Handling
|
|
175
|
-
async function testErrorHandling() {
|
|
176
|
-
console.log(' 🧪 Testing error handling...');
|
|
177
|
-
const MCP_URL = (0, shared_server_utils_1.getMcpEndpoint)();
|
|
178
|
-
const TEST_API_KEY = 'test-fraim-key-shared-error';
|
|
179
|
-
let dbService;
|
|
180
|
-
try {
|
|
181
|
-
// Wait for server to be ready
|
|
182
|
-
await (0, shared_server_utils_1.waitForServer)();
|
|
183
|
-
// Setup test API key
|
|
184
|
-
dbService = new db_service_js_1.FraimDbService();
|
|
185
|
-
await dbService.connect();
|
|
186
|
-
const db = dbService.db;
|
|
187
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
188
|
-
await db.collection('fraim_api_keys').insertOne({
|
|
189
|
-
key: TEST_API_KEY,
|
|
190
|
-
userId: 'test-user-shared-error',
|
|
191
|
-
orgId: 'test-org',
|
|
192
|
-
isActive: true,
|
|
193
|
-
createdAt: new Date()
|
|
194
|
-
});
|
|
195
|
-
// Test invalid method
|
|
196
|
-
const res = await axios_1.default.post(MCP_URL, {
|
|
197
|
-
jsonrpc: '2.0',
|
|
198
|
-
id: 4,
|
|
199
|
-
method: 'invalid/method',
|
|
200
|
-
params: {}
|
|
201
|
-
}, {
|
|
202
|
-
headers: { 'x-api-key': TEST_API_KEY },
|
|
203
|
-
validateStatus: () => true // Don't throw on error status
|
|
204
|
-
});
|
|
205
|
-
// Should return error response, not crash
|
|
206
|
-
(0, node_assert_1.default)(res.data.error, 'Should return error for invalid method');
|
|
207
|
-
console.log(' ✅ Error handling test passed');
|
|
208
|
-
return true;
|
|
209
|
-
}
|
|
210
|
-
catch (error) {
|
|
211
|
-
console.error(' ❌ Error handling test failed:', error.message);
|
|
212
|
-
return false;
|
|
213
|
-
}
|
|
214
|
-
finally {
|
|
215
|
-
if (dbService) {
|
|
216
|
-
try {
|
|
217
|
-
const db = dbService.db;
|
|
218
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
219
|
-
await dbService.close();
|
|
220
|
-
}
|
|
221
|
-
catch (e) {
|
|
222
|
-
console.warn(' ⚠️ DB cleanup failed:', e);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
// Test 5: Concurrent Requests
|
|
228
|
-
async function testConcurrentRequests() {
|
|
229
|
-
console.log(' 🧪 Testing concurrent requests...');
|
|
230
|
-
const MCP_URL = (0, shared_server_utils_1.getMcpEndpoint)();
|
|
231
|
-
const TEST_API_KEY = 'test-fraim-key-shared-concurrent';
|
|
232
|
-
let dbService;
|
|
233
|
-
try {
|
|
234
|
-
// Wait for server to be ready
|
|
235
|
-
await (0, shared_server_utils_1.waitForServer)();
|
|
236
|
-
// Setup test API key
|
|
237
|
-
dbService = new db_service_js_1.FraimDbService();
|
|
238
|
-
await dbService.connect();
|
|
239
|
-
const db = dbService.db;
|
|
240
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
241
|
-
await db.collection('fraim_api_keys').insertOne({
|
|
242
|
-
key: TEST_API_KEY,
|
|
243
|
-
userId: 'test-user-shared-concurrent',
|
|
244
|
-
orgId: 'test-org',
|
|
245
|
-
isActive: true,
|
|
246
|
-
createdAt: new Date()
|
|
247
|
-
});
|
|
248
|
-
const requests = Array.from({ length: 5 }, (_, i) => axios_1.default.post(MCP_URL, {
|
|
249
|
-
jsonrpc: '2.0',
|
|
250
|
-
id: 10 + i,
|
|
251
|
-
method: 'tools/list',
|
|
252
|
-
params: {}
|
|
253
|
-
}, {
|
|
254
|
-
headers: { 'x-api-key': TEST_API_KEY }
|
|
255
|
-
}));
|
|
256
|
-
const responses = await Promise.all(requests);
|
|
257
|
-
responses.forEach((res, i) => {
|
|
258
|
-
node_assert_1.default.strictEqual(res.status, 200, `Request ${i} should succeed`);
|
|
259
|
-
node_assert_1.default.strictEqual(res.data.id, 10 + i, `Request ${i} should have correct ID`);
|
|
260
|
-
});
|
|
261
|
-
console.log(' ✅ Concurrent requests test passed');
|
|
262
|
-
return true;
|
|
263
|
-
}
|
|
264
|
-
catch (error) {
|
|
265
|
-
console.error(' ❌ Concurrent requests test failed:', error.message);
|
|
266
|
-
return false;
|
|
267
|
-
}
|
|
268
|
-
finally {
|
|
269
|
-
if (dbService) {
|
|
270
|
-
try {
|
|
271
|
-
const db = dbService.db;
|
|
272
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
273
|
-
await dbService.close();
|
|
274
|
-
}
|
|
275
|
-
catch (e) {
|
|
276
|
-
console.warn(' ⚠️ DB cleanup failed:', e);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
const testCases = [
|
|
282
|
-
{
|
|
283
|
-
name: 'Basic Connection',
|
|
284
|
-
testFunction: testBasicConnection
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
name: 'Tools List',
|
|
288
|
-
testFunction: testToolsList
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
name: 'Tool Call',
|
|
292
|
-
testFunction: testToolCall
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
name: 'Error Handling',
|
|
296
|
-
testFunction: testErrorHandling
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
name: 'Concurrent Requests',
|
|
300
|
-
testFunction: testConcurrentRequests
|
|
301
|
-
}
|
|
302
|
-
];
|
|
303
|
-
// Custom test runner function for shared MCP tests
|
|
304
|
-
async function runSharedMcpTest(testCase) {
|
|
305
|
-
return await testCase.testFunction();
|
|
306
|
-
}
|
|
307
|
-
// Use the standard test runner with the shared server
|
|
308
|
-
(0, test_utils_1.runTests)(testCases, runSharedMcpTest, 'Shared MCP Server Tests');
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Test MCP Server Template Processing
|
|
4
|
-
*
|
|
5
|
-
* Verifies that the MCP server correctly processes workflow templates
|
|
6
|
-
* with provider-specific actions when serving workflows.
|
|
7
|
-
*/
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.testMcpTemplateProcessing = testMcpTemplateProcessing;
|
|
13
|
-
const axios_1 = __importDefault(require("axios"));
|
|
14
|
-
const db_service_1 = require("../src/fraim/db-service");
|
|
15
|
-
const shared_server_utils_1 = require("./shared-server-utils");
|
|
16
|
-
const MCP_URL = (0, shared_server_utils_1.getMcpEndpoint)();
|
|
17
|
-
const TEST_API_KEY = 'test-mcp-template-key';
|
|
18
|
-
async function testMcpTemplateProcessing() {
|
|
19
|
-
console.log('🧪 Testing MCP Server Template Processing...');
|
|
20
|
-
const dbService = new db_service_1.FraimDbService();
|
|
21
|
-
try {
|
|
22
|
-
// Wait for server to be ready
|
|
23
|
-
await (0, shared_server_utils_1.waitForServer)();
|
|
24
|
-
await dbService.connect();
|
|
25
|
-
// Set up test API key in database
|
|
26
|
-
const db = dbService.db;
|
|
27
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
28
|
-
await db.collection('fraim_api_keys').insertOne({
|
|
29
|
-
key: TEST_API_KEY,
|
|
30
|
-
userId: 'test-user-mcp-template',
|
|
31
|
-
orgId: 'test-org',
|
|
32
|
-
isActive: true,
|
|
33
|
-
createdAt: new Date()
|
|
34
|
-
});
|
|
35
|
-
// First connect to establish session
|
|
36
|
-
console.log(' Setting up session...');
|
|
37
|
-
await axios_1.default.post(MCP_URL, {
|
|
38
|
-
jsonrpc: '2.0',
|
|
39
|
-
id: 0,
|
|
40
|
-
method: 'tools/call',
|
|
41
|
-
params: {
|
|
42
|
-
name: 'fraim_connect',
|
|
43
|
-
arguments: {
|
|
44
|
-
agent: {
|
|
45
|
-
name: 'Claude',
|
|
46
|
-
model: 'claude-3.5-sonnet'
|
|
47
|
-
},
|
|
48
|
-
machine: {
|
|
49
|
-
hostname: 'test-machine',
|
|
50
|
-
platform: 'linux'
|
|
51
|
-
},
|
|
52
|
-
repo: {
|
|
53
|
-
url: 'https://github.com/test/repo.git'
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}, {
|
|
58
|
-
headers: { 'x-api-key': TEST_API_KEY }
|
|
59
|
-
});
|
|
60
|
-
// Test 1: Get a real workflow (spec)
|
|
61
|
-
console.log(' Test 1: Get spec workflow...');
|
|
62
|
-
const workflowResponse = await axios_1.default.post(MCP_URL, {
|
|
63
|
-
jsonrpc: '2.0',
|
|
64
|
-
id: 1,
|
|
65
|
-
method: 'tools/call',
|
|
66
|
-
params: {
|
|
67
|
-
name: 'get_fraim_workflow',
|
|
68
|
-
arguments: {
|
|
69
|
-
workflow: 'spec'
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}, {
|
|
73
|
-
headers: { 'x-api-key': TEST_API_KEY }
|
|
74
|
-
});
|
|
75
|
-
if (workflowResponse.status !== 200) {
|
|
76
|
-
throw new Error(`Expected 200, got ${workflowResponse.status}`);
|
|
77
|
-
}
|
|
78
|
-
const workflowContent = workflowResponse.data.result.content[0].text;
|
|
79
|
-
// Should contain the workflow content
|
|
80
|
-
if (!workflowContent.includes('Specification Phase')) {
|
|
81
|
-
throw new Error('Spec workflow content not found');
|
|
82
|
-
}
|
|
83
|
-
// Should show platform info
|
|
84
|
-
if (!workflowContent.includes('**Platform:** GITHUB')) {
|
|
85
|
-
throw new Error('Template processing failed - missing platform info');
|
|
86
|
-
}
|
|
87
|
-
console.log(' ✅ Spec workflow processed correctly');
|
|
88
|
-
// Test 2: Verify template actions are replaced
|
|
89
|
-
console.log(' Test 2: Verify template actions are replaced...');
|
|
90
|
-
// Should NOT contain raw template actions
|
|
91
|
-
if (workflowContent.includes('{{get_issue}}')) {
|
|
92
|
-
throw new Error('Template processing incomplete - raw template actions still present');
|
|
93
|
-
}
|
|
94
|
-
console.log(' ✅ Template actions properly replaced');
|
|
95
|
-
// Test 3: Test workflow list still works
|
|
96
|
-
console.log(' Test 3: Test workflow list functionality...');
|
|
97
|
-
const listResponse = await axios_1.default.post(MCP_URL, {
|
|
98
|
-
jsonrpc: '2.0',
|
|
99
|
-
id: 2,
|
|
100
|
-
method: 'tools/call',
|
|
101
|
-
params: {
|
|
102
|
-
name: 'list_fraim_workflows',
|
|
103
|
-
arguments: {}
|
|
104
|
-
}
|
|
105
|
-
}, {
|
|
106
|
-
headers: { 'x-api-key': TEST_API_KEY }
|
|
107
|
-
});
|
|
108
|
-
if (listResponse.status !== 200) {
|
|
109
|
-
throw new Error(`Expected 200, got ${listResponse.status}`);
|
|
110
|
-
}
|
|
111
|
-
const listContent = listResponse.data.result.content[0].text;
|
|
112
|
-
// Should include spec workflow
|
|
113
|
-
if (!listContent.includes('spec')) {
|
|
114
|
-
throw new Error('Spec workflow not found in workflow list');
|
|
115
|
-
}
|
|
116
|
-
console.log(' ✅ Workflow list functionality works');
|
|
117
|
-
console.log('✅ All MCP Server Template Processing tests passed!');
|
|
118
|
-
console.log(`
|
|
119
|
-
📋 **Template Processing Verified**:
|
|
120
|
-
- ✅ Workflow content retrieved correctly
|
|
121
|
-
- ✅ Platform detection working
|
|
122
|
-
- ✅ Workflow discovery still functional
|
|
123
|
-
`);
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
catch (error) {
|
|
127
|
-
console.error('❌ MCP Server Template Processing test failed:', error.message);
|
|
128
|
-
if (error.response?.data) {
|
|
129
|
-
console.error(' Response data:', JSON.stringify(error.response.data, null, 2));
|
|
130
|
-
}
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
finally {
|
|
134
|
-
// Clean up
|
|
135
|
-
if (dbService) {
|
|
136
|
-
try {
|
|
137
|
-
const db = dbService.db;
|
|
138
|
-
await db.collection('fraim_api_keys').deleteOne({ key: TEST_API_KEY });
|
|
139
|
-
await db.collection('fraim_telemetry_sessions').deleteMany({ userId: 'test-user-mcp-template' });
|
|
140
|
-
}
|
|
141
|
-
catch (e) {
|
|
142
|
-
// Ignore cleanup errors
|
|
143
|
-
}
|
|
144
|
-
await dbService.close();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// Run if called directly
|
|
149
|
-
if (require.main === module) {
|
|
150
|
-
testMcpTemplateProcessing()
|
|
151
|
-
.then(success => {
|
|
152
|
-
if (!success) {
|
|
153
|
-
throw new Error('Test failed');
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
.catch(err => {
|
|
157
|
-
console.error('Test runner error:', err);
|
|
158
|
-
throw err;
|
|
159
|
-
});
|
|
160
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Test Multi-Provider Platform Support (Issue #39)
|
|
4
|
-
*
|
|
5
|
-
* Verifies that the template engine correctly processes workflows
|
|
6
|
-
* with provider-specific action mappings for GitHub and ADO.
|
|
7
|
-
*/
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.testMultiProviderSupport = testMultiProviderSupport;
|
|
10
|
-
const template_processor_1 = require("../src/fraim/template-processor");
|
|
11
|
-
const platform_detection_1 = require("../src/utils/platform-detection");
|
|
12
|
-
async function testMultiProviderSupport() {
|
|
13
|
-
console.log('🧪 Testing Multi-Provider Platform Support (Issue #39)...');
|
|
14
|
-
try {
|
|
15
|
-
// Test 1: Template Engine Creation
|
|
16
|
-
console.log(' Test 1: Template engine initialization...');
|
|
17
|
-
const templateEngine = new template_processor_1.TemplateEngine();
|
|
18
|
-
const providers = templateEngine.getAvailableProviders();
|
|
19
|
-
if (!providers.includes('github') || !providers.includes('ado')) {
|
|
20
|
-
throw new Error('Expected GitHub and ADO providers not found');
|
|
21
|
-
}
|
|
22
|
-
console.log(` ✅ Loaded providers: ${providers.join(', ')}`);
|
|
23
|
-
// Test 2: GitHub Template Processing
|
|
24
|
-
console.log(' Test 2: GitHub template processing...');
|
|
25
|
-
const githubConfig = {
|
|
26
|
-
version: '2.0.47',
|
|
27
|
-
project: { name: 'Test Project' },
|
|
28
|
-
repository: {
|
|
29
|
-
provider: 'github',
|
|
30
|
-
owner: 'testowner',
|
|
31
|
-
name: 'testrepo',
|
|
32
|
-
defaultBranch: 'main'
|
|
33
|
-
},
|
|
34
|
-
persona: { name: 'Test', voice: 'Test', emailSignature: 'Test', displayNamePattern: 'Test' }
|
|
35
|
-
};
|
|
36
|
-
const testWorkflow = `
|
|
37
|
-
# Test Workflow
|
|
38
|
-
{{get_issue}} to get issue details.
|
|
39
|
-
{{create_pr}} to create pull request.
|
|
40
|
-
{{merge_pr}} to merge when ready.
|
|
41
|
-
`.trim();
|
|
42
|
-
const githubProcessed = templateEngine.processWorkflow(testWorkflow, githubConfig);
|
|
43
|
-
if (!githubProcessed.includes('mcp_github_issue_read')) {
|
|
44
|
-
throw new Error('GitHub template processing failed - missing mcp_github_issue_read');
|
|
45
|
-
}
|
|
46
|
-
if (!githubProcessed.includes('testowner')) {
|
|
47
|
-
throw new Error('GitHub template processing failed - missing owner substitution');
|
|
48
|
-
}
|
|
49
|
-
console.log(' ✅ GitHub template processing works');
|
|
50
|
-
// Test 3: ADO Template Processing
|
|
51
|
-
console.log(' Test 3: ADO template processing...');
|
|
52
|
-
const adoConfig = {
|
|
53
|
-
version: '2.0.47',
|
|
54
|
-
project: { name: 'Test Project' },
|
|
55
|
-
repository: {
|
|
56
|
-
provider: 'ado',
|
|
57
|
-
organization: 'testorg',
|
|
58
|
-
project: 'testproject',
|
|
59
|
-
name: 'testrepo',
|
|
60
|
-
defaultBranch: 'main'
|
|
61
|
-
},
|
|
62
|
-
persona: { name: 'Test', voice: 'Test', emailSignature: 'Test', displayNamePattern: 'Test' }
|
|
63
|
-
};
|
|
64
|
-
const adoProcessed = templateEngine.processWorkflow(testWorkflow, adoConfig);
|
|
65
|
-
if (!adoProcessed.includes('mcp_ado_get_work_item')) {
|
|
66
|
-
throw new Error('ADO template processing failed - missing mcp_ado_get_work_item');
|
|
67
|
-
}
|
|
68
|
-
if (!adoProcessed.includes('testorg')) {
|
|
69
|
-
throw new Error('ADO template processing failed - missing organization substitution');
|
|
70
|
-
}
|
|
71
|
-
console.log(' ✅ ADO template processing works');
|
|
72
|
-
// Test 4: Platform Detection
|
|
73
|
-
console.log(' Test 4: Platform detection...');
|
|
74
|
-
const githubDetection = (0, platform_detection_1.detectPlatformFromUrl)('https://github.com/owner/repo.git');
|
|
75
|
-
if (githubDetection.provider !== 'github' || githubDetection.repository?.owner !== 'owner') {
|
|
76
|
-
throw new Error('GitHub URL detection failed');
|
|
77
|
-
}
|
|
78
|
-
const adoDetection = (0, platform_detection_1.detectPlatformFromUrl)('https://dev.azure.com/org/project/_git/repo');
|
|
79
|
-
if (adoDetection.provider !== 'ado' || adoDetection.repository?.organization !== 'org') {
|
|
80
|
-
throw new Error('ADO URL detection failed');
|
|
81
|
-
}
|
|
82
|
-
console.log(' ✅ Platform detection works');
|
|
83
|
-
// Test 5: Repository Config Validation
|
|
84
|
-
console.log(' Test 5: Repository config validation...');
|
|
85
|
-
const validGitHub = (0, platform_detection_1.validateRepositoryConfig)({
|
|
86
|
-
provider: 'github',
|
|
87
|
-
owner: 'test',
|
|
88
|
-
name: 'repo'
|
|
89
|
-
});
|
|
90
|
-
if (!validGitHub.valid) {
|
|
91
|
-
throw new Error(`Valid GitHub config rejected: ${validGitHub.errors.join(', ')}`);
|
|
92
|
-
}
|
|
93
|
-
const validAdo = (0, platform_detection_1.validateRepositoryConfig)({
|
|
94
|
-
provider: 'ado',
|
|
95
|
-
organization: 'org',
|
|
96
|
-
project: 'proj',
|
|
97
|
-
name: 'repo'
|
|
98
|
-
});
|
|
99
|
-
if (!validAdo.valid) {
|
|
100
|
-
throw new Error(`Valid ADO config rejected: ${validAdo.errors.join(', ')}`);
|
|
101
|
-
}
|
|
102
|
-
const invalidConfig = (0, platform_detection_1.validateRepositoryConfig)({
|
|
103
|
-
provider: 'github'
|
|
104
|
-
// Missing required fields
|
|
105
|
-
});
|
|
106
|
-
if (invalidConfig.valid) {
|
|
107
|
-
throw new Error('Invalid config should have been rejected');
|
|
108
|
-
}
|
|
109
|
-
console.log(' ✅ Repository config validation works');
|
|
110
|
-
// Test 6: Template Action Coverage
|
|
111
|
-
console.log(' Test 6: Template action coverage...');
|
|
112
|
-
const githubActions = templateEngine.getProviderActions('github');
|
|
113
|
-
const adoActions = templateEngine.getProviderActions('ado');
|
|
114
|
-
const requiredActions = ['get_issue', 'create_pr', 'merge_pr', 'update_issue_status'];
|
|
115
|
-
for (const action of requiredActions) {
|
|
116
|
-
if (!githubActions.includes(action)) {
|
|
117
|
-
throw new Error(`GitHub missing required action: ${action}`);
|
|
118
|
-
}
|
|
119
|
-
if (!adoActions.includes(action)) {
|
|
120
|
-
throw new Error(`ADO missing required action: ${action}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
console.log(` ✅ Action coverage: GitHub(${githubActions.length}), ADO(${adoActions.length})`);
|
|
124
|
-
// Test 7: Workflow Validation
|
|
125
|
-
console.log(' Test 7: Workflow validation...');
|
|
126
|
-
const validation = templateEngine.validateWorkflow(testWorkflow, 'github');
|
|
127
|
-
if (!validation.valid) {
|
|
128
|
-
throw new Error(`Workflow validation failed: ${validation.missingActions.join(', ')}`);
|
|
129
|
-
}
|
|
130
|
-
const invalidWorkflow = '{{nonexistent_action}} should fail';
|
|
131
|
-
const invalidValidation = templateEngine.validateWorkflow(invalidWorkflow, 'github');
|
|
132
|
-
if (invalidValidation.valid) {
|
|
133
|
-
throw new Error('Invalid workflow should have failed validation');
|
|
134
|
-
}
|
|
135
|
-
console.log(' ✅ Workflow validation works');
|
|
136
|
-
console.log('✅ All Multi-Provider Platform Support tests passed!');
|
|
137
|
-
console.log(`
|
|
138
|
-
📋 **Summary**:
|
|
139
|
-
- Providers: ${providers.join(', ')}
|
|
140
|
-
- GitHub Actions: ${githubActions.length}
|
|
141
|
-
- ADO Actions: ${adoActions.length}
|
|
142
|
-
- Template Processing: ✅ Working
|
|
143
|
-
- Platform Detection: ✅ Working
|
|
144
|
-
- Config Validation: ✅ Working
|
|
145
|
-
`);
|
|
146
|
-
return true;
|
|
147
|
-
}
|
|
148
|
-
catch (error) {
|
|
149
|
-
console.error('❌ Multi-Provider Platform Support test failed:', error.message);
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
// Run if called directly
|
|
154
|
-
if (require.main === module) {
|
|
155
|
-
testMultiProviderSupport()
|
|
156
|
-
.then(success => {
|
|
157
|
-
if (!success) {
|
|
158
|
-
throw new Error('Test failed');
|
|
159
|
-
}
|
|
160
|
-
})
|
|
161
|
-
.catch(err => {
|
|
162
|
-
console.error('Test runner error:', err);
|
|
163
|
-
throw err;
|
|
164
|
-
});
|
|
165
|
-
}
|