Skip to content

Commit 8947818

Browse files
mvicsokolovawoainikkqwwdfsad
authored
Integration test step in Train (#3486)
* Set up Integration Tests step in Train * Run debugProbesTest with -Poverwrite.probes=true * Update DebugProbesKt.bin * Fixes for integration-testing README * Update README * Migrating integration-testing/build.gradle to kts WIP * Revert "Migrating integration-testing/build.gradle to kts WIP" This reverts commit fbf966e * Add space repo only if build_snapshot_train * Fixup Co-authored-by: Margarita Bobova <[email protected]> Co-authored-by: Vsevolod Tolstopyatov <[email protected]>
1 parent 92a2495 commit 8947818

File tree

5 files changed

+68
-6
lines changed

5 files changed

+68
-6
lines changed

integration-testing/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
This is a supplementary project that provides integration tests.
44

55
The tests are the following:
6-
* `MavenPublicationValidator` depends on the published artifacts and tests artifacts binary content and absence of atomicfu in the classpath.
7-
* `CoreAgentTest` checks that `kotlinx-coroutines-core` can be run as a Java agent.
8-
* `DebugAgentTest` checks that the coroutine debugger can be run as a Java agent.
9-
* `smokeTest` builds the test project that depends on coroutines.
6+
* `mavenTest` depends on the published artifacts and tests artifacts binary content for absence of atomicfu in the classpath.
7+
* `jvmCoreTest` miscellaneous tests that check the behaviour of `kotlinx-coroutines-core` dependency in a smoke manner.
8+
* `coreAgentTest` checks that `kotlinx-coroutines-core` can be run as a Java agent.
9+
* `debugAgentTest` checks that the coroutine debugger can be run as a Java agent.
10+
* `debugDynamicAgentTest` checks that `kotlinx-coroutines-debug` agent can self-attach dynamically to JVM as a standalone dependency.
11+
* `smokeTest` builds the multiplatform test project that depends on coroutines.
1012

1113
The `integration-testing` project is expected to be in a subdirectory of the main `kotlinx.coroutines` project.
1214

13-
To run all the available tests: `cd integration-testing` + `./gradlew check`.
15+
To run all the available tests: `./gradlew publishToMavenLocal` + `cd integration-testing` + `./gradlew check`.

integration-testing/build.gradle

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,54 @@
22
* Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5+
6+
buildscript {
7+
8+
/*
9+
* These property group is used to build kotlinx.coroutines against Kotlin compiler snapshot.
10+
* How does it work:
11+
* When build_snapshot_train is set to true, kotlin_version property is overridden with kotlin_snapshot_version,
12+
* atomicfu_version is overwritten by TeamCity environment (AFU is built with snapshot and published to mavenLocal
13+
* as previous step or the snapshot build).
14+
* Additionally, mavenLocal and Sonatype snapshots are added to repository list and stress tests are disabled.
15+
* DO NOT change the name of these properties without adapting kotlinx.train build chain.
16+
*/
17+
def prop = rootProject.properties['build_snapshot_train']
18+
ext.build_snapshot_train = prop != null && prop != ""
19+
if (build_snapshot_train) {
20+
ext.kotlin_version = rootProject.properties['kotlin_snapshot_version']
21+
if (kotlin_version == null) {
22+
throw new IllegalArgumentException("'kotlin_snapshot_version' should be defined when building with snapshot compiler")
23+
}
24+
}
25+
ext.native_targets_enabled = rootProject.properties['disable_native_targets'] == null
26+
27+
// Determine if any project dependency is using a snapshot version
28+
ext.using_snapshot_version = build_snapshot_train
29+
rootProject.properties.each { key, value ->
30+
if (key.endsWith("_version") && value instanceof String && value.endsWith("-SNAPSHOT")) {
31+
println("NOTE: USING SNAPSHOT VERSION: $key=$value")
32+
ext.using_snapshot_version = true
33+
}
34+
}
35+
36+
if (using_snapshot_version) {
37+
repositories {
38+
mavenLocal()
39+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
40+
}
41+
}
42+
43+
}
44+
545
plugins {
646
id "org.jetbrains.kotlin.jvm" version "$kotlin_version"
747
}
848

949
repositories {
50+
if (build_snapshot_train) {
51+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
52+
}
1053
mavenLocal()
1154
mavenCentral()
1255
}
@@ -19,6 +62,7 @@ java {
1962
dependencies {
2063
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
2164
testImplementation "org.ow2.asm:asm:$asm_version"
65+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
2266
}
2367

2468
sourceSets {
@@ -56,7 +100,7 @@ sourceSets {
56100
}
57101
}
58102

59-
// Checks that kotlinx-coroutines-debug agent can self-attach dynamically to JVM as standalone dependency
103+
// Checks that kotlinx-coroutines-debug agent can self-attach dynamically to JVM as a standalone dependency
60104
debugDynamicAgentTest {
61105
kotlin
62106
compileClasspath += sourceSets.test.runtimeClasspath
@@ -130,3 +174,8 @@ compileTestKotlin {
130174
check {
131175
dependsOn([jvmCoreTest, debugDynamicAgentTest, mavenTest, debugAgentTest, coreAgentTest, 'smokeTest:build'])
132176
}
177+
compileKotlin {
178+
kotlinOptions {
179+
jvmTarget = "1.8"
180+
}
181+
}

integration-testing/gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ coroutines_version=1.6.4-SNAPSHOT
33
asm_version=9.3
44

55
kotlin.code.style=official
6+
kotlin.mpp.stability.nowarn=true

integration-testing/settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ pluginManagement {
22
repositories {
33
mavenCentral()
44
maven { url "https://plugins.gradle.org/m2/" }
5+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
56
mavenLocal()
67
}
78
}

integration-testing/smokeTest/build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ repositories {
66
// Coroutines from the outer project are published by previous CI buils step
77
mavenLocal()
88
mavenCentral()
9+
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
910
}
1011

1112
kotlin {
@@ -40,4 +41,12 @@ kotlin {
4041
}
4142
}
4243
}
44+
targets {
45+
configure([]) {
46+
tasks.getByName(compilations.main.compileKotlinTaskName).kotlinOptions {
47+
jvmTarget = "1.8"
48+
}
49+
}
50+
}
4351
}
52+

0 commit comments

Comments
 (0)