@ai-dev-tools/csharp-copilot-core 0.0.19
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/ai-dev-tools-csharp-copilot-core-0.0.19.tgz +0 -0
- package/azure-pipelines.yml +52 -0
- package/out/analyze/cecil.d.ts +1 -0
- package/out/analyze/cecil.js +42 -0
- package/out/analyze/cecil.js.map +1 -0
- package/out/analyze/checkCodeSyntax.d.ts +7 -0
- package/out/analyze/checkCodeSyntax.js +67 -0
- package/out/analyze/checkCodeSyntax.js.map +1 -0
- package/out/analyze/generateCodeDependency.d.ts +6 -0
- package/out/analyze/generateCodeDependency.js +122 -0
- package/out/analyze/generateCodeDependency.js.map +1 -0
- package/out/analyze/installAnalyzerTool.d.ts +1 -0
- package/out/analyze/installAnalyzerTool.js +82 -0
- package/out/analyze/installAnalyzerTool.js.map +1 -0
- package/out/atmpCache/deps/EplantRequestCategoryCondition_Conditions_Eplant_Workflows_SharedSegmentsPlugins_SharedSegments_SharedSegments_CSServiceFundamental_code_D.deps +281 -0
- package/out/atmpCache/deps/IdentitySelectAnalyzer_ToListinatorAnalyzers_src_AIUnitTestExample_code_d.deps +1 -0
- package/out/atmpCache/deps/SqmidHelperTests_Utils_HttpRequestParser_Overview_Workflows_SharedSegmentsTests_SharedSegments_SharedSegments_CSServiceFundamental_code_D.deps +1 -0
- package/out/atmpCache/deps/SqmidHelper_Utils_HttpRequestParser_Overview_Workflows_SharedSegmentsPlugins_SharedSegments_SharedSegments_CSServiceFundamental_code_D.deps +1 -0
- package/out/atmpCache/deps/ToListCountAnalyzerTests_ToListinatorTests_test_AIUnitTestExample_code_d.deps +4037 -0
- package/out/atmpCache/deps/ToListCountAnalyzer_ToListinatorAnalyzers_src_AIUnitTestExample_code_d.deps +1 -0
- package/out/atmpCache/deps/ToListCountCodeFixProvider_ToListinatorCodeFixes_src_AIUnitTestExample_code_d.deps +1 -0
- package/out/atmpCache/deps/ToListForEachAnalyzer_ToListinatorAnalyzers_src_AIUnitTestExample_code_d.deps +1 -0
- package/out/atmpCache/dllref/ToListinatorTests_ToListinatorTests_test_AIUnitTestExample_code_d.dllref +202 -0
- package/out/batch/generateCodeTests.d.ts +6 -0
- package/out/batch/generateCodeTests.js +147 -0
- package/out/batch/generateCodeTests.js.map +1 -0
- package/out/batch/getFolderCodeFile.d.ts +1 -0
- package/out/batch/getFolderCodeFile.js +19 -0
- package/out/batch/getFolderCodeFile.js.map +1 -0
- package/out/batch/getProjectCodeFile.d.ts +4 -0
- package/out/batch/getProjectCodeFile.js +87 -0
- package/out/batch/getProjectCodeFile.js.map +1 -0
- package/out/batch/getSolutionCodeFile.d.ts +8 -0
- package/out/batch/getSolutionCodeFile.js +70 -0
- package/out/batch/getSolutionCodeFile.js.map +1 -0
- package/out/benchmark/formatToMarkdown.d.ts +2 -0
- package/out/benchmark/formatToMarkdown.js +101 -0
- package/out/benchmark/formatToMarkdown.js.map +1 -0
- package/out/benchmark/generateBenchmarkReport.d.ts +1 -0
- package/out/benchmark/generateBenchmarkReport.js +82 -0
- package/out/benchmark/generateBenchmarkReport.js.map +1 -0
- package/out/codeCoverage/codeCoverage.d.ts +6 -0
- package/out/codeCoverage/codeCoverage.js +35 -0
- package/out/codeCoverage/codeCoverage.js.map +1 -0
- package/out/codeCoverage/codeCoverageReport.d.ts +6 -0
- package/out/codeCoverage/codeCoverageReport.js +72 -0
- package/out/codeCoverage/codeCoverageReport.js.map +1 -0
- package/out/codeCoverage/extractCodeCoverageInfo.d.ts +2 -0
- package/out/codeCoverage/extractCodeCoverageInfo.js +80 -0
- package/out/codeCoverage/extractCodeCoverageInfo.js.map +1 -0
- package/out/codeCoverage/generateCodeCoverageReport.d.ts +1 -0
- package/out/codeCoverage/generateCodeCoverageReport.js +27 -0
- package/out/codeCoverage/generateCodeCoverageReport.js.map +1 -0
- package/out/codeCoverage/getCodeCoverageSetting.d.ts +1 -0
- package/out/codeCoverage/getCodeCoverageSetting.js +58 -0
- package/out/codeCoverage/getCodeCoverageSetting.js.map +1 -0
- package/out/codeCoverage/reportTool.d.ts +2 -0
- package/out/codeCoverage/reportTool.js +22 -0
- package/out/codeCoverage/reportTool.js.map +1 -0
- package/out/codeCoverage/simplifyCoverageXml.d.ts +2 -0
- package/out/codeCoverage/simplifyCoverageXml.js +116 -0
- package/out/codeCoverage/simplifyCoverageXml.js.map +1 -0
- package/out/codebk/250804prompt/buildAfGuidelines.liquid +15 -0
- package/out/codebk/250804prompt/general/generalBuildAutofixGuidelines.liquid +13 -0
- package/out/codebk/250804prompt/general/generalUtGuidelines.liquid +18 -0
- package/out/codebk/250804prompt/generateUtAutoFix.liquid +19 -0
- package/out/codebk/250804prompt/generateUtGuidelines.liquid +13 -0
- package/out/codebk/250804prompt/generateUtSystem.liquid +5 -0
- package/out/codebk/250804prompt/generateUtUserInput.liquid +27 -0
- package/out/codebk/250804prompt/testAfGuidelines.liquid +6 -0
- package/out/codebk/250804prompt/xap/xapBuildAutofixGuidelines.liquid +13 -0
- package/out/codebk/250804prompt/xap/xapCodeCodeDependency.liquid +0 -0
- package/out/codebk/250804prompt/xap/xapCodeSample.liquid +38 -0
- package/out/codebk/250804prompt/xap/xapUtGuideline-240804.liquid +36 -0
- package/out/codebk/250804prompt/xap/xapUtGuideline.liquid +36 -0
- package/out/codebk/childProcessManager.d.ts +1 -0
- package/out/codebk/childProcessManager.js +50 -0
- package/out/codebk/childProcessManager.js.map +1 -0
- package/out/codebk/msBuidSpawn.d.ts +1 -0
- package/out/codebk/msBuidSpawn.js +58 -0
- package/out/codebk/msBuidSpawn.js.map +1 -0
- package/out/codebk/msBuild.d.ts +1 -0
- package/out/codebk/msBuild.js +123 -0
- package/out/codebk/msBuild.js.map +1 -0
- package/out/codebk/old/generateXapTestAutoFix.liquid +12 -0
- package/out/codebk/old/generateXapTestGuidelines-fm.liquid +68 -0
- package/out/codebk/old/generateXapTestGuidelines.liquid +28 -0
- package/out/codebk/old/xapGuideline-fm.liquid +149 -0
- package/out/codebk/old/xapGuideline.liquid +37 -0
- package/out/codebk/oldExec/checkCodeSyntax.d.ts +1 -0
- package/out/codebk/oldExec/checkCodeSyntax.js +81 -0
- package/out/codebk/oldExec/checkCodeSyntax.js.map +1 -0
- package/out/codebk/oldExec/codeCoverage.d.ts +1 -0
- package/out/codebk/oldExec/codeCoverage.js +54 -0
- package/out/codebk/oldExec/codeCoverage.js.map +1 -0
- package/out/codebk/oldExec/codeCoverageReport.d.ts +1 -0
- package/out/codebk/oldExec/codeCoverageReport.js +64 -0
- package/out/codebk/oldExec/codeCoverageReport.js.map +1 -0
- package/out/codebk/oldExec/containsMethods.d.ts +1 -0
- package/out/codebk/oldExec/containsMethods.js +74 -0
- package/out/codebk/oldExec/containsMethods.js.map +1 -0
- package/out/codebk/oldExec/generateCodeDependency.d.ts +1 -0
- package/out/codebk/oldExec/generateCodeDependency.js +95 -0
- package/out/codebk/oldExec/generateCodeDependency.js.map +1 -0
- package/out/codebk/oldExec/msBuild.d.ts +1 -0
- package/out/codebk/oldExec/msBuild.js +53 -0
- package/out/codebk/oldExec/msBuild.js.map +1 -0
- package/out/codebk/oldExec/vsTest.d.ts +1 -0
- package/out/codebk/oldExec/vsTest.js +71 -0
- package/out/codebk/oldExec/vsTest.js.map +1 -0
- package/out/codebk/prompts/general/generalUnitTestGuidelines-20250702.liquid +56 -0
- package/out/codebk/prompts/generateXapTestGuidelines-20250704.liquid +21 -0
- package/out/codebk/prompts/generateXapTestGuidelines-o.liquid +29 -0
- package/out/codebk/prompts/xap/xapGuideline-o.liquid +45 -0
- package/out/codebk/testbuildkill.d.ts +1 -0
- package/out/codebk/testbuildkill.js +37 -0
- package/out/codebk/testbuildkill.js.map +1 -0
- package/out/command/index.d.ts +2 -0
- package/out/command/index.js +85 -0
- package/out/command/index.js.map +1 -0
- package/out/command/utGenWrapper.d.ts +3 -0
- package/out/command/utGenWrapper.js +40 -0
- package/out/command/utGenWrapper.js.map +1 -0
- package/out/exit/childProcessManager.d.ts +2 -0
- package/out/exit/childProcessManager.js +43 -0
- package/out/exit/childProcessManager.js.map +1 -0
- package/out/exit/setupProcessSignalHandler.d.ts +1 -0
- package/out/exit/setupProcessSignalHandler.js +18 -0
- package/out/exit/setupProcessSignalHandler.js.map +1 -0
- package/out/gen/autoFix.d.ts +4 -0
- package/out/gen/autoFix.js +125 -0
- package/out/gen/autoFix.js.map +1 -0
- package/out/gen/csharpUtGen.d.ts +2 -0
- package/out/gen/csharpUtGen.js +151 -0
- package/out/gen/csharpUtGen.js.map +1 -0
- package/out/gen/ensureValidLLMResponse.d.ts +1 -0
- package/out/gen/ensureValidLLMResponse.js +19 -0
- package/out/gen/ensureValidLLMResponse.js.map +1 -0
- package/out/gen/postGen/extractCodeFromResponse.d.ts +1 -0
- package/out/gen/postGen/extractCodeFromResponse.js +37 -0
- package/out/gen/postGen/extractCodeFromResponse.js.map +1 -0
- package/out/gen/postGen/postGenProcess.d.ts +1 -0
- package/out/gen/postGen/postGenProcess.js +36 -0
- package/out/gen/postGen/postGenProcess.js.map +1 -0
- package/out/gen/postGen/removeComments.d.ts +1 -0
- package/out/gen/postGen/removeComments.js +92 -0
- package/out/gen/postGen/removeComments.js.map +1 -0
- package/out/gen/postGen/removeSingleLines.d.ts +1 -0
- package/out/gen/postGen/removeSingleLines.js +28 -0
- package/out/gen/postGen/removeSingleLines.js.map +1 -0
- package/out/gen/postGen/repairRequiredNameSpaces.d.ts +1 -0
- package/out/gen/postGen/repairRequiredNameSpaces.js +116 -0
- package/out/gen/postGen/repairRequiredNameSpaces.js.map +1 -0
- package/out/gen/postGen/validateTestCode.d.ts +1 -0
- package/out/gen/postGen/validateTestCode.js +14 -0
- package/out/gen/postGen/validateTestCode.js.map +1 -0
- package/out/gen/preGen/excludeFileName.d.ts +1 -0
- package/out/gen/preGen/excludeFileName.js +49 -0
- package/out/gen/preGen/excludeFileName.js.map +1 -0
- package/out/gen/preGen/excludeSpecificTag.d.ts +1 -0
- package/out/gen/preGen/excludeSpecificTag.js +18 -0
- package/out/gen/preGen/excludeSpecificTag.js.map +1 -0
- package/out/gen/preGen/preGenProcess.d.ts +1 -0
- package/out/gen/preGen/preGenProcess.js +22 -0
- package/out/gen/preGen/preGenProcess.js.map +1 -0
- package/out/gen/preGen/validateCode.d.ts +3 -0
- package/out/gen/preGen/validateCode.js +62 -0
- package/out/gen/preGen/validateCode.js.map +1 -0
- package/out/index.d.ts +2 -0
- package/out/index.js +8 -0
- package/out/index.js.map +1 -0
- package/out/llm/model/Gpt4o.d.ts +1 -0
- package/out/llm/model/Gpt4o.js +91 -0
- package/out/llm/model/Gpt4o.js.map +1 -0
- package/out/llm/model/claude4.d.ts +1 -0
- package/out/llm/model/claude4.js +3 -0
- package/out/llm/model/claude4.js.map +1 -0
- package/out/llm/preparePrompt.d.ts +2 -0
- package/out/llm/preparePrompt.js +110 -0
- package/out/llm/preparePrompt.js.map +1 -0
- package/out/llm/prompt/buildAfGuidelines.liquid +15 -0
- package/out/llm/prompt/general/generalBuildAutofixGuidelines.liquid +13 -0
- package/out/llm/prompt/general/generalUtGuidelines.liquid +16 -0
- package/out/llm/prompt/generateUtAutoFix.liquid +19 -0
- package/out/llm/prompt/generateUtDependency.liquid +3 -0
- package/out/llm/prompt/generateUtGuidelines.liquid +29 -0
- package/out/llm/prompt/generateUtSystem.liquid +5 -0
- package/out/llm/prompt/generateUtTemplate.liquid +30 -0
- package/out/llm/prompt/generateUtUserInput.liquid +4 -0
- package/out/llm/prompt/testAfGuidelines.liquid +6 -0
- package/out/llm/prompt/userCustomPrompt.liquid +0 -0
- package/out/llm/prompt/xap/xapBuildAutofixGuidelines.liquid +13 -0
- package/out/llm/prompt/xap/xapCodeCodeDependency.liquid +0 -0
- package/out/llm/prompt/xap/xapCodeSample.liquid +38 -0
- package/out/llm/prompt/xap/xapUtGuideline-240804.liquid +36 -0
- package/out/llm/prompt/xap/xapUtGuideline.liquid +37 -0
- package/out/llm/sendRequestToLLM.d.ts +4 -0
- package/out/llm/sendRequestToLLM.js +12 -0
- package/out/llm/sendRequestToLLM.js.map +1 -0
- package/out/llm/sendRequestToSelfHostLLM.d.ts +4 -0
- package/out/llm/sendRequestToSelfHostLLM.js +41 -0
- package/out/llm/sendRequestToSelfHostLLM.js.map +1 -0
- package/out/metrics/appInsightTelemetry.d.ts +6 -0
- package/out/metrics/appInsightTelemetry.js +77 -0
- package/out/metrics/appInsightTelemetry.js.map +1 -0
- package/out/metrics/machineId.d.ts +11 -0
- package/out/metrics/machineId.js +85 -0
- package/out/metrics/machineId.js.map +1 -0
- package/out/setup/setup.d.ts +1 -0
- package/out/setup/setup.js +10 -0
- package/out/setup/setup.js.map +1 -0
- package/out/setup/setupConsole.d.ts +1 -0
- package/out/setup/setupConsole.js +23 -0
- package/out/setup/setupConsole.js.map +1 -0
- package/out/setup/setupLLMRequest.d.ts +2 -0
- package/out/setup/setupLLMRequest.js +10 -0
- package/out/setup/setupLLMRequest.js.map +1 -0
- package/out/tools/devenvcom.cmd +13 -0
- package/out/tools/devenvexe.cmd +13 -0
- package/out/tools/msbuildexe.cmd +13 -0
- package/out/tools/vstestexe.cmd +13 -0
- package/out/types/benchmark.d.ts +11 -0
- package/out/types/benchmark.js +3 -0
- package/out/types/benchmark.js.map +1 -0
- package/out/types/buildResult.d.ts +8 -0
- package/out/types/buildResult.js +3 -0
- package/out/types/buildResult.js.map +1 -0
- package/out/types/constants.d.ts +3 -0
- package/out/types/constants.js +7 -0
- package/out/types/constants.js.map +1 -0
- package/out/types/genResult.d.ts +10 -0
- package/out/types/genResult.js +3 -0
- package/out/types/genResult.js.map +1 -0
- package/out/types/testResult.d.ts +12 -0
- package/out/types/testResult.js +3 -0
- package/out/types/testResult.js.map +1 -0
- package/out/types/verifyResult.d.ts +8 -0
- package/out/types/verifyResult.js +3 -0
- package/out/types/verifyResult.js.map +1 -0
- package/out/utils/checkTestProject.d.ts +2 -0
- package/out/utils/checkTestProject.js +79 -0
- package/out/utils/checkTestProject.js.map +1 -0
- package/out/utils/checkXapCode.d.ts +2 -0
- package/out/utils/checkXapCode.js +59 -0
- package/out/utils/checkXapCode.js.map +1 -0
- package/out/utils/delay.d.ts +1 -0
- package/out/utils/delay.js +7 -0
- package/out/utils/delay.js.map +1 -0
- package/out/utils/detectTestFramework.d.ts +1 -0
- package/out/utils/detectTestFramework.js +32 -0
- package/out/utils/detectTestFramework.js.map +1 -0
- package/out/utils/fileUtils.d.ts +2 -0
- package/out/utils/fileUtils.js +42 -0
- package/out/utils/fileUtils.js.map +1 -0
- package/out/utils/generateCodeSha256.d.ts +1 -0
- package/out/utils/generateCodeSha256.js +46 -0
- package/out/utils/generateCodeSha256.js.map +1 -0
- package/out/utils/getCodeStructurePath.d.ts +5 -0
- package/out/utils/getCodeStructurePath.js +155 -0
- package/out/utils/getCodeStructurePath.js.map +1 -0
- package/out/utils/getOrCreateDir.d.ts +2 -0
- package/out/utils/getOrCreateDir.js +63 -0
- package/out/utils/getOrCreateDir.js.map +1 -0
- package/out/utils/getTestCodeInfo.d.ts +2 -0
- package/out/utils/getTestCodeInfo.js +121 -0
- package/out/utils/getTestCodeInfo.js.map +1 -0
- package/out/utils/getTestFile.d.ts +13 -0
- package/out/utils/getTestFile.js +295 -0
- package/out/utils/getTestFile.js.map +1 -0
- package/out/utils/parseBuildResult.d.ts +3 -0
- package/out/utils/parseBuildResult.js +44 -0
- package/out/utils/parseBuildResult.js.map +1 -0
- package/out/utils/parseSyntaxCheckResult.d.ts +2 -0
- package/out/utils/parseSyntaxCheckResult.js +38 -0
- package/out/utils/parseSyntaxCheckResult.js.map +1 -0
- package/out/utils/parseVstestResult.d.ts +3 -0
- package/out/utils/parseVstestResult.js +61 -0
- package/out/utils/parseVstestResult.js.map +1 -0
- package/out/utils/removeFailedTestMethods.d.ts +3 -0
- package/out/utils/removeFailedTestMethods.js +207 -0
- package/out/utils/removeFailedTestMethods.js.map +1 -0
- package/out/utils/runCommand.d.ts +1 -0
- package/out/utils/runCommand.js +14 -0
- package/out/utils/runCommand.js.map +1 -0
- package/out/utils/spawnExec.d.ts +1 -0
- package/out/utils/spawnExec.js +80 -0
- package/out/utils/spawnExec.js.map +1 -0
- package/out/utils/verifyBuildErrorCausedFile.d.ts +1 -0
- package/out/utils/verifyBuildErrorCausedFile.js +60 -0
- package/out/utils/verifyBuildErrorCausedFile.js.map +1 -0
- package/out/utils/verifyTestCode.d.ts +2 -0
- package/out/utils/verifyTestCode.js +25 -0
- package/out/utils/verifyTestCode.js.map +1 -0
- package/out/utils/writeGenCode.d.ts +1 -0
- package/out/utils/writeGenCode.js +50 -0
- package/out/utils/writeGenCode.js.map +1 -0
- package/out/vs/msBuild.d.ts +13 -0
- package/out/vs/msBuild.js +81 -0
- package/out/vs/msBuild.js.map +1 -0
- package/out/vs/vsTest.d.ts +15 -0
- package/out/vs/vsTest.js +107 -0
- package/out/vs/vsTest.js.map +1 -0
- package/out/vs/vsTools.d.ts +7 -0
- package/out/vs/vsTools.js +177 -0
- package/out/vs/vsTools.js.map +1 -0
- package/out/vsPlugin/getVsPluginVerifyResult.d.ts +2 -0
- package/out/vsPlugin/getVsPluginVerifyResult.js +41 -0
- package/out/vsPlugin/getVsPluginVerifyResult.js.map +1 -0
- package/out/vsPlugin/interactionConstants.d.ts +2 -0
- package/out/vsPlugin/interactionConstants.js +10 -0
- package/out/vsPlugin/interactionConstants.js.map +1 -0
- package/out/vsPlugin/sendStdToVsPlugin.d.ts +1 -0
- package/out/vsPlugin/sendStdToVsPlugin.js +12 -0
- package/out/vsPlugin/sendStdToVsPlugin.js.map +1 -0
- package/out/vsPlugin/stdListener.d.ts +3 -0
- package/out/vsPlugin/stdListener.js +57 -0
- package/out/vsPlugin/stdListener.js.map +1 -0
- package/package.json +33 -0
- package/tools/devenvcom.cmd +13 -0
- package/tools/devenvexe.cmd +13 -0
- package/tools/msbuildexe.cmd +13 -0
- package/tools/vstestexe.cmd +13 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toMarkdownTable = toMarkdownTable;
|
|
4
|
+
function toMarkdownTable(rows) {
|
|
5
|
+
if (!rows || rows.length === 0) {
|
|
6
|
+
return 'No data available toMarkdownTable';
|
|
7
|
+
}
|
|
8
|
+
const headers = [
|
|
9
|
+
'solution path',
|
|
10
|
+
'project path',
|
|
11
|
+
'code file path',
|
|
12
|
+
'state',
|
|
13
|
+
'build success',
|
|
14
|
+
'test success',
|
|
15
|
+
];
|
|
16
|
+
const lines = [];
|
|
17
|
+
// header
|
|
18
|
+
lines.push(`| ${headers.join(' | ')} |`);
|
|
19
|
+
lines.push(`| ${headers.map(() => '---').join(' | ')} |`);
|
|
20
|
+
// statistic count
|
|
21
|
+
const totalCount = rows.length;
|
|
22
|
+
const successCount = rows.filter(r => r.success).length;
|
|
23
|
+
const buildSuccessCount = rows.filter(r => buildSuccessCondition(r)).length;
|
|
24
|
+
const testSuccessCount = rows.filter(r => testSuccessCondition(r)).length;
|
|
25
|
+
const statsRow = [
|
|
26
|
+
'**Count**',
|
|
27
|
+
'',
|
|
28
|
+
`${totalCount}`,
|
|
29
|
+
`${successCount}(${(successCount / totalCount * 100).toFixed(2)}%)`,
|
|
30
|
+
`${buildSuccessCount}(${(buildSuccessCount / totalCount * 100).toFixed(2)}%)`,
|
|
31
|
+
`${testSuccessCount}(${(testSuccessCount / totalCount * 100).toFixed(2)}%)`,
|
|
32
|
+
];
|
|
33
|
+
lines.push(`| ${statsRow.join(' | ')} |`);
|
|
34
|
+
// table rows
|
|
35
|
+
for (const row of rows) {
|
|
36
|
+
lines.push(`| ${row.solutionPath} | ${row.projectPath} | ${row.codeFilePath} | ${getState(row)} | ${buildSuccessCondition(row) ? '✅' : '❌'} | ${testSuccessCondition(row) ? '✅' : '❌'} |`);
|
|
37
|
+
}
|
|
38
|
+
const markdownTable = lines.join('\n');
|
|
39
|
+
return markdownTable;
|
|
40
|
+
}
|
|
41
|
+
function getState(row) {
|
|
42
|
+
if (row.success) {
|
|
43
|
+
return 'Success';
|
|
44
|
+
}
|
|
45
|
+
else if (!row.testFilePath) {
|
|
46
|
+
return 'Skipped';
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
return 'Failed';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function buildSuccessCondition(row) {
|
|
53
|
+
const state = getState(row);
|
|
54
|
+
return row.success || (state === 'Failed' && !row.buildResult);
|
|
55
|
+
}
|
|
56
|
+
function testSuccessCondition(row) {
|
|
57
|
+
const state = getState(row);
|
|
58
|
+
return row.success;
|
|
59
|
+
}
|
|
60
|
+
// // clear special characters from string that are not allowed in markdown
|
|
61
|
+
// function sanitize(value?: string): string {
|
|
62
|
+
// if (!value) return '';
|
|
63
|
+
// return value.replace(/\|/g, '\\|').replace(/\r?\n/g, ' ');
|
|
64
|
+
// }
|
|
65
|
+
// const testRows = [
|
|
66
|
+
// {
|
|
67
|
+
// solutionPath: '/path/to/solution',
|
|
68
|
+
// projectPath: '/path/to/project',
|
|
69
|
+
// codeFilePath: '/path/to/file.cs',
|
|
70
|
+
// success: true,
|
|
71
|
+
// buildResult: undefined,
|
|
72
|
+
// testResult: undefined,
|
|
73
|
+
// },
|
|
74
|
+
// {
|
|
75
|
+
// solutionPath: '/path/to/solution',
|
|
76
|
+
// projectPath: '/path/to/project',
|
|
77
|
+
// codeFilePath: '/path/to/file.cs',
|
|
78
|
+
// success: false,
|
|
79
|
+
// buildResult: {},
|
|
80
|
+
// testResult: undefined,
|
|
81
|
+
// },
|
|
82
|
+
// {
|
|
83
|
+
// solutionPath: '/path/to/solution',
|
|
84
|
+
// projectPath: '/path/to/project',
|
|
85
|
+
// codeFilePath: '/path/to/file.cs',
|
|
86
|
+
// success: false,
|
|
87
|
+
// buildResult: undefined,
|
|
88
|
+
// testResult: {},
|
|
89
|
+
// },
|
|
90
|
+
// {
|
|
91
|
+
// solutionPath: '/path/to/solution',
|
|
92
|
+
// projectPath: '/path/to/project',
|
|
93
|
+
// codeFilePath: '/path/to/file.cs',
|
|
94
|
+
// success: false,
|
|
95
|
+
// buildResult: undefined,
|
|
96
|
+
// testResult: {},
|
|
97
|
+
// },
|
|
98
|
+
// ];
|
|
99
|
+
// const markdownTable = toMarkdownTable(testRows);
|
|
100
|
+
// console.log(markdownTable);
|
|
101
|
+
//# sourceMappingURL=formatToMarkdown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatToMarkdown.js","sourceRoot":"","sources":["../../src/benchmark/formatToMarkdown.ts"],"names":[],"mappings":";;AAEA,0CA8CC;AA9CD,SAAgB,eAAe,CAAC,IAAoB;IAChD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,OAAO,mCAAmC,CAAC;IAC/C,CAAC;IAED,MAAM,OAAO,GAAG;QACZ,eAAe;QACf,cAAc;QACd,gBAAgB;QAChB,OAAO;QACP,eAAe;QACf,cAAc;KACjB,CAAC;IAEF,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,SAAS;IACT,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACzC,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE1D,kBAAkB;IAClB,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC;IAC/B,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC;IACxD,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAC5E,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAE1E,MAAM,QAAQ,GAAG;QACb,WAAW;QACX,EAAE;QACF,GAAG,UAAU,EAAE;QACf,GAAG,YAAY,IAAI,CAAC,YAAY,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;QACnE,GAAG,iBAAiB,IAAI,CAAC,iBAAiB,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;QAC7E,GAAG,gBAAgB,IAAI,CAAC,gBAAgB,GAAG,UAAU,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI;KAC9E,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE3C,aAAa;IACb,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACrB,KAAK,CAAC,IAAI,CACN,KAAK,GAAG,CAAC,YAAY,MAAM,GAAG,CAAC,WAAW,MAAM,GAAG,CAAC,YAAY,MAAM,QAAQ,CAAC,GAAG,CAAC,MAAM,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAClL,CAAC;IACN,CAAC;IAED,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,aAAa,CAAC;AACzB,CAAC;AAGD,SAAS,QAAQ,CAAC,GAAiB;IAC/B,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,SAAS,CAAC;IACrB,CAAC;SAAM,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACrB,CAAC;SAAM,CAAC;QACJ,OAAO,QAAQ,CAAC;IACpB,CAAC;AACL,CAAC;AACD,SAAS,qBAAqB,CAAC,GAAiB;IAC5C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,GAAG,CAAC,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,oBAAoB,CAAC,GAAiB;IAC3C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,OAAO,GAAG,CAAC,OAAO,CAAC;AACvB,CAAC;AAED,2EAA2E;AAC3E,8CAA8C;AAC9C,2BAA2B;AAC3B,+DAA+D;AAC/D,IAAI;AAEJ,qBAAqB;AACrB,QAAQ;AACR,6CAA6C;AAC7C,2CAA2C;AAC3C,4CAA4C;AAC5C,yBAAyB;AACzB,kCAAkC;AAClC,iCAAiC;AACjC,SAAS;AACT,YAAY;AACZ,6CAA6C;AAC7C,2CAA2C;AAC3C,4CAA4C;AAC5C,0BAA0B;AAC1B,2BAA2B;AAC3B,iCAAiC;AACjC,SAAS;AACT,YAAY;AACZ,6CAA6C;AAC7C,2CAA2C;AAC3C,4CAA4C;AAC5C,0BAA0B;AAC1B,kCAAkC;AAClC,0BAA0B;AAC1B,SAAS;AACT,YAAY;AACZ,6CAA6C;AAC7C,2CAA2C;AAC3C,4CAA4C;AAC5C,0BAA0B;AAC1B,kCAAkC;AAClC,0BAA0B;AAC1B,SAAS;AACT,KAAK;AAEL,mDAAmD;AACnD,8BAA8B","sourcesContent":["import { BenchmarkRow } from \"../types/benchmark\";\r\n\r\nexport function toMarkdownTable(rows: BenchmarkRow[]): string {\r\n if (!rows || rows.length === 0) {\r\n return 'No data available toMarkdownTable';\r\n }\r\n\r\n const headers = [\r\n 'solution path',\r\n 'project path',\r\n 'code file path',\r\n 'state',\r\n 'build success',\r\n 'test success',\r\n ];\r\n\r\n const lines: string[] = [];\r\n\r\n // header\r\n lines.push(`| ${headers.join(' | ')} |`);\r\n lines.push(`| ${headers.map(() => '---').join(' | ')} |`);\r\n\r\n // statistic count\r\n const totalCount = rows.length;\r\n const successCount = rows.filter(r => r.success).length;\r\n const buildSuccessCount = rows.filter(r => buildSuccessCondition(r)).length;\r\n const testSuccessCount = rows.filter(r => testSuccessCondition(r)).length;\r\n\r\n const statsRow = [\r\n '**Count**',\r\n '',\r\n `${totalCount}`,\r\n `${successCount}(${(successCount / totalCount * 100).toFixed(2)}%)`,\r\n `${buildSuccessCount}(${(buildSuccessCount / totalCount * 100).toFixed(2)}%)`,\r\n `${testSuccessCount}(${(testSuccessCount / totalCount * 100).toFixed(2)}%)`,\r\n ];\r\n\r\n lines.push(`| ${statsRow.join(' | ')} |`);\r\n\r\n // table rows\r\n for (const row of rows) {\r\n lines.push(\r\n `| ${row.solutionPath} | ${row.projectPath} | ${row.codeFilePath} | ${getState(row)} | ${buildSuccessCondition(row) ? '✅' : '❌'} | ${testSuccessCondition(row) ? '✅' : '❌'} |`\r\n );\r\n }\r\n\r\n const markdownTable = lines.join('\\n');\r\n return markdownTable;\r\n}\r\n\r\n\r\nfunction getState(row: BenchmarkRow): string {\r\n if (row.success) {\r\n return 'Success';\r\n } else if (!row.testFilePath) {\r\n return 'Skipped';\r\n } else {\r\n return 'Failed';\r\n }\r\n}\r\nfunction buildSuccessCondition(row: BenchmarkRow): boolean {\r\n const state = getState(row);\r\n return row.success || (state === 'Failed' && !row.buildResult);\r\n}\r\n\r\nfunction testSuccessCondition(row: BenchmarkRow): boolean {\r\n const state = getState(row);\r\n return row.success;\r\n}\r\n\r\n// // clear special characters from string that are not allowed in markdown\r\n// function sanitize(value?: string): string {\r\n// if (!value) return '';\r\n// return value.replace(/\\|/g, '\\\\|').replace(/\\r?\\n/g, ' ');\r\n// }\r\n\r\n// const testRows = [\r\n// {\r\n// solutionPath: '/path/to/solution',\r\n// projectPath: '/path/to/project',\r\n// codeFilePath: '/path/to/file.cs',\r\n// success: true,\r\n// buildResult: undefined,\r\n// testResult: undefined,\r\n// },\r\n// {\r\n// solutionPath: '/path/to/solution',\r\n// projectPath: '/path/to/project',\r\n// codeFilePath: '/path/to/file.cs',\r\n// success: false,\r\n// buildResult: {},\r\n// testResult: undefined,\r\n// },\r\n// {\r\n// solutionPath: '/path/to/solution',\r\n// projectPath: '/path/to/project',\r\n// codeFilePath: '/path/to/file.cs',\r\n// success: false,\r\n// buildResult: undefined,\r\n// testResult: {},\r\n// },\r\n// {\r\n// solutionPath: '/path/to/solution',\r\n// projectPath: '/path/to/project',\r\n// codeFilePath: '/path/to/file.cs',\r\n// success: false,\r\n// buildResult: undefined,\r\n// testResult: {},\r\n// },\r\n// ];\r\n\r\n// const markdownTable = toMarkdownTable(testRows);\r\n// console.log(markdownTable);"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateBenchmarkReport(inputPath: any, enableAutoFix: boolean, keepFailedTests: boolean): Promise<void>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.generateBenchmarkReport = generateBenchmarkReport;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const generateCodeTests_1 = require("../batch/generateCodeTests");
|
|
40
|
+
const formatToMarkdown_1 = require("./formatToMarkdown");
|
|
41
|
+
async function generateBenchmarkReport(inputPath, enableAutoFix, keepFailedTests) {
|
|
42
|
+
const benchmarkRows = await (0, generateCodeTests_1.generateBatchTests)(inputPath, enableAutoFix, keepFailedTests, true);
|
|
43
|
+
convertToMarkdown(benchmarkRows);
|
|
44
|
+
}
|
|
45
|
+
function formatCachedGenResults() {
|
|
46
|
+
const cachedBenchmarkRowsStr = fs.readFileSync(generateCodeTests_1.CACHEFile, 'utf-8');
|
|
47
|
+
const cacheBenchmarkRows = JSON.parse(cachedBenchmarkRowsStr);
|
|
48
|
+
convertToMarkdown(cacheBenchmarkRows);
|
|
49
|
+
}
|
|
50
|
+
function convertToMarkdown(benchmarkRows) {
|
|
51
|
+
const formattedReport = (0, formatToMarkdown_1.toMarkdownTable)(benchmarkRows);
|
|
52
|
+
const benchmarkReportPath = path.join(__dirname, `../benchmarkReport_${Date.now()}.md`);
|
|
53
|
+
fs.writeFileSync(benchmarkReportPath, formattedReport, 'utf-8');
|
|
54
|
+
console.log(`Benchmark report generated at: ${benchmarkReportPath}`);
|
|
55
|
+
}
|
|
56
|
+
// const codeFiles = [
|
|
57
|
+
// // "D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Overview\\Teaser\\PostProcess\\AlertContentPostProcessor.cs",
|
|
58
|
+
// // "D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\ResponseBuilders\\EplantRankResponseBuilder.cs",
|
|
59
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\DataModel\\EplantRank.cs',
|
|
60
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\EplantConfigManager.cs',
|
|
61
|
+
// 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Overview\\HttpRequestParser\\Utils\\SqmidHelper.cs',
|
|
62
|
+
// 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\Conditions\\EplantRequestCategoryCondition.cs',
|
|
63
|
+
// 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\ResponseBuilders\\EplantMigrateResponseBuilder.cs',
|
|
64
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Overview\\HttpRequestParser\\Utils\\WeatherParamsHttpConverter.cs',
|
|
65
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\RequestBuilders\\EplantRankRequestBuilder.cs',
|
|
66
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\RequestBuilders\\EplantPlantRequestBuilder.cs',
|
|
67
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\ResponseBuilders\\EplantMeResponseBuilder.cs',
|
|
68
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Overview\\LocationSearch\\GeoLocationIDFirstCondition.cs',
|
|
69
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\RequestBuilders\\EplantTreeRequestBuilder.cs',
|
|
70
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\ResponseBuilders\\EplantTreeResponseBuilder.cs',
|
|
71
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\Conditions\\EplantUserUpdateCondition.cs',
|
|
72
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\RequestBuilders\\EplantUserUpdateRequestBuilder.cs',
|
|
73
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\ResponseBuilders\\EplantUserUpdateResponseBuilder.cs',
|
|
74
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Overview\\LocationSearch\\LocationsResponseCombiner.cs',
|
|
75
|
+
// // 'D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Overview\\HttpRequestParser\\Utils\\WeatherParamsHttpConverter.cs'
|
|
76
|
+
// ];
|
|
77
|
+
// generateBenchmarkReport(codeFiles, true, true);
|
|
78
|
+
// formatCachedGenResults();
|
|
79
|
+
// generateBenchmarkReport("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Eplant\\", true, true);
|
|
80
|
+
// generateBenchmarkReport("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\Workflows\\Overview\\", true, true);
|
|
81
|
+
// generateBenchmarkReport("C:\\Users\\jixiongge\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Plugins\\SharedSegments.Plugins.csproj", true, true);
|
|
82
|
+
//# sourceMappingURL=generateBenchmarkReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateBenchmarkReport.js","sourceRoot":"","sources":["../../src/benchmark/generateBenchmarkReport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,0DAIC;AAXD,uCAAyB;AACzB,2CAA6B;AAE7B,kEAA2E;AAE3E,yDAAqD;AAE9C,KAAK,UAAU,uBAAuB,CAAC,SAAc,EAAE,aAAsB,EAAE,eAAwB;IAC1G,MAAM,aAAa,GAAG,MAAM,IAAA,sCAAkB,EAAC,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,IAAI,CAAC,CAAC;IAEhG,iBAAiB,CAAC,aAAa,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,sBAAsB;IAC3B,MAAM,sBAAsB,GAAG,EAAE,CAAC,YAAY,CAAC,6BAAS,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAC9D,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;AAC1C,CAAC;AAED,SAAS,iBAAiB,CAAC,aAAa;IACpC,MAAM,eAAe,GAAG,IAAA,kCAAe,EAAC,aAAa,CAAC,CAAC;IACvD,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACxF,EAAE,CAAC,aAAa,CAAC,mBAAmB,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IAChE,OAAO,CAAC,GAAG,CAAC,kCAAkC,mBAAmB,EAAE,CAAC,CAAC;AACzE,CAAC;AAED,sBAAsB;AACtB,6KAA6K;AAC7K,wKAAwK;AACxK,kJAAkJ;AAClJ,gJAAgJ;AAChJ,iKAAiK;AACjK,oKAAoK;AACpK,wKAAwK;AACxK,mLAAmL;AACnL,sKAAsK;AACtK,uKAAuK;AACvK,sKAAsK;AACtK,0KAA0K;AAC1K,sKAAsK;AACtK,wKAAwK;AACxK,kKAAkK;AAClK,4KAA4K;AAC5K,8KAA8K;AAC9K,wKAAwK;AACxK,kLAAkL;AAClL,KAAK;AAEL,kDAAkD;AAElD,4BAA4B;AAG5B,wJAAwJ;AACxJ,0JAA0J;AAC1J,oLAAoL","sourcesContent":["import * as fs from 'fs';\r\nimport * as path from 'path';\r\n\r\nimport { CACHEFile, generateBatchTests } from '../batch/generateCodeTests';\r\n\r\nimport { toMarkdownTable } from './formatToMarkdown';\r\n\r\nexport async function generateBenchmarkReport(inputPath: any, enableAutoFix: boolean, keepFailedTests: boolean) {\r\n const benchmarkRows = await generateBatchTests(inputPath, enableAutoFix, keepFailedTests, true);\r\n\r\n convertToMarkdown(benchmarkRows);\r\n}\r\n\r\nfunction formatCachedGenResults() {\r\n const cachedBenchmarkRowsStr = fs.readFileSync(CACHEFile, 'utf-8');\r\n const cacheBenchmarkRows = JSON.parse(cachedBenchmarkRowsStr);\r\n convertToMarkdown(cacheBenchmarkRows);\r\n}\r\n\r\nfunction convertToMarkdown(benchmarkRows) {\r\n const formattedReport = toMarkdownTable(benchmarkRows);\r\n const benchmarkReportPath = path.join(__dirname, `../benchmarkReport_${Date.now()}.md`);\r\n fs.writeFileSync(benchmarkReportPath, formattedReport, 'utf-8');\r\n console.log(`Benchmark report generated at: ${benchmarkReportPath}`);\r\n}\r\n\r\n// const codeFiles = [\r\n// // \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Overview\\\\Teaser\\\\PostProcess\\\\AlertContentPostProcessor.cs\",\r\n// // \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\ResponseBuilders\\\\EplantRankResponseBuilder.cs\",\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\DataModel\\\\EplantRank.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\EplantConfigManager.cs',\r\n// 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Overview\\\\HttpRequestParser\\\\Utils\\\\SqmidHelper.cs',\r\n// 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\Conditions\\\\EplantRequestCategoryCondition.cs',\r\n// 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\ResponseBuilders\\\\EplantMigrateResponseBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Overview\\\\HttpRequestParser\\\\Utils\\\\WeatherParamsHttpConverter.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\RequestBuilders\\\\EplantRankRequestBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\RequestBuilders\\\\EplantPlantRequestBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\ResponseBuilders\\\\EplantMeResponseBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Overview\\\\LocationSearch\\\\GeoLocationIDFirstCondition.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\RequestBuilders\\\\EplantTreeRequestBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\ResponseBuilders\\\\EplantTreeResponseBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\Conditions\\\\EplantUserUpdateCondition.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\RequestBuilders\\\\EplantUserUpdateRequestBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\ResponseBuilders\\\\EplantUserUpdateResponseBuilder.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Overview\\\\LocationSearch\\\\LocationsResponseCombiner.cs',\r\n// // 'D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Overview\\\\HttpRequestParser\\\\Utils\\\\WeatherParamsHttpConverter.cs'\r\n// ];\r\n\r\n// generateBenchmarkReport(codeFiles, true, true);\r\n\r\n// formatCachedGenResults();\r\n\r\n\r\n// generateBenchmarkReport(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Eplant\\\\\", true, true);\r\n// generateBenchmarkReport(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\Workflows\\\\Overview\\\\\", true, true);\r\n// generateBenchmarkReport(\"C:\\\\Users\\\\jixiongge\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Plugins\\\\SharedSegments.Plugins.csproj\", true, true);"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function runCodeCoverage(testProjectDllPath: string, codeCoverageSettingPath: string): Promise<any>;
|
|
2
|
+
export declare function codeCoverageErrorHandler(error: any): boolean;
|
|
3
|
+
export declare function codeCoverageCloseHandler(code: any, stdout: any, stderr: any): {
|
|
4
|
+
success: boolean;
|
|
5
|
+
message: any;
|
|
6
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runCodeCoverage = runCodeCoverage;
|
|
4
|
+
exports.codeCoverageErrorHandler = codeCoverageErrorHandler;
|
|
5
|
+
exports.codeCoverageCloseHandler = codeCoverageCloseHandler;
|
|
6
|
+
const extractCodeCoverageInfo_1 = require("./extractCodeCoverageInfo");
|
|
7
|
+
const getOrCreateDir_1 = require("../utils/getOrCreateDir");
|
|
8
|
+
const spawnExec_1 = require("../utils/spawnExec");
|
|
9
|
+
const vsTools_1 = require("../vs/vsTools");
|
|
10
|
+
const CODECOVERAGEDIR = './codecoverage';
|
|
11
|
+
function runCodeCoverage(testProjectDllPath, codeCoverageSettingPath) {
|
|
12
|
+
const workDir = (0, getOrCreateDir_1.getTmpCacheDir)(CODECOVERAGEDIR);
|
|
13
|
+
const args = [testProjectDllPath, `/Settings:${codeCoverageSettingPath}`, '/TestCaseFilter:TestCategory!=FunctionalGate&TestCategory!=LocalAH', '/EnableCodeCoverage', '/collect:Code Coverage;Format=Cobertura'];
|
|
14
|
+
console.log(`Running Code coverage...`);
|
|
15
|
+
return (0, spawnExec_1.runSpawn)(vsTools_1.vstestPath, args, workDir, codeCoverageErrorHandler, codeCoverageCloseHandler);
|
|
16
|
+
}
|
|
17
|
+
function codeCoverageErrorHandler(error) {
|
|
18
|
+
console.error(`codeCoverageErrorHandler - failed: ${error.message}`);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
function codeCoverageCloseHandler(code, stdout, stderr) {
|
|
22
|
+
const coberturaXmlPath = (0, extractCodeCoverageInfo_1.extractCoberturaXmlPath)(stdout);
|
|
23
|
+
if (code !== 0 && !coberturaXmlPath) {
|
|
24
|
+
console.error(`Code coverage generation failed with exit code ${code}`);
|
|
25
|
+
return { success: false, message: stdout };
|
|
26
|
+
}
|
|
27
|
+
if (stderr && !coberturaXmlPath) {
|
|
28
|
+
console.error(`Code coverage generation Warnings/Errors:\n${stdout}`);
|
|
29
|
+
return { success: false, message: stdout };
|
|
30
|
+
}
|
|
31
|
+
console.log(`Code coverage generation succeeded`);
|
|
32
|
+
return { success: true, message: coberturaXmlPath };
|
|
33
|
+
}
|
|
34
|
+
// runCodeCoverage("D:\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\bin\\Debug\\SharedSegments.Tests.dll", "D:\\code\\CS.Service.Fundamental\\SharedSegments\\CodeCoverage.runsettings");
|
|
35
|
+
//# sourceMappingURL=codeCoverage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeCoverage.js","sourceRoot":"","sources":["../../src/codeCoverage/codeCoverage.ts"],"names":[],"mappings":";;AAMA,0CAKC;AAED,4DAGC;AAED,4DAeC;AAjCD,uEAAoE;AACpE,4DAAyD;AACzD,kDAA8C;AAC9C,2CAA2C;AAE3C,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,SAAgB,eAAe,CAAC,kBAA0B,EAAE,uBAA+B;IACvF,MAAM,OAAO,GAAG,IAAA,+BAAc,EAAC,eAAe,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,CAAC,kBAAkB,EAAE,aAAa,uBAAuB,EAAE,EAAE,oEAAoE,EAAE,qBAAqB,EAAE,yCAAyC,CAAC,CAAC;IAClN,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IACxC,OAAO,IAAA,oBAAQ,EAAC,oBAAU,EAAE,IAAI,EAAE,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,CAAC,CAAC;AACnG,CAAC;AAED,SAAgB,wBAAwB,CAAC,KAAK;IAC1C,OAAO,CAAC,KAAK,CAAC,sCAAsC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACrE,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM;IACzD,MAAM,gBAAgB,GAAG,IAAA,iDAAuB,EAAC,MAAM,CAAC,CAAC;IAEzD,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAClC,OAAO,CAAC,KAAK,CAAC,kDAAkD,IAAI,EAAE,CAAC,CAAC;QACxE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC;IAED,IAAI,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,CAAC,8CAA8C,MAAM,EAAE,CAAC,CAAC;QACtE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;IAClD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;AACxD,CAAC;AAED,iOAAiO","sourcesContent":["import { extractCoberturaXmlPath } from './extractCodeCoverageInfo';\r\nimport { getTmpCacheDir } from '../utils/getOrCreateDir';\r\nimport { runSpawn } from '../utils/spawnExec';\r\nimport { vstestPath } from '../vs/vsTools';\r\n\r\nconst CODECOVERAGEDIR = './codecoverage';\r\nexport function runCodeCoverage(testProjectDllPath: string, codeCoverageSettingPath: string): Promise<any> {\r\n const workDir = getTmpCacheDir(CODECOVERAGEDIR);\r\n const args = [testProjectDllPath, `/Settings:${codeCoverageSettingPath}`, '/TestCaseFilter:TestCategory!=FunctionalGate&TestCategory!=LocalAH', '/EnableCodeCoverage', '/collect:Code Coverage;Format=Cobertura'];\r\n console.log(`Running Code coverage...`);\r\n return runSpawn(vstestPath, args, workDir, codeCoverageErrorHandler, codeCoverageCloseHandler);\r\n}\r\n\r\nexport function codeCoverageErrorHandler(error) {\r\n console.error(`codeCoverageErrorHandler - failed: ${error.message}`);\r\n return true;\r\n}\r\n\r\nexport function codeCoverageCloseHandler(code, stdout, stderr) {\r\n const coberturaXmlPath = extractCoberturaXmlPath(stdout);\r\n \r\n if (code !== 0 && !coberturaXmlPath) {\r\n console.error(`Code coverage generation failed with exit code ${code}`);\r\n return { success: false, message: stdout };\r\n }\r\n\r\n if (stderr && !coberturaXmlPath) {\r\n console.error(`Code coverage generation Warnings/Errors:\\n${stdout}`);\r\n return { success: false, message: stdout };\r\n }\r\n\r\n console.log(`Code coverage generation succeeded`);\r\n return { success: true, message: coberturaXmlPath };\r\n}\r\n\r\n// runCodeCoverage(\"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\bin\\\\Debug\\\\SharedSegments.Tests.dll\", \"D:\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\CodeCoverage.runsettings\");"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function runCodeCoverageReport(coverageXmlPath: string): Promise<any>;
|
|
2
|
+
export declare function coverageReportErrorHandler(error: any): boolean;
|
|
3
|
+
export declare function coverageReportCloseHandler(code: any, stdout: any, stderr: any): {
|
|
4
|
+
success: boolean;
|
|
5
|
+
message: any;
|
|
6
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.runCodeCoverageReport = runCodeCoverageReport;
|
|
37
|
+
exports.coverageReportErrorHandler = coverageReportErrorHandler;
|
|
38
|
+
exports.coverageReportCloseHandler = coverageReportCloseHandler;
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
const reportTool_1 = require("./reportTool");
|
|
41
|
+
const getOrCreateDir_1 = require("../utils/getOrCreateDir");
|
|
42
|
+
const spawnExec_1 = require("../utils/spawnExec");
|
|
43
|
+
const COVERAGEREPORT = "./coveragereport";
|
|
44
|
+
function runCodeCoverageReport(coverageXmlPath) {
|
|
45
|
+
if (!(0, reportTool_1.checkTestReportToolInstall)()) {
|
|
46
|
+
(0, reportTool_1.installTestReportTool)();
|
|
47
|
+
}
|
|
48
|
+
const coverageName = path.basename(coverageXmlPath, ".xml");
|
|
49
|
+
const coverageReportDir = `CoverageReport-${coverageName}`;
|
|
50
|
+
const args = [`-reports:"${coverageXmlPath}"`, `-targetdir:"${coverageReportDir}"`, '-reporttypes:Html'];
|
|
51
|
+
const workDir = (0, getOrCreateDir_1.getTmpCacheDir)(COVERAGEREPORT);
|
|
52
|
+
console.log(`Running Code coverage report...`);
|
|
53
|
+
return (0, spawnExec_1.runSpawn)("reportgenerator", args, workDir, coverageReportErrorHandler, coverageReportCloseHandler);
|
|
54
|
+
}
|
|
55
|
+
function coverageReportErrorHandler(error) {
|
|
56
|
+
console.error(`coverageReportErrorHandler - failed: ${error.message}`);
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
function coverageReportCloseHandler(code, stdout, stderr) {
|
|
60
|
+
if (code !== 0) {
|
|
61
|
+
console.error(`Code coverage report failed with exit code ${code}: \n ${stdout} \n ${stderr}`);
|
|
62
|
+
return { success: false, message: stdout };
|
|
63
|
+
}
|
|
64
|
+
if (stderr) {
|
|
65
|
+
console.error(`Code coverage report Warnings/Errors:\n${stdout}`);
|
|
66
|
+
return { success: false, message: stdout };
|
|
67
|
+
}
|
|
68
|
+
console.log(`Code coverage report succeeded`);
|
|
69
|
+
return { success: true, message: stdout };
|
|
70
|
+
}
|
|
71
|
+
// runCodeCoverageReport("D:\\code\\ai-dev-tools\\csharp-ut-copilot\\csharp-ut-core\\out\\atmpCache\\codecoverage\\TestResults\\3a4c5e07-ddfd-42e8-9a91-8064a4baed1e\\jixiongge_VECTORWC_2025-07-19.00_51_24.cobertura.xml");
|
|
72
|
+
//# sourceMappingURL=codeCoverageReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codeCoverageReport.js","sourceRoot":"","sources":["../../src/codeCoverage/codeCoverageReport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,sDAUC;AAED,gEAGC;AAED,gEAaC;AAtCD,2CAA6B;AAE7B,6CAAiF;AAEjF,4DAAyD;AACzD,kDAA8C;AAE9C,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,SAAgB,qBAAqB,CAAC,eAAuB;IACzD,IAAI,CAAC,IAAA,uCAA0B,GAAE,EAAE,CAAC;QAChC,IAAA,kCAAqB,GAAE,CAAC;IAC5B,CAAC;IACD,MAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC,CAAA;IAC3D,MAAM,iBAAiB,GAAG,kBAAkB,YAAY,EAAE,CAAC;IAC3D,MAAM,IAAI,GAAG,CAAC,aAAa,eAAe,GAAG,EAAE,eAAe,iBAAiB,GAAG,EAAE,mBAAmB,CAAC,CAAC;IACzG,MAAM,OAAO,GAAG,IAAA,+BAAc,EAAC,cAAc,CAAC,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC;IAC/C,OAAO,IAAA,oBAAQ,EAAC,iBAAiB,EAAE,IAAI,EAAE,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,CAAC,CAAC;AAC9G,CAAC;AAED,SAAgB,0BAA0B,CAAC,KAAK;IAC5C,OAAO,CAAC,KAAK,CAAC,wCAAwC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IACvE,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM;IAC3D,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,8CAA8C,IAAI,QAAQ,MAAM,OAAO,MAAM,EAAE,CAAC,CAAC;QAC/F,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC;IAED,IAAI,MAAM,EAAE,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,0CAA0C,MAAM,EAAE,CAAC,CAAC;QAClE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IAC/C,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;IAC9C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC9C,CAAC;AAGD,6NAA6N","sourcesContent":["import * as path from 'path';\r\n\r\nimport { checkTestReportToolInstall, installTestReportTool } from './reportTool';\r\n\r\nimport { getTmpCacheDir } from '../utils/getOrCreateDir';\r\nimport { runSpawn } from '../utils/spawnExec';\r\n\r\nconst COVERAGEREPORT = \"./coveragereport\";\r\nexport function runCodeCoverageReport(coverageXmlPath: string): Promise<any> {\r\n if (!checkTestReportToolInstall()) {\r\n installTestReportTool();\r\n }\r\n const coverageName = path.basename(coverageXmlPath, \".xml\")\r\n const coverageReportDir = `CoverageReport-${coverageName}`;\r\n const args = [`-reports:\"${coverageXmlPath}\"`, `-targetdir:\"${coverageReportDir}\"`, '-reporttypes:Html'];\r\n const workDir = getTmpCacheDir(COVERAGEREPORT);\r\n console.log(`Running Code coverage report...`);\r\n return runSpawn(\"reportgenerator\", args, workDir, coverageReportErrorHandler, coverageReportCloseHandler);\r\n}\r\n\r\nexport function coverageReportErrorHandler(error) {\r\n console.error(`coverageReportErrorHandler - failed: ${error.message}`);\r\n return true;\r\n}\r\n\r\nexport function coverageReportCloseHandler(code, stdout, stderr) {\r\n if (code !== 0) {\r\n console.error(`Code coverage report failed with exit code ${code}: \\n ${stdout} \\n ${stderr}`);\r\n return { success: false, message: stdout };\r\n }\r\n\r\n if (stderr) {\r\n console.error(`Code coverage report Warnings/Errors:\\n${stdout}`);\r\n return { success: false, message: stdout };\r\n }\r\n\r\n console.log(`Code coverage report succeeded`);\r\n return { success: true, message: stdout };\r\n}\r\n\r\n\r\n// runCodeCoverageReport(\"D:\\\\code\\\\ai-dev-tools\\\\csharp-ut-copilot\\\\csharp-ut-core\\\\out\\\\atmpCache\\\\codecoverage\\\\TestResults\\\\3a4c5e07-ddfd-42e8-9a91-8064a4baed1e\\\\jixiongge_VECTORWC_2025-07-19.00_51_24.cobertura.xml\");"]}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.extractCoberturaXmlPath = extractCoberturaXmlPath;
|
|
37
|
+
exports.getLineCoverage = getLineCoverage;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const fast_xml_parser_1 = require("fast-xml-parser");
|
|
40
|
+
function extractCoberturaXmlPath(log) {
|
|
41
|
+
const lines = log.split(/\r?\n/);
|
|
42
|
+
const startIndex = lines.findIndex((line) => line.trim() === "Attachments:");
|
|
43
|
+
if (startIndex === -1)
|
|
44
|
+
return null;
|
|
45
|
+
for (let i = startIndex + 1; i < lines.length; i++) {
|
|
46
|
+
const line = lines[i].trim();
|
|
47
|
+
if (line.endsWith(".cobertura.xml")) {
|
|
48
|
+
return line;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
function getLineCoverage(coverageXmlPath) {
|
|
54
|
+
// parse XML
|
|
55
|
+
const xmlContent = fs.readFileSync(coverageXmlPath, 'utf-8');
|
|
56
|
+
const parser = new fast_xml_parser_1.XMLParser({
|
|
57
|
+
ignoreAttributes: false,
|
|
58
|
+
attributeNamePrefix: '',
|
|
59
|
+
});
|
|
60
|
+
const result = parser.parse(xmlContent);
|
|
61
|
+
// extract coverage
|
|
62
|
+
const coverage = result.coverage;
|
|
63
|
+
const totalLineRate = parseFloat(coverage['line-rate']);
|
|
64
|
+
console.log(`Total Line Coverage: ${(totalLineRate * 100).toFixed(2)}%`);
|
|
65
|
+
// // extract coverage for each class
|
|
66
|
+
// const packages = coverage.packages?.package ?? [];
|
|
67
|
+
// const classes = Array.isArray(packages)
|
|
68
|
+
// ? packages.flatMap(p => p.classes?.class ?? [])
|
|
69
|
+
// : packages.classes?.class ?? [];
|
|
70
|
+
// console.log('\n📁 Per-Class Line Coverage:');
|
|
71
|
+
// classes.forEach((cls: any) => {
|
|
72
|
+
// const file = cls.filename || cls.name;
|
|
73
|
+
// const lineRate = parseFloat(cls['line-rate']);
|
|
74
|
+
// console.log(`- ${file}: ${(lineRate * 100).toFixed(2)}%`);
|
|
75
|
+
// });
|
|
76
|
+
}
|
|
77
|
+
// getLineCoverage("C:\\Users\\jixiongge\\code\\atmp\\TestResults\\505883d3-b9b2-47e2-99e5-468b7120268f\\jixiongge_CPC-jixio-9B9DD_2025-07-11.17_14_56.cobertura.xml");
|
|
78
|
+
// getLineCoverage("C:\\Users\\jixiongge\\code\\atmp\\TestResults\\3bdc7736-f79d-4866-874a-58bd31be18d4\\jixiongge_CPC-jixio-9B9DD_2025-07-10.21_45_35.cobertura.xml");
|
|
79
|
+
// getCodeCoverageSetting("C:\\Users\\jixiongge\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj");
|
|
80
|
+
//# sourceMappingURL=extractCodeCoverageInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractCodeCoverageInfo.js","sourceRoot":"","sources":["../../src/codeCoverage/extractCodeCoverageInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,0DAcC;AAED,0CA0BC;AA7CD,uCAAyB;AACzB,qDAA4C;AAE5C,SAAgB,uBAAuB,CAAC,GAAW;IAC/C,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEjC,MAAM,UAAU,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,cAAc,CAAC,CAAC;IAC7E,IAAI,UAAU,KAAK,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnC,KAAK,IAAI,CAAC,GAAG,UAAU,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAgB,eAAe,CAAC,eAAuB;IACnD,YAAY;IACZ,MAAM,UAAU,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,IAAI,2BAAS,CAAC;QACzB,gBAAgB,EAAE,KAAK;QACvB,mBAAmB,EAAE,EAAE;KAC1B,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IAExC,mBAAmB;IACnB,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IACxD,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,aAAa,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAEzE,qCAAqC;IACrC,qDAAqD;IACrD,0CAA0C;IAC1C,sDAAsD;IACtD,uCAAuC;IAEvC,gDAAgD;IAChD,kCAAkC;IAClC,6CAA6C;IAC7C,qDAAqD;IACrD,iEAAiE;IACjE,MAAM;AACV,CAAC;AAED,uKAAuK;AACvK,uKAAuK;AACvK,mKAAmK","sourcesContent":["import * as fs from 'fs';\r\nimport { XMLParser } from 'fast-xml-parser';\r\n\r\nexport function extractCoberturaXmlPath(log: string): string | null {\r\n const lines = log.split(/\\r?\\n/);\r\n\r\n const startIndex = lines.findIndex((line) => line.trim() === \"Attachments:\");\r\n if (startIndex === -1) return null;\r\n\r\n for (let i = startIndex + 1; i < lines.length; i++) {\r\n const line = lines[i].trim();\r\n if (line.endsWith(\".cobertura.xml\")) {\r\n return line;\r\n }\r\n }\r\n\r\n return null;\r\n}\r\n\r\nexport function getLineCoverage(coverageXmlPath: string) {\r\n // parse XML\r\n const xmlContent = fs.readFileSync(coverageXmlPath, 'utf-8');\r\n const parser = new XMLParser({\r\n ignoreAttributes: false,\r\n attributeNamePrefix: '',\r\n });\r\n const result = parser.parse(xmlContent);\r\n\r\n // extract coverage\r\n const coverage = result.coverage;\r\n const totalLineRate = parseFloat(coverage['line-rate']);\r\n console.log(`Total Line Coverage: ${(totalLineRate * 100).toFixed(2)}%`);\r\n\r\n // // extract coverage for each class\r\n // const packages = coverage.packages?.package ?? [];\r\n // const classes = Array.isArray(packages)\r\n // ? packages.flatMap(p => p.classes?.class ?? [])\r\n // : packages.classes?.class ?? [];\r\n\r\n // console.log('\\n📁 Per-Class Line Coverage:');\r\n // classes.forEach((cls: any) => {\r\n // const file = cls.filename || cls.name;\r\n // const lineRate = parseFloat(cls['line-rate']);\r\n // console.log(`- ${file}: ${(lineRate * 100).toFixed(2)}%`);\r\n // });\r\n}\r\n\r\n// getLineCoverage(\"C:\\\\Users\\\\jixiongge\\\\code\\\\atmp\\\\TestResults\\\\505883d3-b9b2-47e2-99e5-468b7120268f\\\\jixiongge_CPC-jixio-9B9DD_2025-07-11.17_14_56.cobertura.xml\");\r\n// getLineCoverage(\"C:\\\\Users\\\\jixiongge\\\\code\\\\atmp\\\\TestResults\\\\3bdc7736-f79d-4866-874a-58bd31be18d4\\\\jixiongge_CPC-jixio-9B9DD_2025-07-10.21_45_35.cobertura.xml\");\r\n// getCodeCoverageSetting(\"C:\\\\Users\\\\jixiongge\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\SharedSegments.Tests.csproj\");"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function generateCodeCoverageReport(testProjectPaths: string[], sourceCodePaths: string[]): Promise<void>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateCodeCoverageReport = generateCodeCoverageReport;
|
|
4
|
+
const getCodeStructurePath_1 = require("../utils/getCodeStructurePath");
|
|
5
|
+
const getCodeCoverageSetting_1 = require("./getCodeCoverageSetting");
|
|
6
|
+
const codeCoverage_1 = require("./codeCoverage");
|
|
7
|
+
const codeCoverageReport_1 = require("./codeCoverageReport");
|
|
8
|
+
const simplifyCoverageXml_1 = require("./simplifyCoverageXml");
|
|
9
|
+
async function generateCodeCoverageReport(testProjectPaths, sourceCodePaths) {
|
|
10
|
+
const startTime = Date.now();
|
|
11
|
+
for (const testProjectPath of testProjectPaths) {
|
|
12
|
+
const dllPath = (0, getCodeStructurePath_1.getBuiltDllPath)(testProjectPath);
|
|
13
|
+
const codeCoverageSetting = (0, getCodeCoverageSetting_1.getCodeCoverageSetting)(testProjectPath);
|
|
14
|
+
const { success, message } = await (0, codeCoverage_1.runCodeCoverage)(dllPath, codeCoverageSetting);
|
|
15
|
+
if (!message.endsWith("xml")) {
|
|
16
|
+
console.error(`Generating code coverage report failed, test project path: ${testProjectPath}, coverageSetting: ${codeCoverageSetting}, error: ${message}`);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const coberturaXmlPath = message;
|
|
20
|
+
const simplifiedXmlPath = (0, simplifyCoverageXml_1.simplifyCoverageXmlByFiles)(coberturaXmlPath, sourceCodePaths);
|
|
21
|
+
(0, codeCoverageReport_1.runCodeCoverageReport)(simplifiedXmlPath);
|
|
22
|
+
}
|
|
23
|
+
console.log(`code coverage report generation time: ${(Date.now() - startTime) / 1000} seconds`);
|
|
24
|
+
}
|
|
25
|
+
// const testProjectPaths = ["C:\\Users\\jixiongge\\code\\CS.Service.Fundamental\\SharedSegments\\SharedSegments\\SharedSegments.Tests\\SharedSegments.Tests.csproj"];
|
|
26
|
+
// generateCodeCoverageReport(testProjectPaths);
|
|
27
|
+
//# sourceMappingURL=generateCodeCoverageReport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateCodeCoverageReport.js","sourceRoot":"","sources":["../../src/codeCoverage/generateCodeCoverageReport.ts"],"names":[],"mappings":";;AAMA,gEAiBC;AAvBD,wEAAgE;AAChE,qEAAkE;AAClE,iDAAiD;AACjD,6DAA6D;AAC7D,+DAAmE;AAE5D,KAAK,UAAU,0BAA0B,CAAC,gBAA0B,EAAE,eAAyB;IAClG,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC7B,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,IAAA,sCAAe,EAAC,eAAe,CAAC,CAAC;QACjD,MAAM,mBAAmB,GAAG,IAAA,+CAAsB,EAAC,eAAe,CAAC,CAAC;QACpE,MAAM,EAAC,OAAO,EAAE,OAAO,EAAC,GAAG,MAAM,IAAA,8BAAe,EAAC,OAAO,EAAE,mBAAmB,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,8DAA8D,eAAe,sBAAsB,mBAAmB,YAAY,OAAO,EAAE,CAAC,CAAA;YAC1J,SAAS;QACb,CAAC;QAED,MAAM,gBAAgB,GAAG,OAAO,CAAC;QACjC,MAAM,iBAAiB,GAAG,IAAA,gDAA0B,EAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;QACxF,IAAA,0CAAqB,EAAC,iBAAiB,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,yCAAyC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,UAAU,CAAC,CAAC;AACpG,CAAC;AAED,sKAAsK;AACtK,gDAAgD","sourcesContent":["import { getBuiltDllPath } from \"../utils/getCodeStructurePath\";\r\nimport { getCodeCoverageSetting } from \"./getCodeCoverageSetting\";\r\nimport { runCodeCoverage } from \"./codeCoverage\";\r\nimport { runCodeCoverageReport } from \"./codeCoverageReport\";\r\nimport { simplifyCoverageXmlByFiles } from \"./simplifyCoverageXml\";\r\n\r\nexport async function generateCodeCoverageReport(testProjectPaths: string[], sourceCodePaths: string[]) {\r\n const startTime = Date.now();\r\n for (const testProjectPath of testProjectPaths){\r\n const dllPath = getBuiltDllPath(testProjectPath);\r\n const codeCoverageSetting = getCodeCoverageSetting(testProjectPath);\r\n const {success, message} = await runCodeCoverage(dllPath, codeCoverageSetting);\r\n if (!message.endsWith(\"xml\")) {\r\n console.error(`Generating code coverage report failed, test project path: ${testProjectPath}, coverageSetting: ${codeCoverageSetting}, error: ${message}`)\r\n continue;\r\n }\r\n\r\n const coberturaXmlPath = message;\r\n const simplifiedXmlPath = simplifyCoverageXmlByFiles(coberturaXmlPath, sourceCodePaths);\r\n runCodeCoverageReport(simplifiedXmlPath);\r\n }\r\n\r\n console.log(`code coverage report generation time: ${(Date.now() - startTime) / 1000} seconds`);\r\n}\r\n\r\n// const testProjectPaths = [\"C:\\\\Users\\\\jixiongge\\\\code\\\\CS.Service.Fundamental\\\\SharedSegments\\\\SharedSegments\\\\SharedSegments.Tests\\\\SharedSegments.Tests.csproj\"];\r\n// generateCodeCoverageReport(testProjectPaths);"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getCodeCoverageSetting(testProjectPath: string): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getCodeCoverageSetting = getCodeCoverageSetting;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const getCodeStructurePath_1 = require("../utils/getCodeStructurePath");
|
|
40
|
+
function getCodeCoverageSetting(testProjectPath) {
|
|
41
|
+
let currentDir = path.dirname(testProjectPath);
|
|
42
|
+
const repoRoot = (0, getCodeStructurePath_1.getCodeRepoRoot)(testProjectPath);
|
|
43
|
+
while (currentDir !== repoRoot) {
|
|
44
|
+
const entries = fs.readdirSync(currentDir, { withFileTypes: true });
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
if (!entry.isFile()) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (entry.name.toLowerCase().endsWith('.runsettings')) {
|
|
50
|
+
const fullPath = path.join(currentDir, entry.name);
|
|
51
|
+
return fullPath;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
currentDir = path.dirname(currentDir);
|
|
55
|
+
}
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=getCodeCoverageSetting.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getCodeCoverageSetting.js","sourceRoot":"","sources":["../../src/codeCoverage/getCodeCoverageSetting.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wDAqBC;AAzBD,uCAAyB;AACzB,2CAA6B;AAC7B,wEAAgE;AAEhE,SAAgB,sBAAsB,CAAC,eAAuB;IAC1D,IAAI,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAA,sCAAe,EAAC,eAAe,CAAC,CAAC;IAElD,OAAO,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QACpE,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAClB,SAAS;YACb,CAAC;YAED,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;gBACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;gBACnD,OAAO,QAAQ,CAAC;YACpB,CAAC;QACL,CAAC;QAED,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC","sourcesContent":["import * as fs from 'fs';\r\nimport * as path from 'path';\r\nimport { getCodeRepoRoot } from '../utils/getCodeStructurePath';\r\n\r\nexport function getCodeCoverageSetting(testProjectPath: string) {\r\n let currentDir = path.dirname(testProjectPath);\r\n const repoRoot = getCodeRepoRoot(testProjectPath);\r\n\r\n while (currentDir !== repoRoot) {\r\n const entries = fs.readdirSync(currentDir, { withFileTypes: true });\r\n for (const entry of entries) {\r\n if (!entry.isFile()) {\r\n continue;\r\n }\r\n\r\n if (entry.name.toLowerCase().endsWith('.runsettings')) {\r\n const fullPath = path.join(currentDir, entry.name);\r\n return fullPath;\r\n }\r\n }\r\n\r\n currentDir = path.dirname(currentDir);\r\n }\r\n\r\n return null;\r\n}"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkTestReportToolInstall = checkTestReportToolInstall;
|
|
4
|
+
exports.installTestReportTool = installTestReportTool;
|
|
5
|
+
const runCommand_1 = require("../utils/runCommand");
|
|
6
|
+
const packageId = 'dotnet-reportgenerator-globaltool';
|
|
7
|
+
function checkTestReportToolInstall() {
|
|
8
|
+
const output = (0, runCommand_1.runCommand)('dotnet tool list --global');
|
|
9
|
+
const lines = output.split(/\r?\n/).slice(2); // skip header lines
|
|
10
|
+
for (const line of lines) {
|
|
11
|
+
const parts = line.trim().split(/\s+/);
|
|
12
|
+
if (parts[0].toLowerCase() === packageId.toLowerCase()) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
function installTestReportTool() {
|
|
19
|
+
console.log(`${packageId} is not installed. Installing...`);
|
|
20
|
+
(0, runCommand_1.runCommand)(`dotnet tool install --global ${packageId}`);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=reportTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reportTool.js","sourceRoot":"","sources":["../../src/codeCoverage/reportTool.ts"],"names":[],"mappings":";;AAIA,gEAUC;AAED,sDAGC;AAnBD,oDAAiD;AAEjD,MAAM,SAAS,GAAG,mCAAmC,CAAC;AAEtD,SAAgB,0BAA0B;IACtC,MAAM,MAAM,GAAG,IAAA,uBAAU,EAAC,2BAA2B,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,oBAAoB;IAClE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,WAAW,EAAE,EAAE,CAAC;YACrD,OAAO,IAAI,CAAC;QAChB,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAgB,qBAAqB;IACjC,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,kCAAkC,CAAC,CAAC;IAC5D,IAAA,uBAAU,EAAC,gCAAgC,SAAS,EAAE,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import { runCommand } from '../utils/runCommand';\r\n\r\nconst packageId = 'dotnet-reportgenerator-globaltool';\r\n\r\nexport function checkTestReportToolInstall(): boolean {\r\n const output = runCommand('dotnet tool list --global');\r\n const lines = output.split(/\\r?\\n/).slice(2); // skip header lines\r\n for (const line of lines) {\r\n const parts = line.trim().split(/\\s+/);\r\n if (parts[0].toLowerCase() === packageId.toLowerCase()) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}\r\n\r\nexport function installTestReportTool() {\r\n console.log(`${packageId} is not installed. Installing...`);\r\n runCommand(`dotnet tool install --global ${packageId}`);\r\n}"]}
|