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

Move crosstests to unit tests #65

Merged
merged 20 commits into from
Aug 10, 2023
12 changes: 3 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $(BIN)/license-headers: Makefile

.PHONY: build
build: generate ## Build the entire project.
./gradlew build
./gradlew build -x test

.PHONY: buildplugin
buildplugin: ## Build the connect-kotlin protoc plugin.
Expand Down Expand Up @@ -50,17 +50,11 @@ crosstestserverstop: ## Stop the server for cross tests.
-docker container stop serverconnect servergrpc

.PHONY: crosstestsrun
crosstestsrun: crosstestsrunjava crosstestsrunjavalite ## Run the cross tests.
crosstestsrun: crosstestsrunjava ## Run the cross tests.

.PHONY: crosstestsrunjava
crosstestsrunjava: ## Run the cross tests for protoc-gen-java integration.
./gradlew crosstests:google-java:jar
java -jar ./crosstests/google-java/build/libs/google-java-crosstests.jar

.PHONY: crosstestsrunjavalite
crosstestsrunjavalite: ## Run the cross tests for protoc-gen-javalite integration.
./gradlew crosstests:google-javalite:jar
java -jar ./crosstests/google-javalite/build/libs/google-javalite-crosstests.jar
./gradlew test

.PHONY: generate
generate: buildplugin generatecrosstests generateexamples ## Generate proto files for the entire project.
Expand Down
20 changes: 5 additions & 15 deletions crosstests/google-java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,6 @@ tasks {
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
jar {
manifest {
attributes(mapOf("Main-Class" to "build.buf.connect.crosstest.Main"))
}
duplicatesStrategy = DuplicatesStrategy.INCLUDE
// This line of code recursively collects and copies all of a project's files
// and adds them to the JAR itself. One can extend this task, to skip certain
// files or particular types at will
val sourcesMain = sourceSets.main.get()
val contents = configurations.runtimeClasspath.get()
.map { if (it.isDirectory) it else zipTree(it) } +
sourcesMain.output
from(contents)
}
}

sourceSets {
Expand All @@ -41,8 +27,12 @@ dependencies {
implementation(libs.protobuf.kotlin)
implementation(project(":crosstests:common"))
implementation(project(":extensions:google-java"))

implementation(project(":okhttp"))

testImplementation(libs.junit)
testImplementation(libs.assertj)
testImplementation(libs.mockito)
testImplementation(libs.kotlin.coroutines.core)
}

configure<SpotlessExtension> {
Expand Down

This file was deleted.

Loading
Loading