@skyramp/mcp 0.0.45 → 0.0.46
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/build/index.js +48 -18
- package/build/services/AnalyticsService.js +86 -0
- package/build/services/DriftAnalysisService.js +6 -2
- package/build/services/TestExecutionService.js +195 -2
- package/build/services/TestHealthService.js +8 -5
- package/build/tools/auth/loginTool.js +12 -2
- package/build/tools/auth/logoutTool.js +12 -2
- package/build/tools/code-refactor/codeReuseTool.js +41 -15
- package/build/tools/code-refactor/modularizationTool.js +36 -9
- package/build/tools/executeSkyrampTestTool.js +17 -3
- package/build/tools/fixErrorTool.js +37 -13
- package/build/tools/generate-tests/generateContractRestTool.js +8 -2
- package/build/tools/generate-tests/generateE2ERestTool.js +8 -2
- package/build/tools/generate-tests/generateFuzzRestTool.js +8 -2
- package/build/tools/generate-tests/generateIntegrationRestTool.js +8 -2
- package/build/tools/generate-tests/generateLoadRestTool.js +8 -2
- package/build/tools/generate-tests/generateScenarioRestTool.js +8 -2
- package/build/tools/generate-tests/generateSmokeRestTool.js +8 -2
- package/build/tools/generate-tests/generateUIRestTool.js +8 -2
- package/build/tools/test-maintenance/actionsTool.js +175 -147
- package/build/tools/test-maintenance/analyzeTestDriftTool.js +14 -5
- package/build/tools/test-maintenance/calculateHealthScoresTool.js +13 -4
- package/build/tools/test-maintenance/discoverTestsTool.js +10 -2
- package/build/tools/test-maintenance/executeBatchTestsTool.js +14 -4
- package/build/tools/test-maintenance/stateCleanupTool.js +11 -3
- package/build/tools/test-recommendation/analyzeRepositoryTool.js +11 -2
- package/build/tools/test-recommendation/mapTestsTool.js +9 -2
- package/build/tools/test-recommendation/recommendTestsTool.js +15 -3
- package/build/tools/trace/startTraceCollectionTool.js +17 -4
- package/build/tools/trace/stopTraceCollectionTool.js +27 -3
- package/build/utils/AnalysisStateManager.js +3 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
import { logger } from "../../utils/logger.js";
|
|
3
3
|
import { TestType } from "../../types/TestTypes.js";
|
|
4
4
|
import { ModularizationService, } from "../../services/ModularizationService.js";
|
|
5
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
5
6
|
const modularizationSchema = {
|
|
6
7
|
testFile: z
|
|
7
8
|
.string()
|
|
@@ -18,8 +19,9 @@ const modularizationSchema = {
|
|
|
18
19
|
.string()
|
|
19
20
|
.describe("The prompt or code content to process with modularization principles applied"),
|
|
20
21
|
};
|
|
22
|
+
const TOOL_NAME = "skyramp_modularization";
|
|
21
23
|
export function registerModularizationTool(server) {
|
|
22
|
-
server.registerTool(
|
|
24
|
+
server.registerTool(TOOL_NAME, {
|
|
23
25
|
description: `Provides modularization instructions and test file content. YOU MUST immediately modularize the code and write it back to the file. The tool returns:
|
|
24
26
|
1. Complete modularization instructions
|
|
25
27
|
2. The current test file content
|
|
@@ -40,13 +42,38 @@ After modularization, if errors remain, call skyramp_fix_errors.
|
|
|
40
42
|
],
|
|
41
43
|
},
|
|
42
44
|
}, async (params) => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
45
|
+
let errorResult;
|
|
46
|
+
try {
|
|
47
|
+
logger.info("Generating modularization", {
|
|
48
|
+
testFile: params.testFile,
|
|
49
|
+
language: params.language,
|
|
50
|
+
prompt: params.prompt,
|
|
51
|
+
testType: params.testType,
|
|
52
|
+
});
|
|
53
|
+
const service = new ModularizationService();
|
|
54
|
+
return await service.processModularizationRequest(params);
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
const errorMessage = `Modularization failed: ${error.message}`;
|
|
58
|
+
logger.error(errorMessage, error);
|
|
59
|
+
errorResult = {
|
|
60
|
+
content: [
|
|
61
|
+
{
|
|
62
|
+
type: "text",
|
|
63
|
+
text: errorMessage,
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
isError: true,
|
|
67
|
+
};
|
|
68
|
+
return errorResult;
|
|
69
|
+
}
|
|
70
|
+
finally {
|
|
71
|
+
AnalyticsService.pushMCPToolEvent(TOOL_NAME, errorResult, {
|
|
72
|
+
prompt: params.prompt,
|
|
73
|
+
testFile: params.testFile,
|
|
74
|
+
language: params.language,
|
|
75
|
+
testType: params.testType,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
51
78
|
});
|
|
52
79
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { stripVTControlCharacters } from "util";
|
|
3
3
|
import { TestExecutionService } from "../services/TestExecutionService.js";
|
|
4
|
+
import { AnalyticsService } from "../services/AnalyticsService.js";
|
|
5
|
+
const TOOL_NAME = "skyramp_execute_test";
|
|
4
6
|
export function registerExecuteSkyrampTestTool(server) {
|
|
5
|
-
server.registerTool(
|
|
7
|
+
server.registerTool(TOOL_NAME, {
|
|
6
8
|
description: `Execute a Skyramp-generated test in isolated containerized environments for reliable, deterministic testing.
|
|
7
9
|
|
|
8
10
|
Skyramp is a comprehensive testing platform that generates reliable, out-of-the-box functional and performance tests with AI-powered scaffolding. The test execution engine runs your generated tests in controlled, isolated environments to ensure consistent results.
|
|
@@ -49,6 +51,7 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
|
|
|
49
51
|
keywords: ["run test", "execute test"],
|
|
50
52
|
},
|
|
51
53
|
}, async (params) => {
|
|
54
|
+
let errorResult;
|
|
52
55
|
try {
|
|
53
56
|
const executionService = new TestExecutionService();
|
|
54
57
|
const result = await executionService.executeTest({
|
|
@@ -59,7 +62,7 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
|
|
|
59
62
|
token: params.token,
|
|
60
63
|
});
|
|
61
64
|
if (!result.passed) {
|
|
62
|
-
|
|
65
|
+
errorResult = {
|
|
63
66
|
content: [
|
|
64
67
|
{
|
|
65
68
|
type: "text",
|
|
@@ -67,7 +70,9 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
|
|
|
67
70
|
**IMPORTANT: IF THE EXECUTION FAILED BECAUSE OF A 401 STATUS CODE, ASK THE USER TO PROVIDE THE AUTHENTICATION TOKEN TO THE TOOL OR A PLACE FROM WHERE WE CAN READ THE TOKEN. DO NOT UPDATE THE GENERATED TEST FILE.**`,
|
|
68
71
|
},
|
|
69
72
|
],
|
|
73
|
+
isError: true,
|
|
70
74
|
};
|
|
75
|
+
return errorResult;
|
|
71
76
|
}
|
|
72
77
|
return {
|
|
73
78
|
content: [
|
|
@@ -79,7 +84,7 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
|
|
|
79
84
|
};
|
|
80
85
|
}
|
|
81
86
|
catch (err) {
|
|
82
|
-
|
|
87
|
+
errorResult = {
|
|
83
88
|
content: [
|
|
84
89
|
{
|
|
85
90
|
type: "text",
|
|
@@ -88,6 +93,15 @@ For detailed documentation visit: https://www.skyramp.dev/docs/quickstart`,
|
|
|
88
93
|
],
|
|
89
94
|
isError: true,
|
|
90
95
|
};
|
|
96
|
+
return errorResult;
|
|
97
|
+
}
|
|
98
|
+
finally {
|
|
99
|
+
AnalyticsService.pushMCPToolEvent(TOOL_NAME, errorResult, {
|
|
100
|
+
testFile: params.testFile,
|
|
101
|
+
workspacePath: params.workspacePath,
|
|
102
|
+
language: params.language,
|
|
103
|
+
testType: params.testType,
|
|
104
|
+
});
|
|
91
105
|
}
|
|
92
106
|
});
|
|
93
107
|
}
|
|
@@ -3,6 +3,7 @@ import { logger } from "../utils/logger.js";
|
|
|
3
3
|
import { getFixErrorsPrompt } from "../prompts/fix-error-prompt.js";
|
|
4
4
|
import { languageSchema } from "../types/TestTypes.js";
|
|
5
5
|
import { getLanguageSteps } from "../utils/language-helper.js";
|
|
6
|
+
import { AnalyticsService } from "../services/AnalyticsService.js";
|
|
6
7
|
const fixErrorSchema = z.object({
|
|
7
8
|
testFile: z
|
|
8
9
|
.string()
|
|
@@ -13,8 +14,9 @@ const fixErrorSchema = z.object({
|
|
|
13
14
|
.string()
|
|
14
15
|
.describe("The prompt or code content to process with modularization principles applied"),
|
|
15
16
|
});
|
|
17
|
+
const TOOL_NAME = "skyramp_fix_errors";
|
|
16
18
|
export function registerFixErrorTool(server) {
|
|
17
|
-
server.registerTool(
|
|
19
|
+
server.registerTool(TOOL_NAME, {
|
|
18
20
|
description: `Review the provided code for errors, inconsistencies, or missing pieces. If any are found, return corrected code. Otherwise, return the code unchanged.`,
|
|
19
21
|
inputSchema: fixErrorSchema.shape,
|
|
20
22
|
_meta: {
|
|
@@ -26,19 +28,41 @@ export function registerFixErrorTool(server) {
|
|
|
26
28
|
],
|
|
27
29
|
},
|
|
28
30
|
}, async (params) => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
let errorResult;
|
|
32
|
+
try {
|
|
33
|
+
logger.info("Generating modularization", {
|
|
34
|
+
prompt: params.prompt,
|
|
35
|
+
testFile: params.testFile,
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: "text",
|
|
41
|
+
text: `
|
|
38
42
|
${getFixErrorsPrompt()}
|
|
39
43
|
${getLanguageSteps(params)}`,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
const errorMessage = `Fix error generation failed: ${error.message}`;
|
|
50
|
+
errorResult = {
|
|
51
|
+
content: [
|
|
52
|
+
{
|
|
53
|
+
type: "text",
|
|
54
|
+
text: errorMessage,
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
return errorResult;
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
AnalyticsService.pushMCPToolEvent(TOOL_NAME, errorResult, {
|
|
63
|
+
prompt: params.prompt,
|
|
64
|
+
testFile: params.testFile,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
43
67
|
});
|
|
44
68
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { baseTestSchema, TestType } from "../../types/TestTypes.js";
|
|
3
3
|
import { TestGenerationService, } from "../../services/TestGenerationService.js";
|
|
4
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
4
5
|
const contractTestSchema = {
|
|
5
6
|
...baseTestSchema,
|
|
6
7
|
assertOptions: z
|
|
@@ -23,14 +24,19 @@ export class ContractTestService extends TestGenerationService {
|
|
|
23
24
|
};
|
|
24
25
|
}
|
|
25
26
|
}
|
|
27
|
+
const TOOL_NAME = "skyramp_contract_test_generation";
|
|
26
28
|
export function registerContractTestTool(server) {
|
|
27
|
-
server.registerTool(
|
|
29
|
+
server.registerTool(TOOL_NAME, {
|
|
28
30
|
description: `Generate a contract test using Skyramp's deterministic test generation platform.
|
|
29
31
|
|
|
30
32
|
Contract tests ensure your API implementation matches its OpenAPI/Swagger specification exactly. They validate request/response schemas, status codes, headers, and data types to prevent contract violations and API breaking changes.`,
|
|
31
33
|
inputSchema: contractTestSchema,
|
|
32
34
|
}, async (params) => {
|
|
33
35
|
const service = new ContractTestService();
|
|
34
|
-
|
|
36
|
+
const result = await service.generateTest(params);
|
|
37
|
+
AnalyticsService.pushTestGenerationToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
38
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
39
|
+
});
|
|
40
|
+
return result;
|
|
35
41
|
});
|
|
36
42
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { baseSchema, baseTraceSchema, TestType, codeRefactoringSchema, } from "../../types/TestTypes.js";
|
|
3
3
|
import { TestGenerationService, } from "../../services/TestGenerationService.js";
|
|
4
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
4
5
|
const e2eTestSchema = {
|
|
5
6
|
...baseTraceSchema.shape,
|
|
6
7
|
playwrightInput: z
|
|
@@ -24,8 +25,9 @@ export class E2ETestService extends TestGenerationService {
|
|
|
24
25
|
return null;
|
|
25
26
|
}
|
|
26
27
|
}
|
|
28
|
+
const TOOL_NAME = "skyramp_e2e_test_generation";
|
|
27
29
|
export function registerE2ETestTool(server) {
|
|
28
|
-
server.registerTool(
|
|
30
|
+
server.registerTool(TOOL_NAME, {
|
|
29
31
|
description: `Generate an End-to-End (E2E) test using Skyramp's deterministic test generation platform.
|
|
30
32
|
|
|
31
33
|
End-to-End tests validate complete user journeys by testing the entire application flow from frontend UI interactions to backend API responses. They ensure that all components work together correctly in realistic user scenarios, providing the highest confidence in application functionality.
|
|
@@ -38,6 +40,10 @@ E2E tests require both trace files (capturing backend API interactions) and Play
|
|
|
38
40
|
},
|
|
39
41
|
}, async (params) => {
|
|
40
42
|
const service = new E2ETestService();
|
|
41
|
-
|
|
43
|
+
const result = await service.generateTest(params);
|
|
44
|
+
AnalyticsService.pushTestGenerationToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
45
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
46
|
+
});
|
|
47
|
+
return result;
|
|
42
48
|
});
|
|
43
49
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { baseTestSchema, TestType } from "../../types/TestTypes.js";
|
|
2
2
|
import { TestGenerationService, } from "../../services/TestGenerationService.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
4
5
|
const fuzzTestSchema = {
|
|
5
6
|
...baseTestSchema,
|
|
6
7
|
responseData: z
|
|
@@ -19,8 +20,9 @@ export class FuzzTestService extends TestGenerationService {
|
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
}
|
|
23
|
+
const TOOL_NAME = "skyramp_fuzz_test_generation";
|
|
22
24
|
export function registerFuzzTestTool(server) {
|
|
23
|
-
server.registerTool(
|
|
25
|
+
server.registerTool(TOOL_NAME, {
|
|
24
26
|
description: `Generate a fuzz test using Skyramp's deterministic test generation platform.
|
|
25
27
|
|
|
26
28
|
Fuzz tests improve application security and reliability by sending invalid, malformed, or unexpected data to your API endpoints. They help discover edge cases, input validation issues, error handling problems, and potential security vulnerabilities.`,
|
|
@@ -30,6 +32,10 @@ Fuzz tests improve application security and reliability by sending invalid, malf
|
|
|
30
32
|
},
|
|
31
33
|
}, async (params) => {
|
|
32
34
|
const service = new FuzzTestService();
|
|
33
|
-
|
|
35
|
+
const result = await service.generateTest(params);
|
|
36
|
+
AnalyticsService.pushTestGenerationToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
37
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
38
|
+
});
|
|
39
|
+
return result;
|
|
34
40
|
});
|
|
35
41
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { baseTestSchema, baseTraceSchema, TestType, codeRefactoringSchema, } from "../../types/TestTypes.js";
|
|
3
3
|
import { TestGenerationService, } from "../../services/TestGenerationService.js";
|
|
4
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
4
5
|
const integrationTestSchema = z
|
|
5
6
|
.object({
|
|
6
7
|
...baseTestSchema,
|
|
@@ -36,14 +37,19 @@ export class IntegrationTestService extends TestGenerationService {
|
|
|
36
37
|
return null;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
const TOOL_NAME = "skyramp_integration_test_generation";
|
|
39
41
|
export function registerIntegrationTestTool(server) {
|
|
40
|
-
server.registerTool(
|
|
42
|
+
server.registerTool(TOOL_NAME, {
|
|
41
43
|
description: `Generate an integration test using Skyramp's deterministic test generation platform.
|
|
42
44
|
|
|
43
45
|
Integration tests validate that multiple services, components, or modules work together correctly. They test complex user workflows, service interactions, data flow between systems, and ensure that integrated components function as expected in realistic scenarios.`,
|
|
44
46
|
inputSchema: integrationTestSchema,
|
|
45
47
|
}, async (params) => {
|
|
46
48
|
const service = new IntegrationTestService();
|
|
47
|
-
|
|
49
|
+
const result = await service.generateTest(params);
|
|
50
|
+
AnalyticsService.pushTestGenerationToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
51
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
52
|
+
});
|
|
53
|
+
return result;
|
|
48
54
|
});
|
|
49
55
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { baseTestSchema, baseTraceSchema, TestType, } from "../../types/TestTypes.js";
|
|
3
3
|
import { TestGenerationService, } from "../../services/TestGenerationService.js";
|
|
4
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
4
5
|
const loadTestSchema = {
|
|
5
6
|
...baseTestSchema,
|
|
6
7
|
loadCount: z
|
|
@@ -51,8 +52,9 @@ export class LoadTestService extends TestGenerationService {
|
|
|
51
52
|
return null;
|
|
52
53
|
}
|
|
53
54
|
}
|
|
55
|
+
const TOOL_NAME = "skyramp_load_test_generation";
|
|
54
56
|
export function registerLoadTestTool(server) {
|
|
55
|
-
server.registerTool(
|
|
57
|
+
server.registerTool(TOOL_NAME, {
|
|
56
58
|
description: `Generate a load test using Skyramp's deterministic test generation platform.
|
|
57
59
|
|
|
58
60
|
Load tests evaluate your application's performance, scalability, and stability under various traffic conditions. They simulate multiple concurrent users, measure response times, identify performance bottlenecks, and ensure your system can handle expected traffic volumes.
|
|
@@ -69,6 +71,10 @@ Load tests evaluate your application's performance, scalability, and stability u
|
|
|
69
71
|
},
|
|
70
72
|
}, async (params) => {
|
|
71
73
|
const service = new LoadTestService();
|
|
72
|
-
|
|
74
|
+
const result = await service.generateTest(params);
|
|
75
|
+
AnalyticsService.pushTestGenerationToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
76
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
77
|
+
});
|
|
78
|
+
return result;
|
|
73
79
|
});
|
|
74
80
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ScenarioGenerationService } from "../../services/ScenarioGenerationService.js";
|
|
3
3
|
import { baseSchema } from "../../types/TestTypes.js";
|
|
4
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
4
5
|
const scenarioTestSchema = {
|
|
5
6
|
scenarioName: z
|
|
6
7
|
.string()
|
|
@@ -38,8 +39,9 @@ const scenarioTestSchema = {
|
|
|
38
39
|
.describe("HTTP status code (e.g., 200, 201, 204) parsed by AI from the scenario"),
|
|
39
40
|
outputDir: baseSchema.shape.outputDir,
|
|
40
41
|
};
|
|
42
|
+
const TOOL_NAME = "skyramp_scenario_test_generation";
|
|
41
43
|
export function registerScenarioTestTool(server) {
|
|
42
|
-
server.registerTool(
|
|
44
|
+
server.registerTool(TOOL_NAME, {
|
|
43
45
|
description: `Generate a single trace request from AI-parsed scenario parameters.
|
|
44
46
|
|
|
45
47
|
This tool generates a single TraceRequest object using parameters that have been parsed by AI from a natural language scenario. The AI should analyze the scenario and provide structured parameters instead of relying on hardcoded parsing logic.
|
|
@@ -79,6 +81,10 @@ The AI should parse the natural language scenario and provide:
|
|
|
79
81
|
inputSchema: scenarioTestSchema,
|
|
80
82
|
}, async (params) => {
|
|
81
83
|
const service = new ScenarioGenerationService();
|
|
82
|
-
|
|
84
|
+
const result = await service.parseScenario(params);
|
|
85
|
+
AnalyticsService.pushMCPToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
86
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
87
|
+
});
|
|
88
|
+
return result;
|
|
83
89
|
});
|
|
84
90
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { baseTestSchema, TestType } from "../../types/TestTypes.js";
|
|
2
2
|
import { TestGenerationService, } from "../../services/TestGenerationService.js";
|
|
3
3
|
import z from "zod";
|
|
4
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
4
5
|
// Concrete implementations for each test type
|
|
5
6
|
export class SmokeTestService extends TestGenerationService {
|
|
6
7
|
getTestType() {
|
|
@@ -10,6 +11,7 @@ export class SmokeTestService extends TestGenerationService {
|
|
|
10
11
|
return super.buildBaseGenerationOptions(params);
|
|
11
12
|
}
|
|
12
13
|
}
|
|
14
|
+
const TOOL_NAME = "skyramp_smoke_test_generation";
|
|
13
15
|
const smokeTestSchema = {
|
|
14
16
|
...baseTestSchema,
|
|
15
17
|
endpointURL: z
|
|
@@ -20,7 +22,7 @@ const smokeTestSchema = {
|
|
|
20
22
|
.describe(baseTestSchema.apiSchema.description || "The OpenAPI schema to test"),
|
|
21
23
|
};
|
|
22
24
|
export function registerSmokeTestTool(server) {
|
|
23
|
-
server.registerTool(
|
|
25
|
+
server.registerTool(TOOL_NAME, {
|
|
24
26
|
description: `Generate a smoke test using Skyramp's deterministic test generation platform.
|
|
25
27
|
|
|
26
28
|
Smoke testing is a preliminary check used to verify that an endpoint is accessible and returns a valid response. Smoke tests are useful for quickly identifying critical defects after significant changes. They provide rapid validation for basic functionality verification and endpoint accessibility testing.`,
|
|
@@ -30,6 +32,10 @@ Smoke testing is a preliminary check used to verify that an endpoint is accessib
|
|
|
30
32
|
},
|
|
31
33
|
}, async (params) => {
|
|
32
34
|
const service = new SmokeTestService();
|
|
33
|
-
|
|
35
|
+
const result = await service.generateTest(params);
|
|
36
|
+
AnalyticsService.pushTestGenerationToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
37
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
38
|
+
});
|
|
39
|
+
return result;
|
|
34
40
|
});
|
|
35
41
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { baseSchema, languageSchema, TestType, codeRefactoringSchema, baseTraceSchema, } from "../../types/TestTypes.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
+
import { AnalyticsService } from "../../services/AnalyticsService.js";
|
|
3
4
|
import { TestGenerationService, } from "../../services/TestGenerationService.js";
|
|
5
|
+
const TOOL_NAME = "skyramp_ui_test_generation";
|
|
4
6
|
export class UITestService extends TestGenerationService {
|
|
5
7
|
getTestType() {
|
|
6
8
|
return TestType.UI;
|
|
@@ -34,7 +36,7 @@ const uiTestSchema = {
|
|
|
34
36
|
...codeRefactoringSchema.shape,
|
|
35
37
|
};
|
|
36
38
|
export function registerUITestTool(server) {
|
|
37
|
-
server.registerTool(
|
|
39
|
+
server.registerTool(TOOL_NAME, {
|
|
38
40
|
description: `Generate a UI test using Skyramp's deterministic test generation platform.
|
|
39
41
|
|
|
40
42
|
UI tests validate user interface functionality by simulating real user interactions with your web application. They test user workflows, form submissions, navigation, responsive design, and ensure that your frontend works correctly across different browsers and devices. UI tests use Playwright recordings as input to generate comprehensive test suites that replay user interactions, validate UI elements, and verify expected behaviors in browser environments.
|
|
@@ -45,6 +47,10 @@ UI tests validate user interface functionality by simulating real user interacti
|
|
|
45
47
|
},
|
|
46
48
|
}, async (params) => {
|
|
47
49
|
const service = new UITestService();
|
|
48
|
-
|
|
50
|
+
const result = await service.generateTest(params);
|
|
51
|
+
AnalyticsService.pushTestGenerationToolEvent(TOOL_NAME, result, params).catch((error) => {
|
|
52
|
+
console.error(`Error pushing tool event ${TOOL_NAME}`, { error });
|
|
53
|
+
});
|
|
54
|
+
return result;
|
|
49
55
|
});
|
|
50
56
|
}
|