-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve integration test setup #1427
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
+ <dependency> | ||
+ <groupId>org.assertj</groupId> | ||
+ <artifactId>assertj-core</artifactId> | ||
+ <version>${assertj.version}</version> | ||
+ <version>3.26.3<!-- Renovate: org.assertj:assertj-bom --></version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I opted for this syntax, as it's a single-line way (thus compatible with Renovate's regex manager) to link versions to their dependencies, without splitting this logic across files. |
||
+ <scope>test</scope> | ||
+ </dependency> | ||
<dependency> | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,8 +6,7 @@ test_name="$(basename "${0}" .sh)" | |||||
project='checkstyle' | ||||||
repository='https://github.com/checkstyle/checkstyle.git' | ||||||
revision='checkstyle-10.20.1' | ||||||
# XXX: Configure Renovate to manage the AssertJ version declared here. | ||||||
additional_build_flags='-Perror-prone-compile,error-prone-test-compile -Dassertj.version=3.24.2 -Dmaven.compiler.failOnError=true' | ||||||
additional_build_flags='-Perror-prone-compile,error-prone-test-compile -Dmaven.compiler.failOnError=true' | ||||||
additional_source_directories='${project.basedir}${file.separator}src${file.separator}it${file.separator}java,${project.basedir}${file.separator}src${file.separator}xdocs-examples${file.separator}java' | ||||||
patch_error_prone_flags='' | ||||||
validation_error_prone_flags='' | ||||||
|
@@ -33,4 +32,4 @@ fi | |||||
"${patch_error_prone_flags}" \ | ||||||
"${validation_error_prone_flags}" \ | ||||||
"${validation_build_flags}" \ | ||||||
$@ | ||||||
${@} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
My IntelliJ suggests this, and it seemed to work :). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That works currently because we have only one additional flag to pass along ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clear, lets merge! |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,11 +62,7 @@ shared_build_flags=" | |
${additional_build_flags} | ||
" | ||
|
||
# XXX: Configure Renovate to manage the fmt-maven-plugin version declared here. | ||
# XXX: Once GitHub actions uses Maven 3.9.2+, we can inline this variable with | ||
# version reference `${fmt.version}`, and `-Dfmt.version=2.21.1` added to | ||
# `shared_build_flags`. | ||
format_goal='com.spotify.fmt:fmt-maven-plugin:2.21.1:format' | ||
format_goal='com.spotify.fmt:fmt-maven-plugin:2.25:format' | ||
|
||
error_prone_shared_flags='-XepExcludedPaths:(\Q${project.basedir}${file.separator}src${file.separator}\E(it|test|xdocs-examples)\Q${file.separator}resources\E|\Q${project.build.directory}${file.separator}\E).*' | ||
|
||
|
@@ -124,14 +120,22 @@ pushd "${project_root}" | |
git config user.email || git config user.email '[email protected]' | ||
git config user.name || git config user.name 'Integration Test' | ||
|
||
# Prepare the code for analysis by (a) applying the minimal set of changes | ||
# required to run Error Prone with Error Prone Support and (b) formatting the | ||
# code using the same method by which it will be formatted after each | ||
# compilation round. The initial formatting operation ensures that subsequent | ||
# modifications can be rendered in a clean manner. | ||
# Prepare the code for analysis by applying the minimal set of changes required | ||
# to run Error Prone with Error Prone Support. | ||
initial_patch="${integration_test_root}/${test_name}-init.patch" | ||
git clean -fdx | ||
git apply < "${integration_test_root}/${test_name}-init.patch" | ||
git apply < "${initial_patch}" | ||
git commit -m 'dependency: Introduce Error Prone Support' . | ||
if [ -n "${do_sync}" ]; then | ||
# The initial patch applied successfully, but if it was created against a | ||
# different version, then offsets may have changed. Here we update the patch | ||
# to exactly match the new state. | ||
git diff HEAD~1 | "${grep_command}" -vP '^(diff|index)' > "${initial_patch}" | ||
fi | ||
|
||
# Format the patched code using the same method by which it will be formatted | ||
# after each compilation round. This initial formatting operation ensures that | ||
# subsequent modifications can be rendered in a clean manner. | ||
mvn ${shared_build_flags} "${format_goal}" | ||
git commit -m 'minor: Reformat using Google Java Format' . | ||
diff_base="$(git rev-parse HEAD)" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested using out internal Renovate testing setup.