Skip to content

Commit 477d6ec

Browse files
committed
fix: non-code files needed at runtime should be under resources/ folder
- in Java/Kotlin, the resources folder is a directory used to store non-code files that are needed by an application at runtime. - in Maven/Gradle world, the resources folder is typically located under: * src/main/resources/ * src/test/resources/
1 parent 142a587 commit 477d6ec

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+10
-10
lines changed

src/test/kotlin/com/coder/toolbox/cli/CoderCLIManagerTest.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,15 @@ internal class CoderCLIManagerTest {
455455
if (it.input != null) {
456456
settings.sshConfigPath.parent.toFile().mkdirs()
457457
val originalConf =
458-
Path.of("src/test/fixtures/inputs").resolve(it.input + ".conf").toFile().readText()
458+
Path.of("src/test/resources/fixtures/inputs").resolve(it.input + ".conf").toFile().readText()
459459
.replace(newlineRe, System.lineSeparator())
460460
settings.sshConfigPath.toFile().writeText(originalConf)
461461
}
462462

463463
// Output is the configuration we expect to have after configuring.
464464
val coderConfigPath = ccm.localBinaryPath.parent.resolve("config")
465465
val expectedConf =
466-
Path.of("src/test/fixtures/outputs/").resolve(it.output + ".conf").toFile().readText()
466+
Path.of("src/test/resources/fixtures/outputs/").resolve(it.output + ".conf").toFile().readText()
467467
.replace(newlineRe, System.lineSeparator())
468468
.replace("/tmp/coder-toolbox/test.coder.invalid/config", escape(coderConfigPath.toString()))
469469
.replace(
@@ -494,7 +494,7 @@ internal class CoderCLIManagerTest {
494494
// Remove is the configuration we expect after removing.
495495
assertEquals(
496496
settings.sshConfigPath.toFile().readText(),
497-
Path.of("src/test/fixtures/inputs").resolve(it.remove + ".conf").toFile()
497+
Path.of("src/test/resources/fixtures/inputs").resolve(it.remove + ".conf").toFile()
498498
.readText().replace(newlineRe, System.lineSeparator()),
499499
)
500500
}
@@ -518,7 +518,7 @@ internal class CoderCLIManagerTest {
518518
sshConfigPath = tmpdir.resolve("configured$it.conf"),
519519
)
520520
settings.sshConfigPath.parent.toFile().mkdirs()
521-
Path.of("src/test/fixtures/inputs").resolve("$it.conf").toFile().copyTo(
521+
Path.of("src/test/resources/fixtures/inputs").resolve("$it.conf").toFile().copyTo(
522522
settings.sshConfigPath.toFile(),
523523
true,
524524
)

src/test/kotlin/com/coder/toolbox/sdk/CoderRestClientTest.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ class CoderRestClientTest {
117117
val srv = HttpsServer.create(InetSocketAddress(0), 0)
118118
val sslContext =
119119
sslContextFromPEMs(
120-
Path.of("src/test/fixtures/tls", "$certName.crt").toString(),
121-
Path.of("src/test/fixtures/tls", "$certName.key").toString(),
120+
Path.of("src/test/resources/fixtures/tls", "$certName.crt").toString(),
121+
Path.of("src/test/resources/fixtures/tls", "$certName.key").toString(),
122122
"",
123123
)
124124
srv.httpsConfigurator = HttpsConfigurator(sslContext)
@@ -431,7 +431,7 @@ class CoderRestClientTest {
431431
val settings =
432432
CoderSettings(
433433
CoderSettingsState(
434-
tlsCAPath = Path.of("src/test/fixtures/tls", "self-signed.crt").toString(),
434+
tlsCAPath = Path.of("src/test/resources/fixtures/tls", "self-signed.crt").toString(),
435435
tlsAlternateHostname = "localhost",
436436
),
437437
context.logger
@@ -458,7 +458,7 @@ class CoderRestClientTest {
458458
val settings =
459459
CoderSettings(
460460
CoderSettingsState(
461-
tlsCAPath = Path.of("src/test/fixtures/tls", "self-signed.crt").toString(),
461+
tlsCAPath = Path.of("src/test/resources/fixtures/tls", "self-signed.crt").toString(),
462462
tlsAlternateHostname = "fake.example.com",
463463
),
464464
context.logger
@@ -479,7 +479,7 @@ class CoderRestClientTest {
479479
val settings =
480480
CoderSettings(
481481
CoderSettingsState(
482-
tlsCAPath = Path.of("src/test/fixtures/tls", "self-signed.crt").toString(),
482+
tlsCAPath = Path.of("src/test/resources/fixtures/tls", "self-signed.crt").toString(),
483483
),
484484
context.logger
485485
)
@@ -499,7 +499,7 @@ class CoderRestClientTest {
499499
val settings =
500500
CoderSettings(
501501
CoderSettingsState(
502-
tlsCAPath = Path.of("src/test/fixtures/tls", "chain-root.crt").toString(),
502+
tlsCAPath = Path.of("src/test/resources/fixtures/tls", "chain-root.crt").toString(),
503503
),
504504
context.logger
505505
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)