Skip to content

Commit

Permalink
TS-38628 Run tests using Java 21 to allow newer Mockito versions
Browse files Browse the repository at this point in the history
  • Loading branch information
DreierF committed Dec 5, 2024
1 parent 69c3273 commit 22a9e1a
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
- name: Build with Gradle
run: ./gradlew build
- name: Upload Release Assets
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
java-version: '21'
- name: Build with Gradle
run: ./gradlew build
- name: Upload coverage to Teamscale
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle/
.kotlin/
**/build/**
**/out/**
/*/bin/
Expand Down
2 changes: 1 addition & 1 deletion agent/src/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# --- build image ---

FROM openjdk:17 as build
FROM openjdk:21 as build

Check warning on line 3 in agent/src/docker/Dockerfile

View workflow job for this annotation

GitHub Actions / docker

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
# install xargs which is needed during the build
RUN microdnf install findutils
ADD . /src
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static List<Pair<String, Properties>> findGitPropertiesInArchive(
}

/**
* Returns the CommitInfo (revision & branch + timestmap) from a git properties file. The revision can be either in
* Returns the CommitInfo (revision and branch + timestmap) from a git properties file. The revision can be either in
* {@link #GIT_PROPERTIES_GIT_COMMIT_ID} or {@link #GIT_PROPERTIES_GIT_COMMIT_ID_FULL}. The branch and timestamp in
* {@link #GIT_PROPERTIES_GIT_BRANCH} + {@link #GIT_PROPERTIES_GIT_COMMIT_TIME} or in
* {@link #GIT_PROPERTIES_TEAMSCALE_COMMIT_BRANCH} + {@link #GIT_PROPERTIES_TEAMSCALE_COMMIT_TIME}. By default,
Expand Down
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
alias(libs.plugins.versions)
alias(libs.plugins.nexusPublish)
kotlin("jvm") apply false
}

group = "com.teamscale"
Expand Down
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ dependencies {

implementation("org.ow2.asm:asm:9.7.1")
implementation("org.ow2.asm:asm-commons:9.7.1")
implementation("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:2.0.20")
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,19 @@ repositories {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(21))
}
}

tasks.compileJava {
options.release = 8
options.compilerArgs.add("-Xlint:-options")
}

tasks.compileTestJava {
options.release = 21
}

tasks.test {
useJUnitPlatform {
excludeEngines("teamscale-test-impacted")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import org.gradle.kotlin.dsl.kotlin
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("jvm")
id("com.teamscale.java-convention")
}

tasks.compileKotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
3 changes: 1 addition & 2 deletions impacted-test-engine/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
kotlin("jvm")
`java-library`
com.teamscale.`java-convention`
com.teamscale.`kotlin-convention`
com.teamscale.coverage
com.teamscale.`shadow-convention`
com.teamscale.publish
Expand Down
6 changes: 5 additions & 1 deletion installer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
com.teamscale.`java-convention`
com.teamscale.coverage
com.teamscale.`system-test-convention`
id("org.beryx.jlink") version ("3.0.1")
id("org.beryx.jlink") version ("3.1.1")
}

tasks.jar {
Expand All @@ -22,6 +22,10 @@ java {
}
}

tasks.withType<JavaCompile> {
options.release = 17
}

application {
applicationName = "installer"
mainClass = "com.teamscale.profiler.installer.RootCommand"
Expand Down
6 changes: 0 additions & 6 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@
],
"allowedVersions": "< 2"
},
{
"matchPackagePrefixes": [
"org.mockito"
],
"allowedVersions": "< 5"
},
{
"matchPaths": ["installer/build.gradle.kts"],
"matchPackageNames": [
Expand Down
3 changes: 1 addition & 2 deletions report-generator/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
plugins {
`java-library`
com.teamscale.`java-convention`
com.teamscale.`kotlin-convention`
com.teamscale.coverage
com.teamscale.publish
kotlin("jvm")
}

publishAs {
Expand Down
6 changes: 0 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
pluginManagement {
plugins {
kotlin("jvm") version "2.0.21"
}
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0")
}
Expand Down
2 changes: 1 addition & 1 deletion system-tests/kotlin-inline-function-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
com.teamscale.`kotlin-convention`
com.teamscale.`system-test-convention`
kotlin("jvm")
}

tasks.test {
Expand Down
3 changes: 1 addition & 2 deletions teamscale-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
kotlin("jvm")
`java-library`
com.teamscale.`java-convention`
com.teamscale.`kotlin-convention`
com.teamscale.coverage
com.teamscale.publish
}
Expand Down
4 changes: 4 additions & 0 deletions teamscale-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ java {
}
}

tasks.withType<JavaCompile> {
options.release = 11
}

publishAs {
readableName.set("Teamscale Gradle Plugin")
description.set("A Gradle plugin that supports collecting Testwise Coverage and uploading reports to Teamscale.")
Expand Down
3 changes: 1 addition & 2 deletions tia-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
kotlin("jvm")
`java-library`
com.teamscale.`java-convention`
com.teamscale.`kotlin-convention`
com.teamscale.coverage
com.teamscale.publish
}
Expand Down
3 changes: 1 addition & 2 deletions tia-runlisteners/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
kotlin("jvm")
`java-library`
com.teamscale.`java-convention`
com.teamscale.`kotlin-convention`
com.teamscale.coverage
com.teamscale.publish
}
Expand Down

0 comments on commit 22a9e1a

Please sign in to comment.