Skip to content

Commit

Permalink
build: update gradle plugin failure tests to use version catalog (#1659)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariuszkuc authored Jan 26, 2023
1 parent 00b1731 commit 0540730
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLGenerateClientTask

@Suppress("DSL_SCOPE_VIOLATION") // TODO: remove once KTIJ-19369 / Gradle#22797 is fi
plugins {
id("com.expediagroup.graphql")
kotlin("jvm") version "1.7.21"
alias(libs.plugins.kotlin.jvm)
}

repositories {
Expand All @@ -16,7 +17,7 @@ repositories {

dependencies {
implementation("com.expediagroup:graphql-kotlin-spring-client")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.21")
implementation(libs.kotlin.stdlib)
}

val graphqlGenerateClient by tasks.getting(GraphQLGenerateClientTask::class) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import com.expediagroup.graphql.plugin.gradle.config.TimeoutConfiguration
import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLDownloadSDLTask

@Suppress("DSL_SCOPE_VIOLATION") // TODO: remove once KTIJ-19369 / Gradle#22797 is fi
plugins {
id("com.expediagroup.graphql")
kotlin("jvm") version "1.7.21"
alias(libs.plugins.kotlin.jvm)
}

repositories {
Expand All @@ -17,7 +18,7 @@ repositories {

dependencies {
implementation("com.expediagroup:graphql-kotlin-spring-client")
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.21")
implementation(libs.kotlin.stdlib)
}

val serverUrl = System.getenv("wireMockServerUrl") ?: System.getProperty("wireMockServerUrl")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import com.expediagroup.graphql.plugin.gradle.config.TimeoutConfiguration
import com.expediagroup.graphql.plugin.gradle.tasks.GraphQLIntrospectSchemaTask

@Suppress("DSL_SCOPE_VIOLATION") // TODO: remove once KTIJ-19369 / Gradle#22797 is fi
plugins {
kotlin("jvm") version "1.7.21"
id("com.expediagroup.graphql")
id("com.expediagroup.graphql")
alias(libs.plugins.kotlin.jvm)
}

repositories {
mavenCentral()
mavenLocal {
content {
includeGroup("com.expediagroup")
mavenCentral()
mavenLocal {
content {
includeGroup("com.expediagroup")
}
}
}
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.21")
implementation("com.expediagroup:graphql-kotlin-spring-client")
implementation("com.expediagroup:graphql-kotlin-spring-client")
implementation(libs.kotlin.stdlib)
}

val serverUrl = System.getenv("wireMockServerUrl") ?: System.getProperty("wireMockServerUrl")
val graphqlIntrospectSchema by tasks.getting(GraphQLIntrospectSchemaTask::class) {
endpoint.set("$serverUrl/graphql")
timeoutConfig.set(com.expediagroup.graphql.plugin.gradle.config.TimeoutConfiguration(connect = 100, read = 100))
endpoint.set("$serverUrl/graphql")
timeoutConfig.set(com.expediagroup.graphql.plugin.gradle.config.TimeoutConfiguration(connect = 100, read = 100))
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class GraphQLDownloadSDLTaskIT : WireMockAbstractIT() {
val sourceDirectory = File("src/integration/download-sdl-timeout")
sourceDirectory.copyRecursively(testProjectDirectory)

// version catalog setup
File("../../gradle/libs.versions.toml").copyTo(File(testProjectDirectory, "gradle/libs.versions.toml"))

WireMock.reset()
WireMock.stubFor(stubSdlEndpoint(delay = 10_000))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ class GraphQLGenerateClientTaskIT : WireMockAbstractIT() {
val sourceDirectory = File("src/integration/download-sdl-timeout")
sourceDirectory.copyRecursively(testProjectDirectory)

// version catalog setup
File("../../gradle/libs.versions.toml").copyTo(File(testProjectDirectory, "gradle/libs.versions.toml"))

val buildResult = GradleRunner.create()
.withProjectDir(testProjectDirectory)
.withPluginClasspath()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class GraphQLIntrospectSchemaTaskIT : WireMockAbstractIT() {
val sourceDirectory = File("src/integration/introspection-timeout")
sourceDirectory.copyRecursively(testProjectDirectory)

// version catalog setup
File("../../gradle/libs.versions.toml").copyTo(File(testProjectDirectory, "gradle/libs.versions.toml"))

WireMock.reset()
WireMock.stubFor(stubIntrospectionResult(delay = 10_000))

Expand Down

0 comments on commit 0540730

Please sign in to comment.