Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ updates:
directory: "/"
schedule:
interval: "daily"
labels:
- "dependabot: Maven"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
labels:
- "dependabot: GitHub Actions"
19 changes: 13 additions & 6 deletions .github/workflows/binary-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ name: Binary Compatibility
on: [push, pull_request]

jobs:

verify-with-base:

name: Verify with `${{ github.base_ref }}`
name: Verify with base ref
runs-on: ubuntu-latest
if: github.base_ref != null

Expand All @@ -24,13 +22,20 @@ jobs:
ref: ${{ github.base_ref }}
path: ${{ github.run_id }}.${{ github.base_ref }}
- name: Build `${{ github.base_ref }}`
run: ./mvnw -V --no-transfer-progress -e -f ${{ github.run_id }}.${{ github.base_ref }}/pom.xml package -DskipTests
run: >
./mvnw -B -V --no-transfer-progress -e
-f ${{ github.run_id }}.${{ github.base_ref }}/pom.xml package
-DskipTests
-Djansi.passthrough=true
-Dstyle.color=always
- name: Compare `${{ github.head_ref }}` with `${{ github.base_ref }}`
run: >
./mvnw -V --no-transfer-progress -e -Pjapicmp-branch package japicmp:cmp
./mvnw -B -V --no-transfer-progress -e -Pjapicmp-branch package japicmp:cmp
-DskipTests
-Djapicmp.breakBuildOnBinaryIncompatibleModifications=true
-Djapicmp.oldVersion.basedir=${{ github.run_id }}.${{ github.base_ref }}
-Djansi.passthrough=true
-Dstyle.color=always

- name: Add label
if: failure()
Expand Down Expand Up @@ -88,9 +93,11 @@ jobs:

- name: Compare with the latest release
run: >
./mvnw -V --no-transfer-progress -e package japicmp:cmp
./mvnw -B -V --no-transfer-progress -e package japicmp:cmp
-DskipTests
-Djapicmp.breakBuildOnBinaryIncompatibleModifications=true
-Djansi.passthrough=true
-Dstyle.color=always

- name: Add label
if: failure()
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/cross-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ jobs:
release: ${{ matrix.java }}
version: latest
- name: Test
run: ./mvnw -V --no-transfer-progress -e verify javadoc:javadoc
run: >
./mvnw -B -V --no-transfer-progress -e verify javadoc:javadoc '-P!coverage'
-Djansi.passthrough=true
-Dstyle.color=always
33 changes: 30 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,20 @@ jobs:

test_os:
name: OS ${{ matrix.os }}
permissions:
# Needed for test reporting
checks: write
pull-requests: write
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
include:
- os: ubuntu-latest
comment-test-results: true
- os: macOS-latest
comment-test-results: false
- os: windows-latest
comment-test-results: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -20,12 +30,27 @@ jobs:
java-version: 17
# cache: 'maven'
- name: Test
run: ./mvnw -V --no-transfer-progress -e verify javadoc:javadoc
# Note: arguments with a period or bang in them have to be single quoted to prevent
# confusing the PowerShell instance on Windows runners.
run: >
./mvnw -B -V --no-transfer-progress -e verify javadoc:javadoc '-P!coverage'
'-Djansi.passthrough=true'
'-Dstyle.color=always'

# Add test results to the PR.
- name: Publish unit test results
uses: EnricoMi/publish-unit-test-result-action@v1
if: ${{ matrix.comment-test-results }}
continue-on-error: true
with:
check_name: "JUnit test results"
files: "target/surefire-reports/TEST-*.xml"

sonar:
name: Sonar code analysis
runs-on: ubuntu-latest
if: github.repository == 'assertj/assertj-core' && github.event_name == 'push'

steps:
- uses: actions/checkout@v3
with:
Expand All @@ -38,10 +63,12 @@ jobs:
# cache: 'maven'
- name: Test with Sonar
run: >
./mvnw -V --no-transfer-progress -e -Pcoverage verify javadoc:javadoc sonar:sonar
./mvnw -B -V --no-transfer-progress -e -Pcoverage verify javadoc:javadoc sonar:sonar
-Dsonar.host.url=https://sonarcloud.io
-Dsonar.organization=assertj
-Dsonar.projectKey=joel-costigliola_assertj-core
-Djansi.passthrough=true
-Dstyle.color=always
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
10 changes: 8 additions & 2 deletions .github/workflows/pitest-receive-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ jobs:
# pitest has been bound to a profile called pitest for normal running
# we add config to analyse only changes made within a PR and treat surviving mutants as check errors
# failWhenNoMutations is unset in the pom, as otherwise PRs that do not affect java code would fail
run: mvn -e -B -Ppitest -Dfeatures="+GIT(from[HEAD~1]), +gitci" test
run: >
mvn -e -B -Ppitest -Dfeatures="+GIT(from[HEAD~1]), +gitci" test
-Djansi.passthrough=true
-Dstyle.color=always
- name: aggregate files
run: mvn -e -B -Ppitest pitest-git:aggregate
run: >
mvn -e -B -Ppitest pitest-git:aggregate
-Djansi.passthrough=true
-Dstyle.color=always
- name: upload results
uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pitest-updated-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ jobs:
# The updatePR maven goal is used here with an explicit version. This allows us to upload without checking out
# the code, but does mean the version here must be maintained. An alternative would be to checkout the code and use
# the github goal. This will work as long as the artifact is extracted to the maven target directory
run: mvn -DrepoToken=${{ secrets.GITHUB_TOKEN }} com.groupcdg:pitest-github-maven-plugin:0.2.0:updatePR
run: >
mvn -B -DrepoToken=${{ secrets.GITHUB_TOKEN }} com.groupcdg:pitest-github-maven-plugin:0.2.0:updatePR
-Djansi.passthrough=true
-Dstyle.color=always
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ jobs:
run: |
git config user.name '${{ github.actor }}'
git config user.email '${{ github.actor }}@users.noreply.github.com'
./mvnw -B release:prepare release:perform -Dpassword=${{ secrets.GITHUB_TOKEN }}
./mvnw -B release:prepare release:perform -Dpassword=${{ secrets.GITHUB_TOKEN }} \
-Djansi.passthrough=true \
-Dstyle.color=always
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
Expand Down
44 changes: 41 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</argLine>
<javadocAdditionalOptions>-html5 --allow-script-in-comments</javadocAdditionalOptions>
<!-- Dependency versions -->
<byte-buddy.version>1.12.10</byte-buddy.version>
<byte-buddy.version>1.12.11</byte-buddy.version>
<hamcrest.version>2.2</hamcrest.version>
<opentest4j.version>1.2.0</opentest4j.version>
<!-- Dependency versions overriding -->
Expand Down Expand Up @@ -366,12 +366,41 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
<configuration>
<trimStackTrace>false</trimStackTrace>
<excludes>
<exclude>org/assertj/core/osgi/**</exclude>
<exclude>org/assertj/core/internal/objects/Objects_assertHasOnlyFields_Test*</exclude>
</excludes>
<runOrder>random</runOrder>

<!--
These blocks are needed to show @DisplayName and @ParameterizedTest
in reports with the provided names, as well as with console output.
-->
<consoleOutputReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5ConsoleOutputReporter">
<!-- Set to true to suppress log output being included in Surefire output -->
<disable>false</disable>
</consoleOutputReporter>

<statelessTestsetInfoReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5StatelessTestsetInfoReporter">
<disable>false</disable>
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedClassNameInRunning>true</usePhrasedClassNameInRunning>
<usePhrasedClassNameInTestCaseSummary>true</usePhrasedClassNameInTestCaseSummary>
</statelessTestsetInfoReporter>

<statelessTestsetReporter
implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
<disable>false</disable>
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
<usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
</statelessTestsetReporter>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -548,12 +577,12 @@
<plugin>
<groupId>org.pitest</groupId>
<artifactId>pitest-maven</artifactId>
<version>1.8.1</version>
<version>1.9.0</version>
<dependencies>
<dependency>
<groupId>org.pitest</groupId>
<artifactId>pitest-junit5-plugin</artifactId>
<version>0.16</version>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.groupcdg</groupId>
Expand Down Expand Up @@ -621,6 +650,9 @@
</profile>
<profile>
<id>coverage</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
Expand All @@ -636,6 +668,12 @@
<!-- jacoco is executed in the prepare-package phase instead of the verify phase, it can not determine code coverage
of the unpacked shaded classes -->
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>

<execution>
<id>jacoco-report</id>
<phase>prepare-package</phase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.assertj.core.util.VisibleForTesting;

/**
* Responsible of building the exception to throw for failing assumptions.
* Responsible for building the exception to throw for failing assumptions.
* @since 3.21.0
*/
public class AssumptionExceptionFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ public class Configuration {
private PreferredAssumptionException preferredAssumptionException;

public Configuration() {
setDefaults();
}

/**
* Set all configuration settings to their default values again.
*/
public void setDefaults() {
comparingPrivateFields = ALLOW_COMPARING_PRIVATE_FIELDS;
extractingPrivateFields = ALLOW_EXTRACTING_PRIVATE_FIELDS;
bareNamePropertyExtraction = BARE_NAME_PROPERTY_EXTRACTION_ENABLED;
Expand Down
Loading