Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into updateJava
Browse files Browse the repository at this point in the history
  • Loading branch information
imanushin committed Dec 12, 2023
2 parents 05e1b25 + 6d06863 commit 73d82bd
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ subprojects {
plugins.withId("org.jetbrains.dokka") {

dependencies {
"dokkaJavadocPlugin"("org.jetbrains.dokka:kotlin-as-java-plugin:$embeddedKotlinVersion")
"dokkaJavadocPlugin"("org.jetbrains.dokka:kotlin-as-java-plugin:${libs.versions.dokka.get()}")
}

// have an option to disable Dokka task for local builds
Expand Down
27 changes: 15 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
[versions]
dokka = "1.8.20"
dokka = "1.9.10"
spek = "2.0.19"
unbrokenDome = "0.5.0"
okhttp = "4.11.0"
jackson = "2.15.2"
jackson = "2.16.0"
# No need to keep the same Kotlin version with Gradle, at least because kotlin runtime is a transitive dependency of okhttp
kotlin = "1.8.21"
junit = "5.9.3"
kotlin = "1.9.21"
junit = "5.10.1"

[libraries]
snakeyaml = "org.yaml:snakeyaml:2.0"
assertk = "com.willowtreeapps.assertk:assertk-jvm:0.26.1"
snakeyaml = "org.yaml:snakeyaml:2.2"
assertk = "com.willowtreeapps.assertk:assertk-jvm:0.28.0"
# version 1.13.8 doesn't work because of JVM 11 bytecode despite of https://github.com/mockk/mockk/pull/1161
mockk = "io.mockk:mockk:1.13.5"
tabbedCodeExtension = "com.bmuschko:asciidoctorj-tabbed-code-extension:0.3"
orgJson = "org.json:json:20230227"
orgJson = "org.json:json:20231013"
jsonPath = "com.jayway.jsonpath:json-path:2.8.0"
kotestAssertions = "io.kotest:kotest-assertions-core:5.6.2"
kotestAssertions = "io.kotest:kotest-assertions-core:5.8.0"
jacksonDataBind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
jacksonDataFormatYaml = { module = "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml", version.ref = "jackson" }
okHttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
Expand All @@ -27,14 +28,16 @@ spekDsl = { module = "org.spekframework.spek2:spek-dsl-jvm", version.ref = "spek
spekRunner = { module = "org.spekframework.spek2:spek-runner-junit5", version.ref = "spek" }
junitEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" }
junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
coroutinesCore = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.7.3" }


[plugins]
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.0" }
gradlePublish = { id = "com.gradle.plugin-publish", version = "1.2.0" }
dokka = { id = "org.jetbrains.dokka", version = "1.8.20" }
detekt = { id = "io.gitlab.arturbosch.detekt", version = "1.23.4" }
gradlePublish = { id = "com.gradle.plugin-publish", version = "1.2.1" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
asciidoctor = { id = "org.asciidoctor.jvm.convert", version = "3.3.2" }
benManesVersions = { id = "com.github.ben-manes.versions", version = "0.47.0" }
benManesVersions = { id = "com.github.ben-manes.versions", version = "0.50.0" }
binaryCompatibilityValidator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" }

[bundles]
Expand Down
1 change: 1 addition & 0 deletions helm-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ dependencies {

testImplementation(libs.okHttpMockWebServer)

testImplementation(libs.coroutinesCore)
testImplementation(libs.unbrokenDomeTestUtils)
testImplementation(libs.bundles.defaultTests)
testRuntimeOnly(libs.junitEngine)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,7 @@ object HelmPluginTest : Spek({
describe("applying the helm plugin") {

it("project can be evaluated successfully") {
assertThat {
project.evaluate()
}.isSuccess()
project.evaluate()
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ object HelmCommandsPluginTest : Spek({


it("project can be evaluated successfully") {
assertThat {
project.evaluate()
}.isSuccess()
project.evaluate()
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.citi.gradle.plugins.helm.util

import io.kotest.matchers.equals.shouldBeEqual
import java.io.File
import kotlinx.coroutines.CompletableDeferred
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll
import kotlinx.coroutines.runBlocking
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.io.TempDir

internal class FileLockTest {
@TempDir
private lateinit var tempFolder: File

private lateinit var fileToLock: File

@BeforeEach
fun setup() {
tempFolder.mkdirs()
fileToLock = File(tempFolder, "text.txt")
fileToLock.createNewFile()
}

@Test
@Disabled
fun twoFunctionsArentAbleToUpdateFile() {
runBlocking {
val thread2IsReady = CompletableDeferred<Unit>()

val taskIndices = 0..99

val parallelTasks = taskIndices.map { taskIndex ->
async {
withLockFile(fileToLock) {
// don't start until all tasks have been created
runBlocking {
thread2IsReady.await()
}

taskIndex
}
}
}

thread2IsReady.complete(Unit)

val taskResults = parallelTasks.awaitAll().toSet()

taskResults shouldBeEqual taskIndices.toSet()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ object HelmPublishPluginTest : Spek({
describe("applying the helm-publish plugin") {

it("project can be evaluated successfully") {
assertThat {
project.evaluate()
}.isSuccess()
project.evaluate()
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ object HelmReleasesPluginTest : Spek({
describe("when applying the helm-releases plugin") {

it("project can be evaluated successfully") {
assertThat {
project.evaluate()
}.isSuccess()
project.evaluate()
}
}

Expand Down

0 comments on commit 73d82bd

Please sign in to comment.