Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion checkmarx-ast-cli.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.33
2.3.35
5 changes: 4 additions & 1 deletion src/main/wrapper/CxConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,8 @@ export enum CxConstants {
AI_PROVIDER = "--ai-provider",
TYPE = "--type",
SUB_TYPE = "--sub-type",
PROBLEM_SEVERITY = "--problem-severity"
PROBLEM_SEVERITY = "--problem-severity",
SCAN_TYPE_FLAG = "--scan-type",
STATUS = "--status",
TOTAL_COUNT = "--total-count",
}
7 changes: 5 additions & 2 deletions src/main/wrapper/CxWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ export class CxWrapper {
return new ExecutionService().executeCommands(this.config.pathToExecutable, commands, CxConstants.MASK_TYPE);
}

telemetryAIEvent(aiProvider: string, agent: string, eventType: string, subType: string, engine: string, problemSeverity: string): Promise<CxCommandOutput> {
telemetryAIEvent(aiProvider: string, agent: string, eventType: string, subType: string, engine: string, problemSeverity: string, scanType: string, status: string, totalCount: number): Promise<CxCommandOutput> {
const commands: string[] = [
CxConstants.TELEMETRY,
CxConstants.SUB_CMD_TELEMETRY_AI,
Expand All @@ -539,7 +539,10 @@ export class CxWrapper {
CxConstants.TYPE, eventType,
CxConstants.SUB_TYPE, subType,
CxConstants.ENGINE, engine,
CxConstants.PROBLEM_SEVERITY, problemSeverity
CxConstants.PROBLEM_SEVERITY, problemSeverity,
CxConstants.SCAN_TYPE_FLAG, scanType,
CxConstants.STATUS, status,
CxConstants.TOTAL_COUNT, totalCount.toString()
];
commands.push(...this.initializeCommands(false));
const exec = new ExecutionService();
Expand Down
4 changes: 2 additions & 2 deletions src/main/wrapper/resources/cx-linux
Git LFS file not shown
4 changes: 2 additions & 2 deletions src/main/wrapper/resources/cx-mac
Git LFS file not shown
4 changes: 2 additions & 2 deletions src/main/wrapper/resources/cx.exe
Git LFS file not shown
33 changes: 28 additions & 5 deletions src/tests/TelemetryTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,55 @@ import { BaseTest } from "./BaseTest";
describe("Telemetry cases", () => {
const cxScanConfig = new BaseTest();

it.skip('TelemetryAIEvent Successful case with minimal parameters', async () => {
it('TelemetryAIEvent Successful case with minimal parameters - ai log', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
"Cursor",
"Cursos",
"click",
"ast-results.viewPackageDetails",
"secrets",
"high"
"high",
"",
"",
0
);
console.log("Json object from telemetryAIEvent successful case: " + JSON.stringify(cxCommandOutput));
expect(cxCommandOutput.exitCode).toBe(0);
});

it('TelemetryAIEvent Successful case with minimal parameters - detection log', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
"",
"",
"",
"",
"",
"",
"asca",
"Critical",
10
);
console.log("Json object from telemetryAIEvent successful case: " + JSON.stringify(cxCommandOutput));
expect(cxCommandOutput.exitCode).toBe(0);
});


it.skip('TelemetryAIEvent Successful case with edge case parameters', async () => {
it('TelemetryAIEvent Successful case with edge case parameters', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const cxCommandOutput: CxCommandOutput = await wrapper.telemetryAIEvent(
"",
"",
"",
"",
"",
""
"",
"",
"",
0
);
console.log("Json object from telemetryAIEvent with empty parameters: " + JSON.stringify(cxCommandOutput));
expect(typeof cxCommandOutput.exitCode).toBe(0);
expect(cxCommandOutput.exitCode).toBe(0);
});
});