Skip to content

Commit

Permalink
Merge pull request #5 from dinukaamarasinghe817/redis-client
Browse files Browse the repository at this point in the history
Fix PR build issues related to Redis
  • Loading branch information
dinukaamarasinghe817 authored Mar 15, 2024
2 parents 72a0211 + a1073c7 commit c54e923
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 43 deletions.
44 changes: 7 additions & 37 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -371,17 +371,8 @@ def checkRedisTestDockerContainerStatus(containerName) {
return 1;
}
} else {
def standardOutput = new ByteArrayOutputStream()
def commandLine = "docker exec ${containerName} redis-cli"
def proc = commandLine.execute()
proc.waitForProcessOutput(standardOutput, System.err)
def exitCode = proc.exitValue()
if (exitCode != 0) {
println('\n' + "Windows Instance detected")
println('\n' + "Skipped checking status of the Redis docker container")
return 1
}
return 0
commandLine 'cmd','slmgr /dlv'
println('\n' + "Windows Instance detected")
}
}

Expand Down Expand Up @@ -427,21 +418,9 @@ task startTestRedisContainer(type: Exec) {
}
}
} else {
def standardOutput = new ByteArrayOutputStream()
commandLine 'cmd', '/c', 'docker run --rm -d --name persist-redis -p 6379:6379 redis:latest'
def healthCheck = 1
def counter = 0
doLast {
checkExecResult(executionResult, 'Error', standardOutput)
while (healthCheck != 0 && counter < 12) {
sleep(30 * 1000)
healthCheck = checkRedisTestDockerContainerStatus('persist-redis')
counter = counter + 1
}
if (healthCheck != 0) {
throw new GradleException("Docker container 'persist-redis' health test exceeded timeout!")
}
}
commandLine 'cmd','slmgr /dlv'
println('\n' + "Windows Instance detected")
println('\n' + "skippped starting the docker container")
}
}

Expand Down Expand Up @@ -473,16 +452,6 @@ task stopTestRedisContainer() {
} catch (all) {
println('Gradle process can safely ignore stopTestRedisContainer task')
}
} else {
try {
def stdOut = new ByteArrayOutputStream()
exec {
commandLine 'cmd', '/c', 'docker stop persist-redis'
standardOutput = stdOut
}
} catch (all) {
println('Gradle process can safely ignore stopTestRedisContainer task')
}
}
}
}
Expand Down Expand Up @@ -601,7 +570,8 @@ task testRedisDBExamples {
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine 'sh', '-c', "${ballerinaDist}/bin/bal test"
} else {
commandLine 'cmd', '/c', "${ballerinaDist}/bin/bal.bat test"
commandLine 'cmd','slmgr /dlv'
println('\n' + "Windows Instance detected")
}
}
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ distribution = "2201.9.0-20240118-000800-7398ff0b"
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
groupId = "io.ballerina.lib"
artifactId = "persist.redis-native"
version = "0.1.0-SNAPSHOT"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ distribution = "2201.9.0-20240118-000800-7398ff0b"
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
groupId = "io.ballerina.lib"
artifactId = "persist.redis-native"
version = "0.1.0-SNAPSHOT"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ distribution = "2201.9.0-20240118-000800-7398ff0b"
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
groupId = "io.ballerina.lib"
artifactId = "persist.redis-native"
version = "0.1.0-SNAPSHOT"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ distribution = "2201.9.0-20240118-000800-7398ff0b"
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
groupId = "io.ballerina.lib"
artifactId = "persist.redis-native"
version = "0.1.0-SNAPSHOT"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ distribution = "2201.9.0-20240118-000800-7398ff0b"
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
groupId = "io.ballerina.lib"
artifactId = "persist.redis-native"
version = "0.1.0-SNAPSHOT"
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ distribution = "2201.9.0-20240118-000800-7398ff0b"
observabilityIncluded = false

[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
groupId = "io.ballerina.lib"
artifactId = "persist.redis-native"
version = "0.1.0-SNAPSHOT"

0 comments on commit c54e923

Please sign in to comment.