Skip to content

Commit 8812bc4

Browse files
committed
Enable Rider tests with 193 SDK
* Switch to 2019.3 SDK to verify Rider tests works (Rider tests run on local environment is available in 193 SDK only) * Update travis and Amazon configuration to set the env variable
1 parent 9530e0c commit 8812bc4

File tree

11 files changed

+54
-30
lines changed

11 files changed

+54
-30
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
language: java
22
install: true
33

4+
env:
5+
global:
6+
- LOCAL_ENV_RUN=true
7+
48
matrix:
59
include:
610
- os: linux

buildspec/linuxTests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ cache:
88
env:
99
variables:
1010
CI: true
11+
LOCAL_ENV_RUN: true
1112

1213
phases:
1314
install:

buildspec/windowsTests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: 0.2
33
env:
44
variables:
55
CI: true
6+
LOCAL_ENV_RUN: true
67

78
phases:
89
install:

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ publishToken=
99
publishChannel=
1010

1111
# Common dependencies
12-
ideProfileName=2019.2
12+
ideProfileName=2019.3
1313
kotlinVersion=1.3.21
1414
awsSdkVersion=2.6.5
1515
ideaPluginVersion=0.4.9

intellijJVersions.gradle

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ static def ideProfiles() {
7878
version: "IC-193-EAP-SNAPSHOT",
7979
plugins: [
8080
"yaml",
81-
"PythonCore:193.3793.14",
81+
"PythonCore:193.4386.10",
8282
"java",
8383
"gradle",
8484
"maven",
@@ -88,12 +88,18 @@ static def ideProfiles() {
8888
"IU": [
8989
version: "IU-193-EAP-SNAPSHOT",
9090
plugins: [
91-
"PythonCore:193.3793.14",
91+
"PythonCore:193.4386.10",
9292
"yaml",
9393
"JavaScriptLanguage",
9494
"JavaScriptDebugger",
9595
"CSS",
9696
]
97+
],
98+
"RD": [
99+
version: "RD-2019.3-SNAPSHOT",
100+
plugins: [
101+
"yaml"
102+
]
97103
]
98104
]
99105
]

jetbrains-core/src/software/aws/toolkits/jetbrains/ui/RegionSelector.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class RegionSelector : ComboBox<AwsRegion>() {
4343

4444
private inner class Renderer : SimpleListCellRenderer<AwsRegion>() {
4545
override fun customize(
46-
list: JList<out AwsRegion>?,
46+
list: JList<out AwsRegion>,
4747
value: AwsRegion?,
4848
index: Int,
4949
selected: Boolean,

jetbrains-rider/build.gradle

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,38 @@ compileKotlin.dependsOn(generateModel)
7979

8080
test {
8181
useTestNG()
82+
println("Configuring Rider tests. Environment variable LOCAL_ENV_RUN: ${System.getenv("LOCAL_ENV_RUN")}")
83+
84+
def compare = compareVersions(ideProfileName, "2019.3")
85+
if (compare == -1) {
86+
println("Current SDK version: ${ideProfileName}. Rider tests require 193 SDK or higher. Exclude Rider tests.")
87+
def testClassToExclude = [ "DotNetLambdaHandlerResolverTest",
88+
"LambdaGutterMarkHighlightingTest",
89+
"DotNetLocalLambdaRunConfigurationTest",
90+
"DotNetHandlerCompletionTest" ]
91+
92+
testClassToExclude.forEach { classToExclude ->
93+
exclude "**/${classToExclude}.class"
94+
}
95+
}
96+
}
97+
98+
private static int compareVersions(String version, String withVersion) {
99+
List versionList = version.tokenize('.')
100+
List withVersionList = withVersion.tokenize('.')
82101

83-
// TODO: Disable Rider tests until switching to 2019.3 SDK.
84-
// Please see https://youtrack.jetbrains.com/issue/RIDER-19506.
85-
def testClassToExclude = [ "DotNetLambdaHandlerResolverTest",
86-
"LambdaGutterMarkHighlightingTest",
87-
"DotNetLocalLambdaRunConfigurationTest",
88-
"DotNetHandlerCompletionTest" ]
102+
def minIndices = Math.min(versionList.size(), withVersionList.size())
89103

90-
testClassToExclude.forEach { classToExclude ->
91-
exclude "**/${classToExclude}.class"
104+
for (int i = 0; i < minIndices; i++) {
105+
def partInt = versionList[i].toInteger()
106+
def withPartInt = withVersionList[i].toInteger()
107+
108+
if (partInt != withPartInt) {
109+
return partInt <=> withPartInt
110+
}
92111
}
112+
113+
return 0
93114
}
94115

95116
runIde {

jetbrains-rider/src/software/aws/toolkits/jetbrains/icons/RiderAwsIconsPatcher.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,10 @@ internal class RiderAwsIconsPatcher : IconPathPatcher() {
3333
}
3434
}
3535

36-
override fun patchPath(path: String?, classLoader: ClassLoader?): String? =
37-
if (path != null) myIconsOverrideMap[path] else null
36+
override fun patchPath(path: String, classLoader: ClassLoader?): String? = myIconsOverrideMap[path]
3837

39-
override fun getContextClassLoader(path: String?, originalClassLoader: ClassLoader?): ClassLoader? =
40-
if (path != null && myIconsOverrideMap.containsKey(path)) javaClass.classLoader
38+
override fun getContextClassLoader(path: String, originalClassLoader: ClassLoader?): ClassLoader? =
39+
if (myIconsOverrideMap.containsKey(path)) javaClass.classLoader
4140
else originalClassLoader
4241

4342
private val myIconsOverrideMap = mapOf(

jetbrains-rider/src/software/aws/toolkits/jetbrains/services/lambda/dotnet/DotNetSamDebugSupport.kt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import com.intellij.execution.process.ProcessAdapter
1010
import com.intellij.execution.process.ProcessEvent
1111
import com.intellij.execution.process.ProcessHandler
1212
import com.intellij.execution.runners.ExecutionEnvironment
13-
import com.intellij.execution.ui.ConsoleView
14-
import com.intellij.execution.ui.ConsoleViewContentType
1513
import com.intellij.execution.ui.ExecutionConsole
1614
import com.intellij.openapi.rd.defineNestedLifetime
1715
import com.intellij.xdebugger.XDebugProcess
@@ -40,7 +38,6 @@ import com.jetbrains.rider.model.debuggerWorker.DotNetCoreInfo
4038
import com.jetbrains.rider.model.debuggerWorker.DotNetDebuggerSessionModel
4139
import com.jetbrains.rider.model.debuggerWorkerConnectionHelperModel
4240
import com.jetbrains.rider.projectView.solution
43-
import com.jetbrains.rider.run.ConsoleKind
4441
import com.jetbrains.rider.run.IDebuggerOutputListener
4542
import com.jetbrains.rider.run.bindToSettings
4643
import org.jetbrains.concurrency.AsyncPromise
@@ -280,12 +277,6 @@ class DotNetSamDebugSupport : SamDebugSupport {
280277
sessionModel: DotNetDebuggerSessionModel,
281278
outputEventsListener: IDebuggerOutputListener
282279
): XDebugProcessStarter {
283-
val consoleKind = ConsoleKind.ExternalConsole
284-
(executionConsole as? ConsoleView)
285-
?.print(
286-
"Input/Output redirection disabled: ${consoleKind.message}${System.lineSeparator()}",
287-
ConsoleViewContentType.SYSTEM_OUTPUT
288-
)
289280

290281
val fireInitializedManually = env.getUserData(DotNetDebugRunner.FIRE_INITIALIZED_MANUALLY) ?: false
291282

@@ -301,7 +292,8 @@ class DotNetSamDebugSupport : SamDebugSupport {
301292
fireInitializedManually = fireInitializedManually,
302293
customListener = outputEventsListener,
303294
debugKind = OptionsUtil.toDebugKind(sessionModel.sessionProperties.debugKind.valueOrNull),
304-
project = env.project)
295+
project = env.project,
296+
sessionId = env.executionId)
305297
}
306298
}
307299
}

jetbrains-rider/tst/software/aws/toolkits/jetbrains/services/lambda/completion/DotNetHandlerCompletionTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ class DotNetHandlerCompletionTest : BaseTestWithSolution() {
4141
@Test
4242
@TestEnvironment(solution = "SamMultipleHandlersApp")
4343
fun testDetermineHandlers_MultipleHandlers() {
44-
val handlers = project.solution.lambdaModel.determineHandlers.sync(Unit, RpcTimeouts.default)
44+
val handlers = project.solution.lambdaModel.determineHandlers.sync(Unit, RpcTimeouts.default).sortedBy { it.handler }
4545

4646
assertThat(handlers.size).isEqualTo(2)
4747

48-
assertThat(handlers[0].handler).isEqualTo("HelloWorld::HelloWorld.Function::FunctionHandler")
48+
assertThat(handlers[0].handler).isEqualTo("HelloWorld::HelloWorld.Function2::FunctionHandler2")
4949
assertIconPath(handlers[0].iconId, "/resharper/PsiSymbols/Method.svg")
5050

51-
assertThat(handlers[1].handler).isEqualTo("HelloWorld::HelloWorld.Function2::FunctionHandler2")
51+
assertThat(handlers[1].handler).isEqualTo("HelloWorld::HelloWorld.Function::FunctionHandler")
5252
assertIconPath(handlers[1].iconId, "/resharper/PsiSymbols/Method.svg")
5353
}
5454

0 commit comments

Comments
 (0)