Skip to content

Commit 9cf169c

Browse files
author
David Hasani
committed
only skip unit tests
1 parent ffefdaf commit 9cf169c

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/CodeModernizerSession.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import software.aws.toolkits.jetbrains.services.codemodernizer.utils.isValidCode
4949
import software.aws.toolkits.jetbrains.services.codemodernizer.utils.pollTransformationStatusAndPlan
5050
import software.aws.toolkits.jetbrains.services.codemodernizer.utils.toTransformationLanguage
5151
import software.aws.toolkits.jetbrains.services.codewhisperer.codescan.CodeWhispererCodeScanSession
52+
import software.aws.toolkits.jetbrains.utils.notifyStickyInfo
5253
import software.aws.toolkits.resources.message
5354
import java.io.File
5455
import java.io.FileInputStream

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/constants/CodeTransformChatItems.kt

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -143,20 +143,16 @@ private val selectTargetVersionFormItem = FormItem(
143143

144144
private val selectSkipTestsFlagFormItem = FormItem(
145145
id = CodeTransformFormItemId.SelectSkipTestsFlag.id,
146-
title = message("codemodernizer.chat.form.user_selection.item.choose_skip_tests_flag"),
146+
title = message("codemodernizer.chat.form.user_selection.item.choose_skip_tests_option"),
147147
mandatory = true,
148148
options = listOf(
149149
FormItemOption(
150-
label = "Do not skip tests",
151-
value = "Do not skip tests",
150+
label = message("codemodernizer.chat.message.skip_tests_form.do_not_skip"),
151+
value = message("codemodernizer.chat.message.skip_tests_form.do_not_skip"),
152152
),
153153
FormItemOption(
154-
label = "Skip integration tests",
155-
value = "Skip integration tests",
156-
),
157-
FormItemOption(
158-
label = "Skip all tests",
159-
value = "Skip all tests",
154+
label = message("codemodernizer.chat.message.skip_tests_form.skip"),
155+
value = message("codemodernizer.chat.message.skip_tests_form.skip"),
160156
)
161157
)
162158
)
@@ -172,10 +168,10 @@ private fun getUserSelectionFormattedMarkdown(moduleName: String): String = """
172168
""".trimIndent()
173169

174170
private fun getUserSkipTestsFlagSelectionFormattedMarkdown(skipTestsSelection: String): String {
175-
// just for correct grammar
176171
var skipTestsText = skipTestsSelection
177-
if (skipTestsText == "Do not skip tests") skipTestsText = "not skip tests"
178-
return "Ok, I will ${skipTestsText.lowercase()} when building your project."
172+
// just for correct grammar
173+
if (skipTestsText == message("codemodernizer.chat.message.skip_tests_form.do_not_skip")) skipTestsText = "not skip unit tests"
174+
return message("codemodernizer.chat.message_skip_tests_form.response", skipTestsText.lowercase())
179175
}
180176

181177
private fun getUserHilSelectionMarkdown(dependencyName: String, currentVersion: String, selectedVersion: String): String = """

plugins/amazonq/codetransform/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codemodernizer/controller/CodeTransformChatController.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,9 @@ class CodeTransformChatController(
225225
if (configurationFile == null) throw RuntimeException("No build file selected")
226226
val sourceJdk = getSourceJdk(configurationFile!!)
227227
val customBuildCommand = when (message.skipTestsSelection) {
228-
"Skip integration tests" -> "test"
229-
"Skip all tests" -> "test-compile"
230-
else -> "verify"
228+
message("codemodernizer.chat.message.skip_tests_form.do_not_skip") -> "test"
229+
message("codemodernizer.chat.message.skip_tests_form.skip") -> "test-compile"
230+
else -> "test"
231231
}
232232
codeTransformChatHelper.addNewMessage(buildUserSkipTestsFlagSelectionChatContent(message.skipTestsSelection))
233233
val selection = CustomerSelection(

plugins/core/resources/resources/software/aws/toolkits/resources/MessagesBundle.properties

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ code.aws.workspaces=Amazon CodeCatalyst
553553
code.aws.workspaces.short=Dev Environments
554554
codemodernizer.builderrordialog.description.title=Error occurred when building your project
555555
codemodernizer.chat.form.user_selection.item.choose_module=Choose a module to transform
556-
codemodernizer.chat.form.user_selection.item.choose_skip_tests_flag=Choose to skip tests
556+
codemodernizer.chat.form.user_selection.item.choose_skip_tests_option=Choose to skip unit tests
557557
codemodernizer.chat.form.user_selection.item.choose_target_version=Choose the target code version
558558
codemodernizer.chat.form.user_selection.title=Q - Code transformation
559559
codemodernizer.chat.message.absolute_path_detected=I detected {0} potential absolute file path(s) in your {1} file: **{2}**. Absolute file paths might cause issues when I build your code. Any errors will show up in the build log.
@@ -596,7 +596,7 @@ codemodernizer.chat.message.hil.trying_resume=Trying to resume transformation wi
596596
codemodernizer.chat.message.hil.user_rejected=I'll continue upgrading your module. When I'm done, you can review the dependency error in the Transformation summary.
597597
codemodernizer.chat.message.local_build_begin=I'm building your module. This can take up to 10 minutes, depending on the size of your module.
598598
codemodernizer.chat.message.local_build_failed=Sorry, I couldn't run the Maven clean install command to build your module.
599-
codemodernizer.chat.message.local_build_success=I was able to build your project and will start uploading your code.
599+
codemodernizer.chat.message.local_build_success=I was able to build your module and will start uploading your code.
600600
codemodernizer.chat.message.result.fail=Sorry, I ran into an issue during the transformation. Please try again.
601601
codemodernizer.chat.message.result.fail_initial_build=I am having trouble building your project in the secure build environment and couldn't complete the transformation.
602602
codemodernizer.chat.message.result.fail_initial_build_no_build_log=I am having trouble building your project in the secure build environment: {0}.
@@ -605,7 +605,10 @@ codemodernizer.chat.message.result.partially_success=I upgraded part of your cod
605605
codemodernizer.chat.message.result.success=I successfully upgraded your code to Java 17. You can review the diff to see my proposed changes and accept or reject them. The transformation summary has details about the files I updated.
606606
codemodernizer.chat.message.result.zip_too_large=Sorry, your project size exceeds the Amazon Q Code Transformation upload limit of 2GB.
607607
codemodernizer.chat.message.resume_ongoing=I'm still transforming your code. It can take 10 to 30 minutes to upgrade your code, depending on the size of your module. To monitor progress, go to the Transformation Hub.
608-
codemodernizer.chat.message.skip_tests=Amazon Q uses 'mvn verify' to build your project. You can skip running tests to reduce the build time.
608+
codemodernizer.chat.message.skip_tests=I will build your module using `mvn test` by default. If you would like to skip running unit tests, I will use `mvn test-compile`.
609+
codemodernizer.chat.message.skip_tests_form.do_not_skip=Do not skip unit tests
610+
codemodernizer.chat.message_skip_tests_form.response=Ok, I will {0} when building your module.
611+
codemodernizer.chat.message.skip_tests_form.skip=Skip unit tests
609612
codemodernizer.chat.message.transform_begin=I'm starting to transform your code. It can take 10 to 30 minutes to upgrade your code, depending on the size of your module. To monitor progress, go to the Transformation Hub.
610613
codemodernizer.chat.message.transform_cancelled_by_user=I cancelled your transformation. If you want to start another transformation, choose **Start a new transformation**.
611614
codemodernizer.chat.message.transform_in_progress=If I run into any issues, I might pause the transformation to get input from you on how to proceed.

0 commit comments

Comments
 (0)