Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5a21122

Browse filesBrowse files
committed
wow - got logging working by removing the gradleTestKit thing
1 parent 90b70bf commit 5a21122
Copy full SHA for 5a21122

File tree

Expand file treeCollapse file tree

8 files changed

+34
-12
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+34
-12
lines changed

‎build.gradle.kts

Copy file name to clipboardExpand all lines: build.gradle.kts
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ subprojects {
3939
group = rootProject.group
4040
version = rootProject.version
4141

42-
repositories {
43-
mavenCentral()
44-
}
45-
4642
tasks.withType<JavaCompile> {
4743
sourceCompatibility = JavaVersion.VERSION_1_8.toString()
4844
targetCompatibility = JavaVersion.VERSION_1_8.toString()

‎examples/build.gradle.kts

Copy file name to clipboardExpand all lines: examples/build.gradle.kts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ subprojects {
2020
}
2121

2222
tasks.create("assemble").dependsOn(":server:installDist")
23+

‎examples/gradle/wrapper/gradle-wrapper.properties

Copy file name to clipboardExpand all lines: examples/gradle/wrapper/gradle-wrapper.properties
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

‎gradle/libs.versions.toml

Copy file name to clipboardExpand all lines: gradle/libs.versions.toml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ truth-proto-extension = { group = "com.google.truth.extensions", name = "truth-p
3636
okhttp = { group = "com.squareup.okhttp", name = "okhttp", version = "2.7.5" }
3737
javax-annotation-api = { group = "javax.annotation", name = "javax.annotation-api", version = "1.3.2" }
3838
testcontainers = { group = "org.testcontainers", name = "testcontainers", version = "1.19.6" }
39+
slf4j-simple = { group = "org.slf4j", name = "slf4j-simple", version = "2.0.12" }

‎gradle/wrapper/gradle-wrapper.properties

Copy file name to clipboardExpand all lines: gradle/wrapper/gradle-wrapper.properties
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

‎integration_testing/build.gradle.kts

Copy file name to clipboardExpand all lines: integration_testing/build.gradle.kts
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ kotlin {
1010
}
1111

1212
dependencies {
13-
testImplementation(gradleTestKit())
1413
testImplementation(libs.testcontainers)
14+
testImplementation("org.gradle:gradle-test-kit:6.1")
15+
testImplementation("org.gradle:gradle-test-kit:6.1")
16+
testImplementation("commons-io:commons-io:2.15.1")
17+
testImplementation("org.gradle:gradle-tooling-api:8.6")
1518
testImplementation(libs.junit.jupiter)
1619
testRuntimeOnly(libs.junit.platform.launcher)
20+
testRuntimeOnly(libs.slf4j.simple)
1721
}
1822

1923
tasks.named<Test>("test") {
@@ -27,7 +31,7 @@ tasks.named<Test>("test") {
2731
testLogging {
2832
showStandardStreams = true
2933
exceptionFormat = TestExceptionFormat.FULL
30-
events(TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
34+
events(TestLogEvent.STANDARD_OUT, TestLogEvent.STANDARD_ERROR, TestLogEvent.STARTED, TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED)
3135
}
3236

3337
retry {
@@ -48,4 +52,4 @@ tasks.named<Test>("test") {
4852
*/
4953

5054
// todo: cleanup copyExamples.destinationDir or move copy to tests
51-
}
55+
}

‎integration_testing/src/test/kotlin/io/grpc/kotlin/ExamplesTest.kt

Copy file name to clipboardExpand all lines: integration_testing/src/test/kotlin/io/grpc/kotlin/ExamplesTest.kt
+15-3Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
package io.grpc.kotlin
22

3-
import org.gradle.internal.impldep.org.apache.commons.io.FileUtils
3+
import org.apache.commons.io.FileUtils
44
import org.gradle.testkit.runner.GradleRunner
55
import org.junit.jupiter.api.Assertions.assertTrue
66
import org.junit.jupiter.api.Test
77
import org.junit.jupiter.api.io.TempDir
88
import org.testcontainers.containers.GenericContainer
99
import org.testcontainers.containers.wait.strategy.Wait
1010
import java.io.File
11+
import java.net.URI
1112
import java.nio.file.Path
13+
import java.util.Properties
14+
import kotlin.io.path.div
15+
import kotlin.io.path.inputStream
16+
1217

1318
class ExamplesTest {
1419

@@ -50,16 +55,22 @@ class ExamplesTest {
5055
}
5156
settingsGradle.writeText(settingsGradleNewLines.joinToString("\n"))
5257

58+
val gradleWrapperProperties = Properties()
59+
gradleWrapperProperties.load((tempDir / "gradle/wrapper/gradle-wrapper.properties").inputStream())
60+
val distributionUrl = URI.create(gradleWrapperProperties.getProperty("distributionUrl"))
61+
5362
val dependencyResult = GradleRunner.create()
5463
.withProjectDir(tempDir.toFile())
5564
.withArguments(":stub:dependencies")
65+
.withGradleDistribution(distributionUrl)
5666
.build()
5767

5868
assertTrue(dependencyResult.output.contains("io.grpc:grpc-kotlin-stub:$grpcKotlinVersion"))
5969

6070
GradleRunner.create()
6171
.withProjectDir(tempDir.toFile())
6272
.withArguments(":server:jibDockerBuild", "--image=grpc-kotlin-examples-server")
73+
.withGradleDistribution(distributionUrl)
6374
.build()
6475

6576
val container = GenericContainer("grpc-kotlin-examples-server")
@@ -70,11 +81,12 @@ class ExamplesTest {
7081

7182
val clientResult = GradleRunner.create()
7283
.withProjectDir(tempDir.toFile())
73-
.withEnvironment(mapOf("PORT" to container.getFirstMappedPort().toString()))
84+
.withEnvironment(mapOf("PORT" to container.firstMappedPort.toString()))
7485
.withArguments(":client:HelloWorldClient")
86+
.withGradleDistribution(distributionUrl)
7587
.build()
7688

7789
assertTrue(clientResult.output.contains("Received: Hello world"))
7890
}
7991

80-
}
92+
}

‎settings.gradle.kts

Copy file name to clipboard
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
rootProject.name = "grpc-kotlin"
22

33
include("stub", "compiler", "interop_testing", "integration_testing")
4+
5+
dependencyResolutionManagement {
6+
@Suppress("UnstableApiUsage")
7+
repositories {
8+
mavenCentral()
9+
maven("https://repo.gradle.org/gradle/libs-releases")
10+
}
11+
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.