Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add more debug info regarding DDB Local ports #1482

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions hll/dynamodb-mapper/dynamodb-mapper/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,21 @@ open class DynamoDbLocalInstance : DefaultTask() {
.createServerFromCommandLineArgs(arrayOf("-inMemory", "-port", port.toString(), "-disableTelemetry"))
.also { it.start() }

portFile.asFile.get().writeText(port.toString())
portFile
.asFile
.get()
.also { println("Writing port info file to ${it.absolutePath} ") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: stray space at the end

.writeText(port.toString())
}

fun stop() {
runCatching { portFile.asFile.get().delete() }.onFailure { t -> println("Failed to delete $portFile: $t") }
runCatching {
portFile
.asFile
.get()
.also { println("Deleting port info file at ${it.absolutePath}") }
.delete()
}.onFailure { t -> println("Failed to delete $portFile: $t") }

runner?.let {
println("Stopping DynamoDB local instance on port $port")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ abstract class DdbLocalTest : AnnotationSpec() {

private val ddbHolder = lazy {
val portFile = File("build/ddblocal/port.info").absoluteFile // Keep in sync with build.gradle.kts
println("Reading DDB Local port info from ${portFile.absolutePath}")
val port = portFile.readText().toInt()
println("Connecting to DDB Local on port $port")

DynamoDbClient {
endpointUrl = Url {
Expand Down
Loading