Skip to content

Commit 3f6b265

Browse files
author
Hamed Soleimani
committed
fix test failures on windows
1 parent efa81d3 commit 3f6b265

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
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" : "Amazon Q can update mvn and gradle build files"
4+
}

plugins/amazonq/codewhisperer/jetbrains-community/tst/software/aws/toolkits/jetbrains/services/codewhisperer/codescan/CodeWhispererProjectCodeScanTest.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
113113
val testModule2 = projectRule.fixture.addModule("testModule2")
114114
testCs = projectRule.fixture.addFileToModule(
115115
testModule,
116-
"Test.cs",
116+
"/Test.cs",
117117
"""
118118
using Utils;
119119
using Helpers.Helper;
@@ -131,7 +131,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
131131

132132
utilsCs = projectRule.fixture.addFileToModule(
133133
testModule,
134-
"Utils.cs",
134+
"/Utils.cs",
135135
"""
136136
public static class Utils
137137
{
@@ -157,7 +157,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
157157

158158
helperCs = projectRule.fixture.addFileToModule(
159159
testModule,
160-
"Helpers/Helper.cs",
160+
"/Helpers/Helper.cs",
161161
"""
162162
public static class Helper
163163
{
@@ -201,7 +201,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
201201

202202
helpGo = projectRule.fixture.addFileToModule(
203203
testModule,
204-
"help.go",
204+
"/help.go",
205205
"""
206206
package main
207207
@@ -217,7 +217,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
217217

218218
utilsJs = projectRule.fixture.addFileToModule(
219219
testModule,
220-
"utils.js",
220+
"/utils.js",
221221
"""
222222
function add(num1, num2) {
223223
return num1 + num2;
@@ -247,7 +247,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
247247

248248
testJson = projectRule.fixture.addFileToModule(
249249
testModule,
250-
"helpers/test3Json.json",
250+
"/helpers/test3Json.json",
251251
"""
252252
{
253253
"AWSTemplateFormatVersion": "2010-09-09",
@@ -303,7 +303,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
303303

304304
helperPy = projectRule.fixture.addFileToModule(
305305
testModule,
306-
"helpers/helper.py",
306+
"/helpers/helper.py",
307307
"""
308308
from helpers import helper as h
309309
def subtract(num1, num2)
@@ -319,13 +319,13 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
319319
totalSize += helperPy.length
320320
totalLines += helperPy.toNioPath().toFile().readLines().size
321321

322-
readMeMd = projectRule.fixture.addFileToModule(testModule, "ReadMe.md", "### Now included").virtualFile
322+
readMeMd = projectRule.fixture.addFileToModule(testModule, "/ReadMe.md", "### Now included").virtualFile
323323
totalSize += readMeMd.length
324324
totalLines += readMeMd.toNioPath().toFile().readLines().size
325325

326326
testTf = projectRule.fixture.addFileToModule(
327327
testModule2,
328-
"testTf.tf",
328+
"/testTf.tf",
329329
"""
330330
# Create example resource for three S3 buckets using for_each, where the bucket prefix are in variable with list containing [prod, staging, dev]
331331
@@ -345,7 +345,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
345345

346346
testYaml = projectRule.fixture.addFileToModule(
347347
testModule2,
348-
"testYaml.yaml",
348+
"/testYaml.yaml",
349349
"""
350350
AWSTemplateFormatVersion: "2010-09-09"
351351
@@ -371,7 +371,7 @@ class CodeWhispererProjectCodeScanTest : CodeWhispererCodeScanTestBase(PythonCod
371371

372372
// Adding gitignore file and gitignore file member for testing.
373373
// The tests include the markdown file but not these two files.
374-
projectRule.fixture.addFileToProject(".gitignore", "node_modules\n.idea\n.vscode\n.DS_Store").virtualFile
375-
projectRule.fixture.addFileToProject(".idea/ref", "ref: refs/heads/main")
374+
projectRule.fixture.addFileToProject("/.gitignore", "node_modules\n.idea\n.vscode\n.DS_Store").virtualFile
375+
projectRule.fixture.addFileToProject("/.idea/ref", "ref: refs/heads/main")
376376
}
377377
}

plugins/core/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/FeatureDevSessionContext.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ class FeatureDevSessionContext(val project: Project, val maxProjectSizeBytes: Lo
124124
private fun ignoreFileByExtension(file: VirtualFile) =
125125
!isFileExtensionAllowed(file)
126126

127-
suspend fun ignoreFile(file: VirtualFile): Boolean = ignoreFile(file.path)
127+
suspend fun ignoreFile(file: VirtualFile): Boolean = ignoreFile(file.presentableUrl)
128128

129129
suspend fun ignoreFile(path: String): Boolean {
130130
// this method reads like something a JS dev would write and doesn't do what the author thinks

0 commit comments

Comments
 (0)