Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added .diffblue/cover-flight.jfr
Binary file not shown.
13 changes: 13 additions & 0 deletions .diffblue/init.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import com.diffblue.cover.buildsystem.gradle.plugin.CoverPlugin
import com.diffblue.cover.buildsystem.gradle.plugin.GradleSpy

initscript {
dependencies {
classpath files(System.properties['com.diffblue.cover.buildsystem.gradle.model-jar'])
}
}

allprojects {
apply plugin: CoverPlugin
addListener(GradleSpy.getInstance())
}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ src/main/java/org/tron/core/bftconsensus
src/test/java/org/tron/consensus2
src/main/java/META-INF/
src/main/resources/META-INF/
/bin/
*/bin/*

# Eclipse IDE specific files and folders
/.project
Expand Down
295 changes: 295 additions & 0 deletions DiffblueBuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,295 @@
# Overview
# ========
#
# This file contains the arguments for invoking gradle when using Diffblue Cover. Cover will render the command to
# execute based on the "phase" that's being executed by assembling the flags, plugin options, and any filtering
# arguments. For example, if we're trying to execute the build phase on windows without any of the named plugins
# present, you can expect the invoked command to look (something) like (forgiving the abuse of line breaks):
#
# ./gradlew.bat \
# --init-script=/path/to/init.gradle --info --console=plain -PskipTestOptimizer=true \
# -Dcom.diffblue.cover.buildsystem.gradle.model-jar=/path/to/gradle-spy.jar \
# :project:build
#
# The first line comes from the 'cmd' stanza (selected by the renderer based on detected operating system). The next
# two lines of the command come from the 'global' stanza, while the final line comes from the specification of the
# build phase.
#
# Phases
# ======
#
# There are (currently) eight phases that Cover progresses through during the various executions. They are listed
# below along with examples of commands where they're invoked:
#
# info : dcover create : gathering information about the structure of the project (child-modules,
# classpaths, etc.)
# launcher : dcover create : downloads the JUnit Jupiter Launcher if needed
# clean : dcover build --clean : cleans the existing target/build files from the modules
# build : dcover build : rebuilds the modules
# test : dcover create : runs the tests of the module, can be filtered based on type (e.g. Diffblue,
# non-Diffblue, or a named test)
# coverage : dcover coverage-reports : runs the tests and records the coverage, can be filtered like the test phase
# refactor : dcover fix-build : applies any refactorings
# validate : dcover validate : runs all the tests, both diffblue and manual
#
# Variable Substitution
# =====================
#
# Throughout this file there are a number of variables that need to be substituted to make the commands work. These
# are of the form ${VARIABLE}. For substitution to work the VARIABLE must match exactly one of the known variables
# (listed below), if it doesn't match exactly it will be filtered out.
#
# Supported Variables and Their Purpose
# -------------------------------------
#
# The list below contains all the variables that will be replaced.
#
# Launcher
# ***********************
# DIFFBLUE_GROUP_ID : the group ID of the artifact to download (e.g. the JUnit Jupiter Launcher)
# DIFFBLUE_ARTIFACT_ID : the artifact ID of the artifact to download (e.g. the JUnit Jupiter Launcher)
# DIFFBLUE_VERSION : the version of the artifact to download (e.g. the JUnit Jupiter Launcher)
#
# Refactor
# ********
# Refactoring requires installing jar files bundles with cover hence the long list of variables here
#
# DIFFBLUE_REWRITE_CONFIG : the location of the rewrite configuration to apply
# DIFFBLUE_COVER_REFACTORING_RECIPES_JAR : the location of the recipes for refactoring
# DIFFBLUE_COVER_REFACTORING_RECIPES_GROUP_ID : the group ID for the recipes for refactoring
# DIFFBLUE_COVER_REFACTORING_RECIPES_ARTIFACT_ID : the artifact ID for the recipes for refactoring
# DIFFBLUE_COVER_REFACTORING_RECIPES_VERSION : the version for the recipes for refactoring
# DIFFBLUE_OPEN_REWRITE_JAR : the location of the rewrite jar file
# DIFFBLUE_OPEN_REWRITE_POM : the location of the rewrite pom file
# DIFFBLUE_OPEN_REWRITE_GROUP_ID : the group ID for the rewrite jar/pom files
# DIFFBLUE_OPEN_REWRITE_ARTIFACT_ID : the artifact ID for the rewrite jar/pom files
# DIFFBLUE_OPEN_REWRITE_VERSION : the version for the rewrite jar/pom files
#
# Gradle Specific
# ***************
# MODULE_PATH : the path to the module separated by colons, e.g. project:application
# DIFFBLUE_GRADLE_INIT_SCRIPT : the location of the Gradle init script, e.g. .diffblue/init.gradle
# DIFFBLUE_GRADLE_SPY_JAR : the location of the Gradle event listener classes
# DIFFBLUE_TEST_CLASS : the name of a single class containing tests to execute, used during the env checks
# DIFFBLUE_TEST_CLASS_REGEX : the regex matching class names containing created tests, e.g. **/*DiffblueTest*
# DIFFBLUE_COVER_REFACTORING_INIT_SCRIPT : the location of the Gradle init script to apply when configuring refactoring
#
# Maven Specific
# **************
# MODULE : the name of the module, e.g. application
# DIFFBLUE_MAVEN_USER_SETTINGS : the location of the Maven user settings.xml configuration file
# DIFFBLUE_MAVEN_GLOBAL_SETTINGS : the location of the Maven global settings.xml configuration file
# DIFFBLUE_MAVEN_SPY_JAR : the location of the Maven event listener classes
# DIFFBLUE_TEST_FILE : the name of a single file containing tests to execute, used during the env checks
# DIFFBLUE_TEST_FILE_REGEX : the regex matching file names containing created tests, e.g. **DiffblueTest*.java
#
# Note: Only the MODULE_PATH can be the empty string, all other variables that evaluate to the empty string will be
# filtered out before being executed.
#
# Plugins
# =======
#
# There are times when Cover needs to enable or disable some plugins. For example, as part of the environment checks we
# execute a DummyTest to check whether tests can be detected and executed by the build system, in this case we don't
# need to worry about formatting the file to match any spotless or checkstyle configurations as it doesn't remain in the
# project once the check has completed. However, the tests that are created will need to abide by whatever
# spotless/checkstyle configuration is present. It only makes sense to include these flags if the specific plugin(s)
# are present in the configuration for the build.
#
# In short: the plugins will be enabled/disabled conditionally and will only be included depending on their presence
# in the project.

meta:
version: 2

# The tool name is used to key the configuration internally. We have two known tool names, either maven or gradle.
# If one of these is used by a user-provided file, the intent is that the user-provided configuration will supersede
# the configuration here.
toolName: gradle

cmd:
# The commands to try to run when executing this build system. Configured on an operating system basis, and tried
# in turn (when there are multiple entries) until either the list is exhausted or one of the commands works.
windows:
- ./gradlew.bat
- ./gradlew
linux:
- ./gradlew
macos:
- ./gradlew

global:
# The flags in the global section apply to all the invocations of the commands
flags:
- --init-script=${DIFFBLUE_GRADLE_INIT_SCRIPT}
- --info
- --console=plain
- -PskipTestOptimizer=true
- -Dcom.diffblue.cover.buildsystem.gradle.model-jar=${DIFFBLUE_GRADLE_SPY_JAR}
- --no-daemon

# The timeout for all the phases unless a phase specific timeout value has been set.
timeout: PT10M

plugins:
# Gradle plugins often don't allow you to configure them via the command line, unless they've been specifically
# setup to allow configuration via properties -- so some adjusting of your project may be required.

# These stanzas are of the form:
# - name: plugin name, as used in the `id` stanza in a `plugins` block
# disable: the name of the goal (listed below) to use when this plugin should be disabled
# enable: the name of the goal (listed below) to use when this plugin should be enabled
# flags: any flags to apply to the plugin regardless of enablement/disablement
# goals:
# - name: the name of the goal, referenced in the enable/disable options above
# flags: any flags to apply to the named goal
- name: io.spring.javaformat.gradle.SpringJavaFormatPlugin
disable: disable
enable: format
flags: ~
goals:
- name: format
goal: ${MODULE_PATH}format
flags: ~
- name: disable
goal: ~
flags:
- -Pspring-javaformat.skip=true

- name: com.diffplug.gradle.spotless.SpotlessPlugin
disable: disable
enable: format
flags: ~
goals:
- name: format
goal: ${MODULE_PATH}spotlessApply
flags: ~
- name: disable
goal: ~
flags:
- --exclude-task=${MODULE_PATH}spotlessApply


# The phases are named according to `dcover`'s needs and aren't specific to any build system (despite some overlap).
# The idea is that each phase provides a list of build system `goals` which will be combined into a single invocation.
phase:

# The info phase is used early on to gather information about the structure of the project under test.
info: ~

# The launcher phase is used to download the JUnit Jupiter launcher - run on a project (?)
launcher:
timeout: PT30S
goals:
- name: ~
goal: downloadDependencies
flags:
- --
- --groupId=${DIFFBLUE_GROUP_ID}
- --artifactId=${DIFFBLUE_ARTIFACT_ID}
- --version=${DIFFBLUE_VERSION}

# The clean phase is used to remove any compiled class files, reports, etc. from the module under test
# (typically, removing the target or build directories on maven or gradle projects).
clean:
goals:
- name: ~
goal: ${MODULE_PATH}clean

# The build phase is used to compile the module under test. We also include the modules that the module under
# test depends on.
build:
goals:
- name: ~
goal: ${MODULE_PATH}assemble
- name: ~
goal: ${MODULE_PATH}testClasses

# The test phase is used to run the module under test's tests. This allows a filter to be specified to
# include/exclude tests that match patterns, or run a single named test.
test:
timeout: PT60M
goals:
- name: ~
goal: ${MODULE_PATH}test
flags:
- ${DIFFBLUE_TEST_FILTER}
filter:
# By default, all tests are executed
default: ~
# To execute tests that Diffblue hasn't created (often referred to manual tests in Cover Reports), this is the
# regular expression to use to match file names. This does not execute tests tagged with "MaintainedByDiffblue",
# so should only be used when running by tag is not possible.
neverDiffblue:
- -PexcludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
# To execute tests that Diffblue hasn't created (often referred to manual tests in Cover Reports), this is the
# regular expression to use to match file names. This is the default maven regex with the negation of the
# Diffblue test file names and excluded Tests tagged with "MaintainedByDiffblue".
neverDiffblueTag:
- -PexcludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
- -PexcludeGroup=MaintainedByDiffblue
# To execute only the Diffblue created tests, then pass this regular expression to match the file names
onlyDiffblue:
- -PincludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
- -PdiffblueOnly
# To execute only the Diffblue created tests that have a specific tag in non-Diffblue tests, then pass these
# options to the test runner
onlyDiffblueTag:
- -PexcludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
- -PincludeGroup=MaintainedByDiffblue
- -PdiffblueOnly
# To run a single test, apply this option
named:
- --tests=${DIFFBLUE_TEST_CLASS}

# The coverage phase measures the coverage of the tests. It's executed a number of times with different filters
# applied (to measure the coverage of all, non-diffblue, and diffblue tests).
coverage:
timeout: PT60M
goals:

- name: ~
goal: ${MODULE_PATH}test
flags:
- -PignoreFailures=true
- ${DIFFBLUE_TEST_FILTER}

- name: ~
goal: ${MODULE_PATH}jacocoTestReport

filter:
default: ~
neverDiffblue:
- -PexcludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
neverDiffblueTag:
- -PexcludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
- -PexcludeGroup=MaintainedByDiffblue
onlyDiffblue:
- -PincludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
- -PdiffblueOnly
onlyDiffblueTag:
- -PexcludeTests=${DIFFBLUE_TEST_CLASS_REGEX}
- -PincludeGroup=MaintainedByDiffblue
- -PmergeCoverage=true
- -PdiffblueOnly
named:
- --tests=${DIFFBLUE_TEST_CLASS}

# The refactor phase is used to, for example, add missing dependencies to the user's project
refactor:
timeout: PT50M
goals:
- name: ~
goal: :rewriteRun
flags:
- --init-script=${DIFFBLUE_COVER_REFACTORING_INIT_SCRIPT}
- -DconfigFile=${DIFFBLUE_REWRITE_CONFIG}

# The validate phase checks to make sure that the tests that have been created will work in the user's build system
validate:
timeout: PT60M
goals:
- name:
goal: ${MODULE_PATH}build
- name:
goal: ${MODULE_PATH}check
3 changes: 3 additions & 0 deletions File
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Generated by the application. PLEASE DO NOT EDIT!
#Thu Apr 03 13:33:49 UTC 2025
Key=42
8 changes: 8 additions & 0 deletions actuator/.diffblue/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Created automatically by Diffblue Cover
# Feel free edit this file, but if you remove it, it will be recreated

# Refactoring configuration
/refactorings.yml

# Log files
/log
13 changes: 13 additions & 0 deletions actuator/.diffblue/init.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import com.diffblue.cover.buildsystem.gradle.plugin.CoverPlugin
import com.diffblue.cover.buildsystem.gradle.plugin.GradleSpy

initscript {
dependencies {
classpath files(System.properties['com.diffblue.cover.buildsystem.gradle.model-jar'])
}
}

allprojects {
apply plugin: CoverPlugin
addListener(GradleSpy.getInstance())
}

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions actuator/.diffblue/reports/manual-tests-jacoco-report.xml

Large diffs are not rendered by default.

Loading