edsger 0.2.0 → 0.2.1
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.
|
@@ -31,16 +31,42 @@ export interface TestReportCreateOptions {
|
|
|
31
31
|
mcpToken: string;
|
|
32
32
|
featureId: string;
|
|
33
33
|
testReportData: TestReportData;
|
|
34
|
+
testResults?: TestResultInput[];
|
|
34
35
|
verbose?: boolean;
|
|
35
36
|
}
|
|
37
|
+
export interface TestResultInput {
|
|
38
|
+
test_case_id: string;
|
|
39
|
+
result: 'passed' | 'failed' | 'skipped';
|
|
40
|
+
notes?: string;
|
|
41
|
+
}
|
|
36
42
|
export interface TestReportResult {
|
|
37
43
|
success: boolean;
|
|
38
44
|
testReport?: TestReport;
|
|
39
45
|
testReportUrl?: string;
|
|
40
46
|
error?: string;
|
|
41
47
|
}
|
|
48
|
+
export interface TestReportResultsOptions {
|
|
49
|
+
mcpServerUrl: string;
|
|
50
|
+
mcpToken: string;
|
|
51
|
+
testReportId: string;
|
|
52
|
+
testResults: TestResultInput[];
|
|
53
|
+
verbose?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface TestReportResultsResponse {
|
|
56
|
+
success: boolean;
|
|
57
|
+
resultsCreated?: number;
|
|
58
|
+
error?: string;
|
|
59
|
+
}
|
|
42
60
|
/**
|
|
43
61
|
* Create a test report via MCP endpoint
|
|
44
62
|
* Uses structured data generated by Claude Code
|
|
45
63
|
*/
|
|
46
64
|
export declare function createTestReport(options: TestReportCreateOptions): Promise<TestReportResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Manual fallback: Call MCP endpoint with structured data
|
|
67
|
+
* This is used when Claude Code fails to call MCP directly
|
|
68
|
+
*/
|
|
69
|
+
/**
|
|
70
|
+
* Create test report results via MCP endpoint
|
|
71
|
+
*/
|
|
72
|
+
export declare function createTestReportResults(options: TestReportResultsOptions): Promise<TestReportResultsResponse>;
|
|
@@ -4,7 +4,7 @@ import { logInfo, logError } from '../logger.js';
|
|
|
4
4
|
* Uses structured data generated by Claude Code
|
|
5
5
|
*/
|
|
6
6
|
export async function createTestReport(options) {
|
|
7
|
-
const { mcpServerUrl, mcpToken, featureId, testReportData, verbose } = options;
|
|
7
|
+
const { mcpServerUrl, mcpToken, featureId, testReportData, testResults, verbose, } = options;
|
|
8
8
|
if (verbose) {
|
|
9
9
|
logInfo(`Creating test report for feature: ${featureId}`);
|
|
10
10
|
}
|
|
@@ -53,6 +53,19 @@ export async function createTestReport(options) {
|
|
|
53
53
|
if (verbose) {
|
|
54
54
|
logInfo(`✅ Test report created via MCP: ${testReport.id}`);
|
|
55
55
|
}
|
|
56
|
+
// Create test report results if provided
|
|
57
|
+
if (testResults && testResults.length > 0) {
|
|
58
|
+
const resultsResponse = await createTestReportResults({
|
|
59
|
+
mcpServerUrl,
|
|
60
|
+
mcpToken,
|
|
61
|
+
testReportId: testReport.id,
|
|
62
|
+
testResults,
|
|
63
|
+
verbose,
|
|
64
|
+
});
|
|
65
|
+
if (verbose && resultsResponse.success) {
|
|
66
|
+
logInfo(`✅ Created ${resultsResponse.resultsCreated} test report results`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
56
69
|
return {
|
|
57
70
|
success: true,
|
|
58
71
|
testReport,
|
|
@@ -65,7 +78,7 @@ export async function createTestReport(options) {
|
|
|
65
78
|
logInfo('Claude Code MCP call may have failed, manually calling MCP endpoint...');
|
|
66
79
|
}
|
|
67
80
|
// Manual fallback: Call MCP endpoint with the structured data
|
|
68
|
-
const fallbackResult = await manualMcpTestReportCreation(mcpServerUrl, mcpToken, featureId, structuredReport, verbose);
|
|
81
|
+
const fallbackResult = await manualMcpTestReportCreation(mcpServerUrl, mcpToken, featureId, structuredReport, testResults, verbose);
|
|
69
82
|
return fallbackResult;
|
|
70
83
|
}
|
|
71
84
|
catch (error) {
|
|
@@ -74,14 +87,70 @@ export async function createTestReport(options) {
|
|
|
74
87
|
logError(`Test report creation failed: ${errorMessage}`);
|
|
75
88
|
}
|
|
76
89
|
// Manual fallback on any error
|
|
77
|
-
return manualMcpTestReportCreation(mcpServerUrl, mcpToken, featureId, structuredReport, verbose);
|
|
90
|
+
return manualMcpTestReportCreation(mcpServerUrl, mcpToken, featureId, structuredReport, testResults, verbose);
|
|
78
91
|
}
|
|
79
92
|
}
|
|
80
93
|
/**
|
|
81
94
|
* Manual fallback: Call MCP endpoint with structured data
|
|
82
95
|
* This is used when Claude Code fails to call MCP directly
|
|
83
96
|
*/
|
|
84
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Create test report results via MCP endpoint
|
|
99
|
+
*/
|
|
100
|
+
export async function createTestReportResults(options) {
|
|
101
|
+
const { mcpServerUrl, mcpToken, testReportId, testResults, verbose } = options;
|
|
102
|
+
if (verbose) {
|
|
103
|
+
logInfo(`Creating ${testResults.length} test report results for report: ${testReportId}`);
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const response = await fetch(`${mcpServerUrl}/mcp`, {
|
|
107
|
+
method: 'POST',
|
|
108
|
+
headers: {
|
|
109
|
+
'Content-Type': 'application/json',
|
|
110
|
+
Authorization: `Bearer ${mcpToken}`,
|
|
111
|
+
},
|
|
112
|
+
body: JSON.stringify({
|
|
113
|
+
jsonrpc: '2.0',
|
|
114
|
+
method: 'test_report_results/create',
|
|
115
|
+
params: {
|
|
116
|
+
test_report_id: testReportId,
|
|
117
|
+
test_results: testResults,
|
|
118
|
+
},
|
|
119
|
+
id: Math.random().toString(36).substring(7),
|
|
120
|
+
}),
|
|
121
|
+
});
|
|
122
|
+
const data = await response.json();
|
|
123
|
+
if (response.ok && !data.error && data.result) {
|
|
124
|
+
const resultData = data.result;
|
|
125
|
+
if (verbose) {
|
|
126
|
+
logInfo(`✅ Created ${resultData.results_created} test report results`);
|
|
127
|
+
}
|
|
128
|
+
return {
|
|
129
|
+
success: true,
|
|
130
|
+
resultsCreated: resultData.results_created,
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const errorMessage = data.error?.message || 'Failed to create test report results';
|
|
134
|
+
if (verbose) {
|
|
135
|
+
logError(`Test report results creation failed: ${errorMessage}`);
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
success: false,
|
|
139
|
+
error: errorMessage,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
144
|
+
if (verbose) {
|
|
145
|
+
logError(`Test report results creation failed: ${errorMessage}`);
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
success: false,
|
|
149
|
+
error: errorMessage,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async function manualMcpTestReportCreation(mcpServerUrl, mcpToken, featureId, structuredReport, testResults, verbose) {
|
|
85
154
|
if (verbose) {
|
|
86
155
|
logInfo('Manually calling MCP test_reports/create endpoint with structured data');
|
|
87
156
|
}
|
|
@@ -114,6 +183,19 @@ async function manualMcpTestReportCreation(mcpServerUrl, mcpToken, featureId, st
|
|
|
114
183
|
if (verbose) {
|
|
115
184
|
logInfo(`✅ Test report created manually via MCP: ${testReport.id}`);
|
|
116
185
|
}
|
|
186
|
+
// Create test report results if provided
|
|
187
|
+
if (testResults && testResults.length > 0) {
|
|
188
|
+
const resultsResponse = await createTestReportResults({
|
|
189
|
+
mcpServerUrl,
|
|
190
|
+
mcpToken,
|
|
191
|
+
testReportId: testReport.id,
|
|
192
|
+
testResults,
|
|
193
|
+
verbose,
|
|
194
|
+
});
|
|
195
|
+
if (verbose && resultsResponse.success) {
|
|
196
|
+
logInfo(`✅ Created ${resultsResponse.resultsCreated} test report results`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
117
199
|
return {
|
|
118
200
|
success: true,
|
|
119
201
|
testReport,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "edsger",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"description": "AI-powered software development CLI tool with comprehensive feature management, code review, technical design, implementation, and testing capabilities using Claude Code SDK and MCP integration",
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
35
|
-
"url": "https://github.com/
|
|
35
|
+
"url": "git+https://github.com/stevenzg/edsger.git"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=18.0.0"
|