Skip to content

Commit

Permalink
Introduce Dropwizard Metrics integration test (#1426)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie authored Nov 28, 2024
1 parent 43a1ea1 commit b3d391c
Show file tree
Hide file tree
Showing 7 changed files with 11,369 additions and 18 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# If requested by means of a pull request comment, runs integration tests
# against the project, using the code found on the pull request branch.
# XXX: Generalize this to a matrix build of multiple integration tests,
# possibly using multiple JDK or OS versions.
# XXX: Investigate whether the comment can specify which integration tests run
# run. See this example of a dynamic build matrix:
# XXX: Review whether then build matrix should also vary JDK or OS versions.
# XXX: Support `/integration-test [name...]` comment syntax to specify the
# subset of integration tests to run.
# See this example of a dynamic build matrix:
# https://docs.github.com/en/actions/learn-github-actions/expressions#example-returning-a-json-object
name: "Integration tests"
on:
Expand All @@ -17,6 +17,9 @@ jobs:
if: |
github.event.issue.pull_request && contains(github.event.comment.body, '/integration-test')
runs-on: ubuntu-24.04
strategy:
matrix:
integration-test: [ "checkstyle", "metrics" ]
steps:
- name: Install Harden-Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
Expand All @@ -26,6 +29,7 @@ jobs:
allowed-endpoints: >
api.adoptium.net:443
checkstyle.org:443
example.com:80
github.com:443
objects.githubusercontent.com:443
oss.sonatype.org:443
Expand All @@ -42,12 +46,12 @@ jobs:
- name: Install project to local Maven repository
run: mvn -T1C install -DskipTests -Dverification.skip
- name: Run integration test
run: xvfb-run ./integration-tests/checkstyle.sh "${{ runner.temp }}/artifacts"
run: xvfb-run "./integration-tests/${{ matrix.integration-test }}.sh" "${{ runner.temp }}/artifacts"
- name: Upload artifacts on failure
if: ${{ failure() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: integration-test-checkstyle
name: "integration-test-${{ matrix.integration-test }}"
path: "${{ runner.temp }}/artifacts"
- name: Remove installed project artifacts
run: mvn dependency:purge-local-repository -DmanualInclude='${project.groupId}' -DresolutionFuzziness=groupId
4 changes: 3 additions & 1 deletion integration-tests/checkstyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repository='https://github.com/checkstyle/checkstyle.git'
revision='checkstyle-10.20.1'
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'
shared_error_prone_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).*'
patch_error_prone_flags=''
validation_error_prone_flags=''
# Validation skips some tests:
Expand All @@ -29,7 +30,8 @@ fi
"${revision}" \
"${additional_build_flags}" \
"${additional_source_directories}" \
"${shared_error_prone_flags}" \
"${patch_error_prone_flags}" \
"${validation_error_prone_flags}" \
"${validation_build_flags}" \
${@}
$@
Loading

0 comments on commit b3d391c

Please sign in to comment.