Skip to content

Commit 59afc4e

Browse files
Merge branch 'main' into samgst/q-lsp-supported-filetypes
2 parents aa37979 + db29774 commit 59afc4e

File tree

10 files changed

+437
-15
lines changed

10 files changed

+437
-15
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "increase /review timeout"
4+
}

buildSrc/src/main/kotlin/software/aws/toolkits/gradle/intellij/IdeVersions.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,40 +103,40 @@ object IdeVersions {
103103
Profile(
104104
name = "2025.1",
105105
gateway = ProductProfile(
106-
sdkVersion = "251.23774-EAP-CANDIDATE-SNAPSHOT",
106+
sdkVersion = "251.23774.441-CUSTOM-SNAPSHOT",
107107
bundledPlugins = listOf("org.jetbrains.plugins.terminal")
108108
),
109109
community = ProductProfile(
110-
sdkVersion = "251.23774.109-EAP-SNAPSHOT",
110+
sdkVersion = "2025.1",
111111
bundledPlugins = commonPlugins + listOf(
112112
"com.intellij.java",
113113
"com.intellij.gradle",
114114
"org.jetbrains.idea.maven",
115115
),
116116
marketplacePlugins = listOf(
117-
"PythonCore:251.23774.109",
118-
"Docker:251.23774.109"
117+
"PythonCore:251.23774.460",
118+
"Docker:251.23774.466"
119119
)
120120
),
121121
ultimate = ProductProfile(
122-
sdkVersion = "251.23774.109-EAP-SNAPSHOT",
122+
sdkVersion = "2025.1",
123123
bundledPlugins = commonPlugins + listOf(
124124
"JavaScript",
125125
"JavaScriptDebugger",
126126
"com.intellij.database",
127127
"com.jetbrains.codeWithMe",
128128
),
129129
marketplacePlugins = listOf(
130-
"Pythonid:251.23774.109",
131-
"org.jetbrains.plugins.go:251.23774.109",
130+
"Pythonid:251.23774.460",
131+
"org.jetbrains.plugins.go:251.23774.435",
132132
)
133133
),
134134
rider = RiderProfile(
135-
sdkVersion = "2025.1-EAP8-SNAPSHOT",
135+
sdkVersion = "2025.1",
136136
bundledPlugins = commonPlugins,
137137
netFrameworkTarget = "net472",
138138
rdGenVersion = "2025.1.1",
139-
nugetVersion = " 2025.1.0-eap08"
139+
nugetVersion = " 2025.1.0"
140140
)
141141
),
142142
).associateBy { it.name }

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/util/CodeWhispererConstants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ object CodeWhispererConstants {
7070
// Code scan feature constants
7171
val ISSUE_HIGHLIGHT_TEXT_ATTRIBUTES = TextAttributes(null, null, JBColor.YELLOW, EffectType.WAVE_UNDERSCORE, Font.PLAIN)
7272
const val CODE_SCAN_ISSUE_TITLE_MAX_LENGTH = 60
73-
const val DEFAULT_CODE_SCAN_TIMEOUT_IN_SECONDS: Long = 60 * 10 // 10 minutes
73+
const val DEFAULT_CODE_SCAN_TIMEOUT_IN_SECONDS: Long = 60 * 15 // 15 minutes
7474
const val DEFAULT_PAYLOAD_LIMIT_IN_BYTES: Long = 1 * 1024 * 1024 * 1024 // 1GB
7575
const val CODE_SCAN_POLLING_INTERVAL_IN_SECONDS: Long = 1
7676
const val FILE_SCAN_INITIAL_POLLING_INTERVAL_IN_SECONDS: Long = 10

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/docTests/Utils.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ fun prepTestData(isCreate: Boolean) {
1313
if (File(path).exists()) {
1414
File(path).delete()
1515
}
16+
// check multi-root workspace readme as well
17+
val path2 = Paths.get("tstData", "qdoc", "README.md").toUri()
18+
if (File(path2).exists()) {
19+
File(path2).delete()
20+
}
1621
} else {
1722
val path = Paths.get("tstData", "qdoc", "updateFlow", "README.md").toUri()
1823
process = ProcessBuilder("git", "restore", path.path).start()

ui-tests-starter/tst-243+/software/aws/toolkits/jetbrains/uitests/docTests/createReadmeTests/CreateReadmeTest.kt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
package software.aws.toolkits.jetbrains.uitests.docTests.createReadmeTests
55

6+
import com.intellij.driver.sdk.ui.ui
67
import com.intellij.driver.sdk.waitForProjectOpen
78
import com.intellij.ide.starter.ci.CIServer
89
import com.intellij.ide.starter.config.ConfigurationStorage
@@ -27,6 +28,7 @@ import software.aws.toolkits.jetbrains.uitests.docTests.prepTestData
2728
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.acceptReadmeTestScript
2829
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.createReadmePromptedToConfirmFolderTestScript
2930
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.makeChangesFlowTestScript
31+
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.newReadmeDiffViewerTestScript
3032
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.rejectReadmeTestScript
3133
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.validateFeatureAvailabilityTestScript
3234
import software.aws.toolkits.jetbrains.uitests.executePuppeteerScript
@@ -246,6 +248,46 @@ class CreateReadmeTest {
246248
}
247249
}
248250

251+
@Test
252+
fun `New Readme opens in diff viewer`() {
253+
val testCase = TestCase(
254+
IdeProductProvider.IC,
255+
LocalProjectInfo(
256+
Paths.get("tstData", "qdoc", "createFlow")
257+
)
258+
).useRelease(System.getProperty("org.gradle.project.ideProfileName"))
259+
260+
// inject connection
261+
useExistingConnectionForTest()
262+
263+
Starter.newContext(CurrentTestMethod.hyphenateWithClass(), testCase).apply {
264+
System.getProperty("ui.test.plugins").split(File.pathSeparator).forEach { path ->
265+
pluginConfigurator.installPluginFromPath(
266+
Path.of(path)
267+
)
268+
}
269+
270+
copyExistingConfig(Paths.get("tstData", "configAmazonQTests"))
271+
updateGeneralSettings()
272+
}.runIdeWithDriver()
273+
.useDriverAndCloseIde {
274+
waitForProjectOpen()
275+
// required wait time for the system to be fully ready
276+
Thread.sleep(30000)
277+
278+
val readmePath = Paths.get("tstData", "qdoc", "createFlow", "README.md")
279+
val readme = File(readmePath.toUri())
280+
assertThat(readme).doesNotExist()
281+
282+
val result = executePuppeteerScript(newReadmeDiffViewerTestScript)
283+
assertThat(result)
284+
.doesNotContain("Error: Test Failed")
285+
286+
val panel = this.ui.x("//div[contains(@class, 'SimpleDiffPanel')]")
287+
assertThat(panel.present()).isTrue()
288+
}
289+
}
290+
249291
companion object {
250292
@JvmStatic
251293
@AfterAll
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
// Copyright 2025 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package software.aws.toolkits.jetbrains.uitests.docTests.createReadmeTests
5+
6+
import com.intellij.driver.sdk.ui.ui
7+
import com.intellij.driver.sdk.waitForProjectOpen
8+
import com.intellij.ide.starter.ci.CIServer
9+
import com.intellij.ide.starter.config.ConfigurationStorage
10+
import com.intellij.ide.starter.di.di
11+
import com.intellij.ide.starter.driver.engine.runIdeWithDriver
12+
import com.intellij.ide.starter.ide.IdeProductProvider
13+
import com.intellij.ide.starter.junit5.hyphenateWithClass
14+
import com.intellij.ide.starter.models.TestCase
15+
import com.intellij.ide.starter.project.LocalProjectInfo
16+
import com.intellij.ide.starter.runner.CurrentTestMethod
17+
import com.intellij.ide.starter.runner.Starter
18+
import org.assertj.core.api.Assertions.assertThat
19+
import org.junit.jupiter.api.AfterAll
20+
import org.junit.jupiter.api.BeforeAll
21+
import org.junit.jupiter.api.BeforeEach
22+
import org.junit.jupiter.api.Test
23+
import org.kodein.di.DI
24+
import org.kodein.di.bindSingleton
25+
import software.aws.toolkits.jetbrains.uitests.TestCIServer
26+
import software.aws.toolkits.jetbrains.uitests.clearAwsXmlFile
27+
import software.aws.toolkits.jetbrains.uitests.docTests.prepTestData
28+
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.acceptReadmeTestScript
29+
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.createReadmeSubFolderPostFolderChangeTestScript
30+
import software.aws.toolkits.jetbrains.uitests.docTests.scripts.createReadmeScripts.createReadmeSubFolderPreFolderChangeTestScript
31+
import software.aws.toolkits.jetbrains.uitests.executePuppeteerScript
32+
import software.aws.toolkits.jetbrains.uitests.setupTestEnvironment
33+
import software.aws.toolkits.jetbrains.uitests.useExistingConnectionForTest
34+
import java.awt.event.KeyEvent
35+
import java.io.File
36+
import java.nio.file.Path
37+
import java.nio.file.Paths
38+
39+
class CreateReadmeWorkspacesTest {
40+
init {
41+
di = DI {
42+
extend(di)
43+
bindSingleton<CIServer>(overrides = true) { TestCIServer }
44+
val defaults = ConfigurationStorage.instance().defaults.toMutableMap().apply {
45+
put("LOG_ENVIRONMENT_VARIABLES", (!System.getenv("CI").toBoolean()).toString())
46+
}
47+
48+
bindSingleton<ConfigurationStorage>(overrides = true) {
49+
ConfigurationStorage(this, defaults)
50+
}
51+
}
52+
}
53+
54+
@BeforeEach
55+
fun setUpTest() {
56+
// prep test data - remove readme if it exists
57+
prepTestData(true)
58+
}
59+
60+
@Test
61+
fun `Create readme with single-root workspace, root folder returns a readme`() {
62+
val testCase = TestCase(
63+
IdeProductProvider.IC,
64+
LocalProjectInfo(
65+
Paths.get("tstData", "qdoc", "createFlow")
66+
)
67+
).useRelease(System.getProperty("org.gradle.project.ideProfileName"))
68+
69+
// inject connection
70+
useExistingConnectionForTest()
71+
72+
Starter.newContext(CurrentTestMethod.hyphenateWithClass(), testCase).apply {
73+
System.getProperty("ui.test.plugins").split(File.pathSeparator).forEach { path ->
74+
pluginConfigurator.installPluginFromPath(
75+
Path.of(path)
76+
)
77+
}
78+
79+
copyExistingConfig(Paths.get("tstData", "configAmazonQTests"))
80+
updateGeneralSettings()
81+
}.runIdeWithDriver()
82+
.useDriverAndCloseIde {
83+
waitForProjectOpen()
84+
// required wait time for the system to be fully ready
85+
Thread.sleep(30000)
86+
87+
val readmePath = Paths.get("tstData", "qdoc", "createFlow", "README.md")
88+
val readme = File(readmePath.toUri())
89+
assertThat(readme).doesNotExist()
90+
91+
val result = executePuppeteerScript(acceptReadmeTestScript)
92+
assertThat(result)
93+
.doesNotContain("Error: Test Failed")
94+
95+
val newReadmePath = Paths.get("tstData", "qdoc", "createFlow", "README.md")
96+
val newReadme = File(newReadmePath.toUri())
97+
assertThat(newReadme)
98+
.exists()
99+
.content()
100+
.contains("REST", "API")
101+
}
102+
}
103+
104+
@Test
105+
fun `Create readme with single-root workspace, in a subfolder returns a readme`() {
106+
val testCase = TestCase(
107+
IdeProductProvider.IC,
108+
LocalProjectInfo(
109+
Paths.get("tstData", "qdoc", "createFlow")
110+
)
111+
).useRelease(System.getProperty("org.gradle.project.ideProfileName"))
112+
113+
// inject connection
114+
useExistingConnectionForTest()
115+
116+
Starter.newContext(CurrentTestMethod.hyphenateWithClass(), testCase).apply {
117+
System.getProperty("ui.test.plugins").split(File.pathSeparator).forEach { path ->
118+
pluginConfigurator.installPluginFromPath(
119+
Path.of(path)
120+
)
121+
}
122+
123+
copyExistingConfig(Paths.get("tstData", "configAmazonQTests"))
124+
updateGeneralSettings()
125+
}.runIdeWithDriver()
126+
.useDriverAndCloseIde {
127+
waitForProjectOpen()
128+
// required wait time for the system to be fully ready
129+
Thread.sleep(30000)
130+
131+
val readmePath = Paths.get("tstData", "qdoc", "createFlow", "src", "README.md")
132+
val readme = File(readmePath.toUri())
133+
assertThat(readme)
134+
.doesNotExist()
135+
136+
val result = executePuppeteerScript(createReadmeSubFolderPreFolderChangeTestScript)
137+
// Using keyboard press to select a subfolder based on a windows/linux folder selector
138+
// right to move active cursor to the end
139+
// enter src as the subfolder name (subfolder name tstData/qdoc/createFlow/src)
140+
// enter to confirm selected subfolder
141+
this.ui.robot.pressAndReleaseKey(KeyEvent.VK_RIGHT)
142+
this.ui.robot.enterText("\\/src")
143+
this.ui.robot.pressAndReleaseKey(KeyEvent.VK_ENTER)
144+
val result2 = executePuppeteerScript(createReadmeSubFolderPostFolderChangeTestScript)
145+
146+
assertThat(result)
147+
.doesNotContain("Error: Test Failed")
148+
assertThat(result2)
149+
.doesNotContain("Error: Test Failed")
150+
151+
val newReadmePath = Paths.get("tstData", "qdoc", "createFlow", "src", "README.md")
152+
val newReadme = File(newReadmePath.toUri())
153+
assertThat(newReadme)
154+
.exists()
155+
}
156+
}
157+
158+
@Test
159+
fun `Create readme with multi-root workspace returns a readme`() {
160+
val testCase = TestCase(
161+
IdeProductProvider.IC,
162+
LocalProjectInfo(
163+
Paths.get("tstData", "qdoc")
164+
)
165+
).useRelease(System.getProperty("org.gradle.project.ideProfileName"))
166+
167+
// inject connection
168+
useExistingConnectionForTest()
169+
170+
Starter.newContext(CurrentTestMethod.hyphenateWithClass(), testCase).apply {
171+
System.getProperty("ui.test.plugins").split(File.pathSeparator).forEach { path ->
172+
pluginConfigurator.installPluginFromPath(
173+
Path.of(path)
174+
)
175+
}
176+
177+
copyExistingConfig(Paths.get("tstData", "configAmazonQTests"))
178+
updateGeneralSettings()
179+
}.runIdeWithDriver()
180+
.useDriverAndCloseIde {
181+
waitForProjectOpen()
182+
// required wait time for the system to be fully ready
183+
Thread.sleep(30000)
184+
185+
val readmePath = Paths.get("tstData", "qdoc", "README.md")
186+
val readme = File(readmePath.toUri())
187+
assertThat(readme).doesNotExist()
188+
189+
val result = executePuppeteerScript(acceptReadmeTestScript)
190+
assertThat(result)
191+
.doesNotContain("Error: Test Failed")
192+
193+
val newReadmePath = Paths.get("tstData", "qdoc", "README.md")
194+
val newReadme = File(newReadmePath.toUri())
195+
assertThat(newReadme)
196+
.exists()
197+
.content()
198+
.contains(
199+
"REST",
200+
"API"
201+
)
202+
}
203+
}
204+
205+
companion object {
206+
@JvmStatic
207+
@AfterAll
208+
fun clearAwsXml() {
209+
clearAwsXmlFile()
210+
}
211+
212+
@JvmStatic
213+
@BeforeAll
214+
fun setUp() {
215+
// Setup test environment
216+
setupTestEnvironment()
217+
}
218+
}
219+
}

0 commit comments

Comments
 (0)