Skip to content

Commit 382114e

Browse files
committed
Telemetry: UTG send plaintext instead of python in amazonq_utgGenerateTests event
1 parent f601d89 commit 382114e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/core/src/amazonqTest/chat/controller/controller.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,8 @@ export class TestController {
444444

445445
/*
446446
For Re:Invent 2024 we are supporting only java and python for unit test generation, rest of the languages shows the similar experience as CWC
447-
If user request test generation from input chat without opening a file, its difficult to get the language, so default will be plainText
448447
*/
449-
if (language !== 'java' && language !== 'python' && language !== 'plaintext') {
448+
if (language !== 'java' && language !== 'python') {
450449
const unsupportedLanguage = language.charAt(0).toUpperCase() + language.slice(1)
451450
let unsupportedMessage = `<span style="color: #EE9D28;">&#9888;<b>I'm sorry, but /test only supports Python and Java</b><br></span> While ${unsupportedLanguage} is not supported, I will generate a suggestion below. `
452451
// handle the case when language is undefined
@@ -640,7 +639,6 @@ export class TestController {
640639
const session = this.sessionStorage.getSession()
641640
session.acceptedJobId = session.listOfTestGenerationJobId[session.listOfTestGenerationJobId.length - 1]
642641
const filePath = session.generatedFilePath
643-
session.fileLanguage = await this.getLanguageForFilePath(filePath)
644642
const absolutePath = path.join(session.projectRootPath, filePath)
645643
const fileExists = await fs.existsFile(absolutePath)
646644
const buildCommand = session.updatedBuildCommands?.join(' ')
@@ -724,7 +722,7 @@ export class TestController {
724722
acceptedCharactersCount: session.charsOfCodeAccepted,
725723
generatedLinesCount: session.linesOfCodeGenerated,
726724
acceptedLinesCount: session.linesOfCodeAccepted,
727-
cwsprChatProgrammingLanguage: session.fileLanguage,
725+
cwsprChatProgrammingLanguage: session.fileLanguage ?? 'plaintext',
728726
jobId: session.listOfTestGenerationJobId[0], // For RIV, UTG does only one StartTestGeneration API call so jobId = session.listOfTestGenerationJobId[0]
729727
jobGroup: session.testGenerationJobGroupName,
730728
buildPayloadBytes: session.srcPayloadSize,

0 commit comments

Comments
 (0)