Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
beatngu13 committed Mar 26, 2024
2 parents f5c5e9e + 1251593 commit 2edbfa8
Show file tree
Hide file tree
Showing 39 changed files with 517 additions and 501 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@
# force all text files on the working dir to have LF line endings
# https://git-scm.com/docs/gitattributes#_eol
* text eol=lf

*.bat text eol=crlf
*.jar binary
76 changes: 40 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Check out repo
uses: actions/checkout@v4
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2

# Our basic build step as we want contributors to have a nice developer
# experience with little build time and sufficient feedback. Therefore, we
Expand All @@ -59,15 +59,14 @@ jobs:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
cache: 'gradle'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Gradle build
uses: gradle/gradle-build-action@v2
with:
arguments: --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck
run: ./gradlew --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck

# SonarCloud analysis
sonar-cloud-analysis:
Expand All @@ -82,25 +81,24 @@ jobs:
# Sonar needs the whole Git history for issue assignment
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Cache SonarCloud results
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache/
key: ubuntu-sonar
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Gradle build
uses: gradle/gradle-build-action@v2
with:
arguments: --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck
run: ./gradlew --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck
- name: SonarCloud analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: "61ab2579215aa8a0024a2f9368fc1298fdecfd18"
run: ./gradlew jacocoTestReport sonarqube --stacktrace -i
run: ./gradlew jacocoTestReport sonar --stacktrace -i

# Code format check
code-format-check:
Expand All @@ -112,15 +110,14 @@ jobs:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
cache: 'gradle'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Spotless check
uses: gradle/gradle-build-action@v2
with:
arguments: --scan spotlessCheck
run: ./gradlew --scan spotlessCheck

# Our full integration job, which will build for a matrix out of our
# supported Java versions, operating systems and various JUnit versions.
Expand All @@ -141,15 +138,16 @@ jobs:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: temurin
cache: 'gradle'
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Gradle build
uses: gradle/gradle-build-action@v2
with:
arguments: --refresh-dependencies -PjunitVersion=${{ matrix.junit-version }} --stacktrace --scan clean build -x spotlessCheck
env:
ORG_GRADLE_PROJECT_junitVersion: ${{ matrix.junit-version }}
run: ./gradlew --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck

# We want to be up-to-date and know issues with future Java versions as soon as possible.
# Furthermore, we also would love to see our build working with the latest Gradle version.
Expand Down Expand Up @@ -179,21 +177,27 @@ jobs:
shell: bash
run: echo "JDK_EXPERIMENTAL=$JAVA_HOME" >> $GITHUB_ENV
- name: Set up supported Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
cache: 'gradle'
- name: Gradle toolchains
uses: gradle/gradle-build-action@v2
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: release-candidate
arguments: -Porg.gradle.java.installations.auto-download=false javaToolchains

- name: Gradle version
run: gradle --version
- name: Gradle toolchains
env:
ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: false
run: gradle javaToolchains
- name: Gradle build
uses: gradle/gradle-build-action@v2
with:
gradle-version: release-candidate
arguments: --refresh-dependencies -PexperimentalJavaVersion=${{ env.EXPERIMENTAL_JAVA }} -PjunitVersion=${{ matrix.junit-version }} -Porg.gradle.java.installations.auto-download=false --stacktrace --scan clean build -x spotlessCheck
env:
ORG_GRADLE_PROJECT_experimentalJavaVersion: ${{ env.EXPERIMENTAL_JAVA }}
ORG_GRADLE_PROJECT_junitVersion: ${{ matrix.junit-version }}
ORG_GRADLE_PROJECT_org.gradle.java.installations.auto-download: false
run: gradle --refresh-dependencies --stacktrace --scan clean build -x spotlessCheck

# A release will be created if there is a `version` defined and `releasing` is set to `true`.
# If not, this stage will be ignored.
Expand All @@ -210,16 +214,17 @@ jobs:
# Shipkit needs the whole Git history for changelog generation
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
# we build the Javadoc with JDK 17 (for better results),
# so install that as well
java-version: |
21
11
distribution: temurin
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3
- name: Perform release
uses: gradle/gradle-build-action@v2
env:
# used to trigger website build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -231,8 +236,7 @@ jobs:
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_TOKEN_PASSWORD }}
# defines released version according to GitHub Action input
ORG_GRADLE_PROJECT_version: ${{ github.event.inputs.version }}
with:
arguments: publishToSonatype closeAndReleaseSonatypeStagingRepository githubRelease
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository githubRelease

# After our release, we also need to trigger an update for our website build
update-website:
Expand Down
1 change: 1 addition & 0 deletions .infra/checkstyle/import-control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<allow pkg=".*" regex="true" />
<disallow pkg="com.fasterxml.jackson.*" regex="true"/>
<disallow pkg="org.junit.jupiter.api.Assertions.*" regex="true"/>

<subpackage name="jupiter.json">
<file name="JacksonNode.java">
Expand Down
5 changes: 5 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ Thank you for your efforts! ?

The least we can do is to thank them and list some of their accomplishments here (in lexicographic order).

==== 2024

* https://github.com/TWiStErRob[Papp Róbert (TWiStErRob)] updated Gradle and GitHub Actions tooling to latest. (#803 / #804 / #805)

==== 2023

* https://github.com/eeverman[Eric Everman] added `@RestoreSystemProperties` and `@RestoreEnvironmentVariables` annotations to the https://junit-pioneer.org/docs/system-properties/[System Properties] and https://junit-pioneer.org/docs/environment-variables/[Environment Variables] extensions (#574 / #700)
* https://github.com/meredrica[Florian Westreicher] contributed to the JSON argument source extension (#704 / #724)
* https://github.com/IlyasYOY[Ilya Ilyinykh] found unused demo tests (#791)
Expand Down
31 changes: 12 additions & 19 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ plugins {
checkstyle
`maven-publish`
signing
id("com.diffplug.spotless") version "6.21.0"
id("com.diffplug.spotless") version "6.25.0"
id("at.zierler.yamlvalidator") version "1.5.0"
id("org.sonarqube") version "4.3.1.3277"
id("org.shipkit.shipkit-changelog") version "1.2.0"
id("org.shipkit.shipkit-github-release") version "1.2.0"
id("com.github.ben-manes.versions") version "0.48.0"
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("org.gradlex.extra-java-module-info") version "1.4.2"
id("org.sonarqube") version "4.4.1.3373"
id("org.shipkit.shipkit-changelog") version "2.0.1"
id("org.shipkit.shipkit-github-release") version "2.0.1"
id("com.github.ben-manes.versions") version "0.51.0"
id("io.github.gradle-nexus.publish-plugin") version "2.0.0-rc-2"
id("org.gradlex.extra-java-module-info") version "1.7"
}

plugins.withType<JavaPlugin>().configureEach {
Expand Down Expand Up @@ -173,7 +173,7 @@ signing {
}

nexusPublishing {
this.repositories {
repositories {
sonatype()
}
}
Expand All @@ -184,7 +184,6 @@ extraJavaModuleInfo {
automaticModule("com.google.guava:listenablefuture", "com.google.guava.listenablefuture")
automaticModule("com.google.code.findbugs:jsr305", "com.google.code.findbugs.jsr305")
automaticModule("com.google.j2objc:j2objc-annotations", "com.google.j2objc.annotations")
automaticModule("com.google.jimfs:jimfs", "com.google.jimfs")
}

tasks {
Expand All @@ -198,11 +197,6 @@ tasks {
runtimeClasspath += sourceSets.main.get().output
}
}
project(":demo") {
this.sonar {
isSkipProject = true
}
}
// Adds all dependencies of main to demo sourceSet
configurations["demoImplementation"].extendsFrom(configurations.testImplementation.get())
// Ensures JUnit 5 engine is available to demo at runtime
Expand Down Expand Up @@ -310,9 +304,8 @@ tasks {
javadoc {
if (releaseBuild) {
javadocTool.set(project.javaToolchains.javadocToolFor {
// create Javadoc with least Java version to get all features
// (e.g. search result page on 20)
languageVersion.set(JavaLanguageVersion.of(20))
// create Javadoc with the minimum Java version needed for our desired features (e.g. search)
languageVersion.set(JavaLanguageVersion.of(21))
})
}

Expand Down Expand Up @@ -342,7 +335,7 @@ tasks {
enabled = !experimentalBuild
reports {
xml.required.set(true)
xml.outputLocation.set(file("${layout.buildDirectory}/reports/jacoco/report.xml"))
xml.outputLocation.set(layout.buildDirectory.file("reports/jacoco/report.xml"))
}
}

Expand All @@ -360,7 +353,7 @@ tasks {
}

generateChangelog {
dependsOn(nexusPublishing)
dependsOn(":closeAndReleaseSonatypeStagingRepository")
val gitFetchRecentTag = Runtime.getRuntime().exec("git describe --tags --abbrev=0")
val recentTag = gitFetchRecentTag.inputStream.bufferedReader().readText().trim()
previousRevision = recentTag
Expand Down
14 changes: 14 additions & 0 deletions docs/issue.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,20 @@ The implementing class must be registered as a service.
For further information about that, see https://docs.oracle.com/javase/8/docs/api/java/util/ServiceLoader.html[the `ServiceLoader` documentation].
====

The exact API has two classes:

- `IssueTestSuite`, which represents a single issue and all related tests.
- `IssueTestCase`, which represents a single test.

`IssueTestCase` contains:

- the result of the test
- the unique identifier of the test
- the time it took to execute the test (optionally)

The time information is only available if the test is annotated with `@Stopwatch`.
For more information, see the link:/docs/stopwatch.adoc[@Stopwatch documentation].

== Thread-Safety

This extension is safe to use during https://junit.org/junit5/docs/current/user-guide/#writing-tests-parallel-execution[parallel test execution].
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
junitVersion=5.9.2
junitVersion=5.10.1

# Ensure sufficient heap size, especially for Sonar.
org.gradle.jvmargs=-Xmx8g
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
12 changes: 9 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
rootProject.name = "junit-pioneer"
include("demo")

plugins {
id("com.gradle.enterprise") version "3.14.1"
id("com.gradle.enterprise") version "3.16.2"
id("org.gradle.toolchains.foojay-resolver-convention") version("0.8.0")
}

gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"
}
}
}

// TODO move this to a better place once https://sonarsource.atlassian.net/browse/SONARGRADL-134 is resolved.
// > The 'sonar' / 'sonarqube' task depends on compile tasks.
// > This behavior is now deprecated and will be removed in version 5.x.
// > To avoid implicit compilation, set property 'sonar.gradle.skipCompile' to 'true' and make sure your project is compiled, before analysis has started.
System.setProperty("sonar.gradle.skipCompile", "true")
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

package org.junitpioneer.jupiter;

import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;

import java.io.IOException;

Expand All @@ -38,7 +38,7 @@ void test1() {
@Test
@Order(2)
void test2() {
fail();
fail("fails");
}

@Test
Expand All @@ -64,7 +64,7 @@ void test1() {
@Order(2)
void test2() {
// fails test with assertion
assertTrue(false);
assertThat(false).isTrue();
}

@Test
Expand Down

0 comments on commit 2edbfa8

Please sign in to comment.