@skyramp/mcp 0.3.2-rc.pom-3 → 0.3.2
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/commands/commandLibrary.d.ts +1 -0
- package/build/commands/commandLibrary.js +19 -13
- package/build/commands/localDevTestChangesCommand.d.ts +15 -0
- package/build/commands/localDevTestChangesCommand.js +201 -0
- package/build/index.js +80 -6
- package/build/prompts/code-reuse.js +3 -0
- package/build/prompts/enhance-assertions/sharedAssertionRules.d.ts +1 -0
- package/build/prompts/enhance-assertions/sharedAssertionRules.js +17 -0
- package/build/prompts/initialize-workspace/initializeWorkspacePrompt.js +11 -9
- package/build/prompts/local-dev/local-dev-plan.d.ts +35 -0
- package/build/prompts/local-dev/local-dev-plan.js +429 -0
- package/build/prompts/local-dev/local-dev-prompts.d.ts +4 -0
- package/build/prompts/local-dev/local-dev-prompts.js +190 -0
- package/build/prompts/pom-aware-code-reuse.js +12 -0
- package/build/prompts/prompt-utils.d.ts +8 -0
- package/build/prompts/prompt-utils.js +33 -0
- package/build/prompts/sut-setup/modes/adaptWorkflowPrompt.js +37 -14
- package/build/prompts/sut-setup/shared.js +16 -12
- package/build/prompts/test-recommendation/analysisOutputPrompt.js +21 -29
- package/build/prompts/test-recommendation/scopeAssessment.d.ts +24 -7
- package/build/prompts/test-recommendation/scopeAssessment.js +111 -12
- package/build/prompts/test-recommendation/test-recommendation-prompt.js +41 -4
- package/build/prompts/testbot/testbot-prompts.d.ts +0 -5
- package/build/prompts/testbot/testbot-prompts.js +32 -52
- package/build/recommendation/planRanker.d.ts +15 -2
- package/build/recommendation/planRanker.js +76 -5
- package/build/resources/testbotResource.js +2 -1
- package/build/services/AnalyticsService.d.ts +1 -1
- package/build/services/TestExecutionService.d.ts +2 -1
- package/build/services/TestExecutionService.js +8 -3
- package/build/services/TestGenerationService.d.ts +2 -2
- package/build/services/TestGenerationService.js +39 -21
- package/build/services/containerEnv.js +3 -1
- package/build/tool-phases.js +6 -0
- package/build/tools/code-refactor/codeReuseTool.js +43 -4
- package/build/tools/code-refactor/enhanceAssertionsTool.js +68 -18
- package/build/tools/code-refactor/reuse-outcome.d.ts +109 -0
- package/build/tools/code-refactor/reuse-outcome.js +158 -0
- package/build/tools/code-refactor/reuse-state.d.ts +45 -0
- package/build/tools/code-refactor/reuse-state.js +140 -0
- package/build/tools/enrichTestWithMocksTool.d.ts +28 -0
- package/build/tools/enrichTestWithMocksTool.js +726 -0
- package/build/tools/executeSkyrampTestTool.d.ts +11 -0
- package/build/tools/executeSkyrampTestTool.js +62 -21
- package/build/tools/generate-tests/batchMockGenerationTool.d.ts +106 -0
- package/build/tools/generate-tests/batchMockGenerationTool.js +545 -0
- package/build/tools/generate-tests/generateBatchScenarioRestTool.js +25 -23
- package/build/tools/generate-tests/generateContractRestTool.js +2 -2
- package/build/tools/generate-tests/generateE2ERestTool.d.ts +1 -1
- package/build/tools/generate-tests/generateE2ERestTool.js +1 -1
- package/build/tools/generate-tests/generateLoadRestTool.d.ts +1 -1
- package/build/tools/generate-tests/generateLoadRestTool.js +1 -1
- package/build/tools/generate-tests/generateMockRestTool.d.ts +179 -6
- package/build/tools/generate-tests/generateMockRestTool.js +391 -22
- package/build/tools/generate-tests/loadTestSchema.d.ts +1 -1
- package/build/tools/generate-tests/planGuard.js +2 -22
- package/build/tools/generateEnrichedIntegrationTestTool.d.ts +25 -0
- package/build/tools/generateEnrichedIntegrationTestTool.js +235 -0
- package/build/tools/localDevWorkerComposeTool.d.ts +24 -0
- package/build/tools/localDevWorkerComposeTool.js +264 -0
- package/build/tools/one-click/oneClickTool.d.ts +13 -0
- package/build/tools/one-click/oneClickTool.js +195 -24
- package/build/tools/preflightMockCheckTool.d.ts +2 -0
- package/build/tools/preflightMockCheckTool.js +96 -0
- package/build/tools/queryProxyMocksTool.d.ts +70 -0
- package/build/tools/queryProxyMocksTool.js +522 -0
- package/build/tools/runExistingTestsTool.d.ts +31 -0
- package/build/tools/runExistingTestsTool.js +214 -13
- package/build/tools/submitReportTool.js +38 -3
- package/build/tools/test-management/analyzeChangesTool.d.ts +2 -1
- package/build/tools/test-management/analyzeChangesTool.js +63 -40
- package/build/tools/test-management/registerTestPlanTool.js +55 -7
- package/build/tools/trace/startTraceCollectionTool.js +3 -3
- package/build/types/FrontendIntegration.d.ts +3 -0
- package/build/types/FrontendIntegration.js +3 -0
- package/build/types/OneClickCommands.d.ts +1 -1
- package/build/types/Recommendation.d.ts +20 -0
- package/build/types/Recommendation.js +32 -6
- package/build/types/RepositoryAnalysis.d.ts +131 -14
- package/build/types/RepositoryAnalysis.js +16 -2
- package/build/types/ReuseOutcome.d.ts +63 -0
- package/build/types/ReuseOutcome.js +33 -0
- package/build/types/TestExecution.d.ts +1 -0
- package/build/types/TestTypes.d.ts +25 -7
- package/build/types/TestTypes.js +22 -6
- package/build/types/TestbotReport.d.ts +7 -0
- package/build/types/index.d.ts +2 -0
- package/build/types/index.js +1 -0
- package/build/utils/AnalysisStateManager.d.ts +26 -0
- package/build/utils/AnalysisStateManager.js +31 -1
- package/build/utils/analyze-openapi.js +18 -1
- package/build/utils/branchDiff.d.ts +17 -1
- package/build/utils/branchDiff.js +99 -14
- package/build/utils/featureFlags.d.ts +31 -0
- package/build/utils/featureFlags.js +37 -0
- package/build/utils/frontendIntegration.js +8 -1
- package/build/utils/grpcMockValidation.d.ts +1 -0
- package/build/utils/grpcMockValidation.js +49 -0
- package/build/utils/httpMethodValidation.d.ts +4 -0
- package/build/utils/httpMethodValidation.js +15 -0
- package/build/utils/logger.js +1 -1
- package/build/utils/mockCompatibility.d.ts +49 -0
- package/build/utils/mockCompatibility.js +82 -0
- package/build/utils/pom-scope/pom-files.js +7 -0
- package/build/utils/pom-verify/bindings.js +11 -1
- package/build/utils/pom-verify/re-exports.d.ts +10 -0
- package/build/utils/pom-verify/re-exports.js +61 -0
- package/build/utils/pom-verify/resolve.d.ts +4 -1
- package/build/utils/pom-verify/resolve.js +7 -4
- package/build/utils/pom-verify/verify.d.ts +5 -0
- package/build/utils/pom-verify/verify.js +25 -3
- package/build/utils/progress.js +10 -5
- package/build/utils/proxy-terminal.js +3 -3
- package/build/utils/routeParsers.d.ts +3 -9
- package/build/utils/routeParsers.js +79 -4
- package/build/utils/utils.js +2 -2
- package/build/utils/versions.d.ts +4 -3
- package/build/utils/versions.js +3 -1
- package/build/utils/workspaceAuth.d.ts +46 -0
- package/build/utils/workspaceAuth.js +156 -1
- package/build/workspace/testSuites.d.ts +2 -1
- package/build/workspace/testSuites.js +1 -1
- package/build/workspace/workspace.d.ts +108 -32
- package/build/workspace/workspace.js +32 -4
- package/package.json +5 -2
- package/build/adapters/jestAdapter.test.d.ts +0 -1
- package/build/adapters/jestAdapter.test.js +0 -93
- package/build/adapters/mochaAdapter.test.d.ts +0 -1
- package/build/adapters/mochaAdapter.test.js +0 -63
- package/build/adapters/playwrightAdapter.test.d.ts +0 -1
- package/build/adapters/playwrightAdapter.test.js +0 -169
- package/build/adapters/pytestAdapter.test.d.ts +0 -1
- package/build/adapters/pytestAdapter.test.js +0 -90
- package/build/prompts/code-reuse.test.d.ts +0 -1
- package/build/prompts/code-reuse.test.js +0 -62
- package/build/prompts/pom-aware-code-reuse.test.d.ts +0 -1
- package/build/prompts/pom-aware-code-reuse.test.js +0 -11
- package/build/prompts/test-maintenance/drift-analysis-prompt.test.d.ts +0 -1
- package/build/prompts/test-maintenance/drift-analysis-prompt.test.js +0 -51
- package/build/prompts/test-recommendation/analysisOutputPrompt.test.d.ts +0 -1
- package/build/prompts/test-recommendation/analysisOutputPrompt.test.js +0 -264
- package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.d.ts +0 -1
- package/build/prompts/test-recommendation/mergeEnrichedScenarios.test.js +0 -126
- package/build/prompts/test-recommendation/promptPlan.test.d.ts +0 -1
- package/build/prompts/test-recommendation/promptPlan.test.js +0 -336
- package/build/prompts/test-recommendation/scopeAssessment.test.d.ts +0 -1
- package/build/prompts/test-recommendation/scopeAssessment.test.js +0 -371
- package/build/prompts/test-recommendation/test-recommendation-prompt.test.d.ts +0 -1
- package/build/prompts/test-recommendation/test-recommendation-prompt.test.js +0 -1925
- package/build/prompts/testbot/testbot-prompts.test.d.ts +0 -1
- package/build/prompts/testbot/testbot-prompts.test.js +0 -451
- package/build/recommendation/budgeters/diversityBalancedBudgeter.test.d.ts +0 -1
- package/build/recommendation/budgeters/diversityBalancedBudgeter.test.js +0 -138
- package/build/recommendation/budgeters/fixedNBudgeter.test.d.ts +0 -1
- package/build/recommendation/budgeters/fixedNBudgeter.test.js +0 -66
- package/build/recommendation/discriminators.test.d.ts +0 -1
- package/build/recommendation/discriminators.test.js +0 -324
- package/build/recommendation/diversity.test.d.ts +0 -1
- package/build/recommendation/diversity.test.js +0 -77
- package/build/recommendation/planRanker.test.d.ts +0 -1
- package/build/recommendation/planRanker.test.js +0 -110
- package/build/resources/testbotResource.test.d.ts +0 -1
- package/build/resources/testbotResource.test.js +0 -44
- package/build/services/AnalyticsService.test.d.ts +0 -1
- package/build/services/AnalyticsService.test.js +0 -86
- package/build/services/ScenarioGenerationService.integration.test.d.ts +0 -1
- package/build/services/ScenarioGenerationService.integration.test.js +0 -162
- package/build/services/ScenarioGenerationService.test.d.ts +0 -1
- package/build/services/ScenarioGenerationService.test.js +0 -414
- package/build/services/TestDiscoveryService.test.d.ts +0 -1
- package/build/services/TestDiscoveryService.test.js +0 -983
- package/build/services/TestExecutionService.test.d.ts +0 -1
- package/build/services/TestExecutionService.test.js +0 -1032
- package/build/services/TestGenerationService.test.d.ts +0 -1
- package/build/services/TestGenerationService.test.js +0 -578
- package/build/tool-phase-coverage.test.d.ts +0 -1
- package/build/tool-phase-coverage.test.js +0 -49
- package/build/tools/code-refactor/codeReuseTool.test.d.ts +0 -1
- package/build/tools/code-refactor/codeReuseTool.test.js +0 -572
- package/build/tools/generate-tests/generateBatchScenarioRestTool.test.d.ts +0 -1
- package/build/tools/generate-tests/generateBatchScenarioRestTool.test.js +0 -433
- package/build/tools/generate-tests/generateContractRestTool.test.d.ts +0 -1
- package/build/tools/generate-tests/generateContractRestTool.test.js +0 -142
- package/build/tools/generate-tests/generateIntegrationRestTool.test.d.ts +0 -1
- package/build/tools/generate-tests/generateIntegrationRestTool.test.js +0 -159
- package/build/tools/generate-tests/generateLoadRestTool.test.d.ts +0 -1
- package/build/tools/generate-tests/generateLoadRestTool.test.js +0 -169
- package/build/tools/generate-tests/generateUIRestTool.test.d.ts +0 -1
- package/build/tools/generate-tests/generateUIRestTool.test.js +0 -32
- package/build/tools/generate-tests/planGuard.test.d.ts +0 -1
- package/build/tools/generate-tests/planGuard.test.js +0 -185
- package/build/tools/generate-tests/scenarioLint.test.d.ts +0 -1
- package/build/tools/generate-tests/scenarioLint.test.js +0 -100
- package/build/tools/runExistingTestsTool.test.d.ts +0 -1
- package/build/tools/runExistingTestsTool.test.js +0 -379
- package/build/tools/submitReportTool.test.d.ts +0 -1
- package/build/tools/submitReportTool.test.js +0 -1428
- package/build/tools/test-management/actionsTool.test.d.ts +0 -1
- package/build/tools/test-management/actionsTool.test.js +0 -436
- package/build/tools/test-management/analyzeChangesTool.test.d.ts +0 -1
- package/build/tools/test-management/analyzeChangesTool.test.js +0 -522
- package/build/tools/test-management/analyzeTestHealthTool.test.d.ts +0 -1
- package/build/tools/test-management/analyzeTestHealthTool.test.js +0 -385
- package/build/tools/test-management/registerTestPlanTool.test.d.ts +0 -1
- package/build/tools/test-management/registerTestPlanTool.test.js +0 -296
- package/build/tools/trace/resolveSaveStoragePath.test.d.ts +0 -1
- package/build/tools/trace/resolveSaveStoragePath.test.js +0 -17
- package/build/tools/trace/resolveSessionPaths.test.d.ts +0 -1
- package/build/tools/trace/resolveSessionPaths.test.js +0 -104
- package/build/tools/trace/sessionState.test.d.ts +0 -1
- package/build/tools/trace/sessionState.test.js +0 -17
- package/build/tools/workspace/initializeWorkspaceTool.test.d.ts +0 -1
- package/build/tools/workspace/initializeWorkspaceTool.test.js +0 -139
- package/build/tools/workspace/serviceUpsert.test.d.ts +0 -1
- package/build/tools/workspace/serviceUpsert.test.js +0 -50
- package/build/utils/AnalysisStateManager.test.d.ts +0 -1
- package/build/utils/AnalysisStateManager.test.js +0 -134
- package/build/utils/dartRouteExtractor.test.d.ts +0 -1
- package/build/utils/dartRouteExtractor.test.js +0 -307
- package/build/utils/docker.test.d.ts +0 -1
- package/build/utils/docker.test.js +0 -114
- package/build/utils/featureFlags.test.d.ts +0 -1
- package/build/utils/featureFlags.test.js +0 -81
- package/build/utils/fileWalk.test.d.ts +0 -1
- package/build/utils/fileWalk.test.js +0 -252
- package/build/utils/frontendIntegration.test.d.ts +0 -1
- package/build/utils/frontendIntegration.test.js +0 -229
- package/build/utils/frontendSelectors.test.d.ts +0 -1
- package/build/utils/frontendSelectors.test.js +0 -118
- package/build/utils/gitStaging.test.d.ts +0 -1
- package/build/utils/gitStaging.test.js +0 -111
- package/build/utils/httpDefaults.test.d.ts +0 -1
- package/build/utils/httpDefaults.test.js +0 -21
- package/build/utils/importerHop.test.d.ts +0 -1
- package/build/utils/importerHop.test.js +0 -469
- package/build/utils/pathAffinityClassification.test.d.ts +0 -1
- package/build/utils/pathAffinityClassification.test.js +0 -208
- package/build/utils/planMatchKeys.test.d.ts +0 -1
- package/build/utils/planMatchKeys.test.js +0 -123
- package/build/utils/pom-scope/index.test.d.ts +0 -1
- package/build/utils/pom-scope/index.test.js +0 -278
- package/build/utils/pom-scope/pom-files.test.d.ts +0 -1
- package/build/utils/pom-scope/pom-files.test.js +0 -29
- package/build/utils/pom-scope/scoring.test.d.ts +0 -1
- package/build/utils/pom-scope/scoring.test.js +0 -39
- package/build/utils/pom-scope/selector-extractor.test.d.ts +0 -1
- package/build/utils/pom-scope/selector-extractor.test.js +0 -67
- package/build/utils/pom-verify/bindings.test.d.ts +0 -1
- package/build/utils/pom-verify/bindings.test.js +0 -164
- package/build/utils/pom-verify/calls.test.d.ts +0 -1
- package/build/utils/pom-verify/calls.test.js +0 -61
- package/build/utils/pom-verify/resolve.test.d.ts +0 -1
- package/build/utils/pom-verify/resolve.test.js +0 -114
- package/build/utils/pom-verify/verify.test.d.ts +0 -1
- package/build/utils/pom-verify/verify.test.js +0 -374
- package/build/utils/pr-comment-parser.test.d.ts +0 -1
- package/build/utils/pr-comment-parser.test.js +0 -428
- package/build/utils/progress.test.d.ts +0 -1
- package/build/utils/progress.test.js +0 -37
- package/build/utils/projectMetadata.test.d.ts +0 -1
- package/build/utils/projectMetadata.test.js +0 -172
- package/build/utils/pythonMountPrefixes.test.d.ts +0 -1
- package/build/utils/pythonMountPrefixes.test.js +0 -113
- package/build/utils/repoScanner.test.d.ts +0 -1
- package/build/utils/repoScanner.test.js +0 -190
- package/build/utils/reportVerification.test.d.ts +0 -1
- package/build/utils/reportVerification.test.js +0 -185
- package/build/utils/routeParsers.test.d.ts +0 -1
- package/build/utils/routeParsers.test.js +0 -1011
- package/build/utils/scenarioDrafting.test.d.ts +0 -1
- package/build/utils/scenarioDrafting.test.js +0 -876
- package/build/utils/sourceRouteExtractor.test.d.ts +0 -1
- package/build/utils/sourceRouteExtractor.test.js +0 -738
- package/build/utils/telemetry.test.d.ts +0 -1
- package/build/utils/telemetry.test.js +0 -70
- package/build/utils/trace-parser.test.d.ts +0 -6
- package/build/utils/trace-parser.test.js +0 -140
- package/build/utils/uiPageEnumerator.test.d.ts +0 -1
- package/build/utils/uiPageEnumerator.test.js +0 -824
- package/build/utils/utils.test.d.ts +0 -1
- package/build/utils/utils.test.js +0 -103
- package/build/utils/walkerCharacterization.test.d.ts +0 -1
- package/build/utils/walkerCharacterization.test.js +0 -233
- package/build/utils/workspaceAuth.test.d.ts +0 -1
- package/build/utils/workspaceAuth.test.js +0 -260
- package/build/workspace/testSuites.test.d.ts +0 -1
- package/build/workspace/testSuites.test.js +0 -23
- package/build/workspace/workspace.test.d.ts +0 -1
- package/build/workspace/workspace.test.js +0 -264
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
import * as fs from "fs";
|
|
2
|
-
import * as os from "os";
|
|
3
|
-
import * as path from "path";
|
|
4
|
-
import { execFileSync } from "child_process";
|
|
5
|
-
import yaml from "js-yaml";
|
|
6
|
-
import { serviceSchema, SUPPORTED_FRAMEWORKS, WorkspaceConfigManager, validateWorkspaceConfig, workspaceConfigSchema, createDefaultConfig, WORKSPACE_DIR, WORKSPACE_FILENAME, } from "./workspace.js";
|
|
7
|
-
describe("workspace module (ported from @skyramp/skyramp, SKYR-3794)", () => {
|
|
8
|
-
describe("serviceSchema", () => {
|
|
9
|
-
it("accepts an optional repository and rejects a non-string repository", () => {
|
|
10
|
-
expect(serviceSchema.safeParse({ serviceName: "api", repository: "org/api" })
|
|
11
|
-
.success).toBe(true);
|
|
12
|
-
expect(serviceSchema.safeParse({ serviceName: "api" }).success).toBe(true);
|
|
13
|
-
expect(serviceSchema.safeParse({ serviceName: "api", repository: 123 })
|
|
14
|
-
.success).toBe(false);
|
|
15
|
-
});
|
|
16
|
-
it("rejects unknown fields (strict)", () => {
|
|
17
|
-
expect(serviceSchema.safeParse({ serviceName: "api", bogus: true }).success).toBe(false);
|
|
18
|
-
});
|
|
19
|
-
it("accepts api.skipTLSVerify for self-signed-TLS SUTs and rejects non-boolean (SKYR-3961)", () => {
|
|
20
|
-
expect(serviceSchema.safeParse({
|
|
21
|
-
serviceName: "api",
|
|
22
|
-
api: { baseUrl: "https://127.0.0.1:45643", skipTLSVerify: true },
|
|
23
|
-
}).success).toBe(true);
|
|
24
|
-
expect(serviceSchema.safeParse({
|
|
25
|
-
serviceName: "api",
|
|
26
|
-
api: { baseUrl: "https://127.0.0.1:45643", skipTLSVerify: "yes" },
|
|
27
|
-
}).success).toBe(false);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
describe("validateWorkspaceConfig / createDefaultConfig", () => {
|
|
31
|
-
it("a default config validates", () => {
|
|
32
|
-
expect(validateWorkspaceConfig(createDefaultConfig()).success).toBe(true);
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
describe("constants", () => {
|
|
36
|
-
it("are unchanged", () => {
|
|
37
|
-
expect(WORKSPACE_DIR).toBe(".skyramp");
|
|
38
|
-
expect(WORKSPACE_FILENAME).toBe("workspace.yml");
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
describe("WorkspaceConfigManager.addService — composite (repo, serviceName) upsert", () => {
|
|
42
|
-
let repoDir;
|
|
43
|
-
beforeEach(() => {
|
|
44
|
-
repoDir = fs.mkdtempSync(path.join(os.tmpdir(), "ws-port-"));
|
|
45
|
-
// initialize() auto-detects repo info from git → the dir must be a git repo.
|
|
46
|
-
execFileSync("git", ["init", "-q"], { cwd: repoDir });
|
|
47
|
-
execFileSync("git", ["remote", "add", "origin", "https://github.com/letsramp/primary.git"], { cwd: repoDir });
|
|
48
|
-
});
|
|
49
|
-
afterEach(() => {
|
|
50
|
-
fs.rmSync(repoDir, { recursive: true, force: true });
|
|
51
|
-
});
|
|
52
|
-
const read = () => yaml.load(fs.readFileSync(path.join(repoDir, WORKSPACE_DIR, WORKSPACE_FILENAME), "utf8"), { schema: yaml.JSON_SCHEMA });
|
|
53
|
-
it("keeps a same-named service from a different repo distinct, and upserts in place", async () => {
|
|
54
|
-
const mgr = new WorkspaceConfigManager(repoDir);
|
|
55
|
-
await mgr.initialize();
|
|
56
|
-
await mgr.addService({
|
|
57
|
-
serviceName: "svc",
|
|
58
|
-
testDirectory: "tests/primary",
|
|
59
|
-
});
|
|
60
|
-
await mgr.addService({
|
|
61
|
-
serviceName: "svc",
|
|
62
|
-
repository: "letsramp/api-insight",
|
|
63
|
-
testDirectory: "tests/py",
|
|
64
|
-
});
|
|
65
|
-
await mgr.addService({
|
|
66
|
-
serviceName: "svc",
|
|
67
|
-
testDirectory: "tests/primary-v2",
|
|
68
|
-
}); // upsert primary
|
|
69
|
-
const cfg = read();
|
|
70
|
-
expect(cfg.services).toHaveLength(2);
|
|
71
|
-
expect(cfg.services.find((s) => !s.repository).testDirectory).toBe("tests/primary-v2");
|
|
72
|
-
expect(cfg.services.find((s) => s.repository === "letsramp/api-insight")
|
|
73
|
-
.testDirectory).toBe("tests/py");
|
|
74
|
-
// repoName auto-detected from the git remote.
|
|
75
|
-
expect(cfg.workspace.repoName).toBe("letsramp/primary");
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
describe("mcpVersion: no longer written, still accepted (SKYR-3818)", () => {
|
|
79
|
-
let repoDir;
|
|
80
|
-
beforeEach(() => {
|
|
81
|
-
repoDir = fs.mkdtempSync(path.join(os.tmpdir(), "ws-mcpver-"));
|
|
82
|
-
execFileSync("git", ["init", "-q"], { cwd: repoDir });
|
|
83
|
-
execFileSync("git", ["remote", "add", "origin", "https://github.com/letsramp/primary.git"], { cwd: repoDir });
|
|
84
|
-
});
|
|
85
|
-
afterEach(() => {
|
|
86
|
-
fs.rmSync(repoDir, { recursive: true, force: true });
|
|
87
|
-
});
|
|
88
|
-
// Writes a workspace.yml that carries metadata.mcpVersion, emulating a workspace
|
|
89
|
-
// initialized by an older MCP version (which still stamped the field).
|
|
90
|
-
const writeLegacyConfig = () => {
|
|
91
|
-
const dir = path.join(repoDir, WORKSPACE_DIR);
|
|
92
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
93
|
-
const now = new Date().toISOString();
|
|
94
|
-
const legacy = {
|
|
95
|
-
workspace: { repoName: "letsramp/primary" },
|
|
96
|
-
metadata: {
|
|
97
|
-
schemaVersion: "v1",
|
|
98
|
-
mcpVersion: "0.0.64",
|
|
99
|
-
executorVersion: "1.2.3",
|
|
100
|
-
createdAt: now,
|
|
101
|
-
updatedAt: now,
|
|
102
|
-
},
|
|
103
|
-
services: [],
|
|
104
|
-
};
|
|
105
|
-
fs.writeFileSync(path.join(dir, WORKSPACE_FILENAME), yaml.dump(legacy), "utf8");
|
|
106
|
-
};
|
|
107
|
-
const readRaw = () => yaml.load(fs.readFileSync(path.join(repoDir, WORKSPACE_DIR, WORKSPACE_FILENAME), "utf8"), { schema: yaml.JSON_SCHEMA });
|
|
108
|
-
it("does not write mcpVersion into a freshly initialized workspace", async () => {
|
|
109
|
-
const mgr = new WorkspaceConfigManager(repoDir);
|
|
110
|
-
await mgr.initialize();
|
|
111
|
-
const onDisk = readRaw();
|
|
112
|
-
expect(onDisk.metadata.mcpVersion).toBeUndefined();
|
|
113
|
-
});
|
|
114
|
-
it("preserves mcpVersion from a pre-existing workspace.yml on read (testbot fallback)", async () => {
|
|
115
|
-
writeLegacyConfig();
|
|
116
|
-
const mgr = new WorkspaceConfigManager(repoDir);
|
|
117
|
-
const cfg = await mgr.read();
|
|
118
|
-
// Kept as an optional recognized key — not stripped — so testbot's
|
|
119
|
-
// config.ts MCP-version fallback keeps working for existing workspaces.
|
|
120
|
-
expect(cfg.metadata?.mcpVersion).toBe("0.0.64");
|
|
121
|
-
expect(cfg.metadata?.executorVersion).toBe("1.2.3");
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
describe("framework enum reconciliation", () => {
|
|
126
|
-
it("accepts every canonical framework, including the newly added ones", () => {
|
|
127
|
-
for (const fw of SUPPORTED_FRAMEWORKS) {
|
|
128
|
-
const r = serviceSchema.safeParse({ serviceName: "s", framework: fw });
|
|
129
|
-
expect(r.success).toBe(true);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
it("includes vitest, jest, mocha, go, rspec, jasmine", () => {
|
|
133
|
-
for (const fw of ["vitest", "jest", "mocha", "go", "rspec", "jasmine"]) {
|
|
134
|
-
expect(SUPPORTED_FRAMEWORKS).toContain(fw);
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
it("rejects an unknown framework", () => {
|
|
138
|
-
const r = serviceSchema.safeParse({ serviceName: "s", framework: "nope" });
|
|
139
|
-
expect(r.success).toBe(false);
|
|
140
|
-
});
|
|
141
|
-
});
|
|
142
|
-
describe("runtimeDetails.test* fields", () => {
|
|
143
|
-
it("validates a full DELEGATE-style test runtime block", () => {
|
|
144
|
-
const r = serviceSchema.safeParse({
|
|
145
|
-
serviceName: "ghost",
|
|
146
|
-
framework: "playwright",
|
|
147
|
-
runtimeDetails: {
|
|
148
|
-
runtime: "local",
|
|
149
|
-
testSuites: [
|
|
150
|
-
{
|
|
151
|
-
testRunCommand: "bash e2e/scripts/run-playwright-host.sh",
|
|
152
|
-
testEnv: { DATABASE_URL: "mysql://…", NODE_ENV: "test" },
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
expect(r.success).toBe(true);
|
|
158
|
-
});
|
|
159
|
-
it("rejects unknown keys under runtimeDetails (strict)", () => {
|
|
160
|
-
const r = serviceSchema.safeParse({
|
|
161
|
-
serviceName: "s",
|
|
162
|
-
runtimeDetails: { runtime: "local", bogusKey: "x" },
|
|
163
|
-
});
|
|
164
|
-
expect(r.success).toBe(false);
|
|
165
|
-
});
|
|
166
|
-
it("rejects testEnvStartCommand/testEnvStopCommand under runtimeDetails (removed — env bring-up now lives in .skyramp/sut/setup.sh)", () => {
|
|
167
|
-
const r = serviceSchema.safeParse({
|
|
168
|
-
serviceName: "s",
|
|
169
|
-
runtimeDetails: {
|
|
170
|
-
runtime: "local",
|
|
171
|
-
testSuites: [{ testRunCommand: "x" }],
|
|
172
|
-
testEnvStartCommand: "up",
|
|
173
|
-
testEnvStopCommand: "down",
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
expect(r.success).toBe(false);
|
|
177
|
-
});
|
|
178
|
-
it("accepts a runtimeDetails.testSuites list", () => {
|
|
179
|
-
const r = validateWorkspaceConfig({
|
|
180
|
-
services: [
|
|
181
|
-
{
|
|
182
|
-
serviceName: "n8n-ui",
|
|
183
|
-
framework: "playwright",
|
|
184
|
-
runtimeDetails: {
|
|
185
|
-
runtime: "local",
|
|
186
|
-
testSuites: [
|
|
187
|
-
{
|
|
188
|
-
framework: "playwright",
|
|
189
|
-
testRunCommand: "npx playwright test",
|
|
190
|
-
},
|
|
191
|
-
],
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
],
|
|
195
|
-
});
|
|
196
|
-
expect(r.success).toBe(true);
|
|
197
|
-
});
|
|
198
|
-
it("rejects unknown keys inside a testSuites entry (strict)", () => {
|
|
199
|
-
const r = validateWorkspaceConfig({
|
|
200
|
-
services: [
|
|
201
|
-
{
|
|
202
|
-
serviceName: "s",
|
|
203
|
-
runtimeDetails: {
|
|
204
|
-
runtime: "local",
|
|
205
|
-
testSuites: [{ testRunCommand: "x", bogus: 1 }],
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
],
|
|
209
|
-
});
|
|
210
|
-
expect(r.success).toBe(false);
|
|
211
|
-
});
|
|
212
|
-
it("rejects envMode inside a strict testSuites entry (descriptive-only field, dropped)", () => {
|
|
213
|
-
const parsed = workspaceConfigSchema.safeParse({
|
|
214
|
-
workspace: { repoName: "x", repoUrl: "y" },
|
|
215
|
-
services: [{
|
|
216
|
-
serviceName: "svc",
|
|
217
|
-
runtimeDetails: {
|
|
218
|
-
runtime: "local",
|
|
219
|
-
testSuites: [{ testRunCommand: "npx playwright test", envMode: "delegate_to_suite" }],
|
|
220
|
-
},
|
|
221
|
-
}],
|
|
222
|
-
});
|
|
223
|
-
expect(parsed.success).toBe(false);
|
|
224
|
-
});
|
|
225
|
-
it("rejects testEnvStartCommand inside a strict testSuites entry", () => {
|
|
226
|
-
const parsed = workspaceConfigSchema.safeParse({
|
|
227
|
-
workspace: { repoName: "x", repoUrl: "y" },
|
|
228
|
-
services: [{
|
|
229
|
-
serviceName: "svc",
|
|
230
|
-
runtimeDetails: {
|
|
231
|
-
runtime: "local",
|
|
232
|
-
testSuites: [{ testRunCommand: "npx playwright test", testEnvStartCommand: "docker compose up" }],
|
|
233
|
-
},
|
|
234
|
-
}],
|
|
235
|
-
});
|
|
236
|
-
expect(parsed.success).toBe(false);
|
|
237
|
-
});
|
|
238
|
-
it("rejects testRuntime inside a strict testSuites entry (descriptive-only field, dropped)", () => {
|
|
239
|
-
const parsed = workspaceConfigSchema.safeParse({
|
|
240
|
-
workspace: { repoName: "x", repoUrl: "y" },
|
|
241
|
-
services: [{
|
|
242
|
-
serviceName: "svc",
|
|
243
|
-
runtimeDetails: {
|
|
244
|
-
runtime: "local",
|
|
245
|
-
testSuites: [{ testRunCommand: "npx playwright test", testRuntime: "host" }],
|
|
246
|
-
},
|
|
247
|
-
}],
|
|
248
|
-
});
|
|
249
|
-
expect(parsed.success).toBe(false);
|
|
250
|
-
});
|
|
251
|
-
it("rejects testInstallCommand inside a strict testSuites entry (vestigial — setup.sh owns install/prebuild)", () => {
|
|
252
|
-
const parsed = workspaceConfigSchema.safeParse({
|
|
253
|
-
workspace: { repoName: "x", repoUrl: "y" },
|
|
254
|
-
services: [{
|
|
255
|
-
serviceName: "svc",
|
|
256
|
-
runtimeDetails: {
|
|
257
|
-
runtime: "local",
|
|
258
|
-
testSuites: [{ testRunCommand: "npx playwright test", testInstallCommand: "pnpm i" }],
|
|
259
|
-
},
|
|
260
|
-
}],
|
|
261
|
-
});
|
|
262
|
-
expect(parsed.success).toBe(false);
|
|
263
|
-
});
|
|
264
|
-
});
|