Skip to content

Commit

Permalink
Fix integration tests (#126)
Browse files Browse the repository at this point in the history
Merge pull request #126 from adangel:fix-integration-tests
  • Loading branch information
adangel committed Sep 5, 2024
2 parents bffce9e + da72928 commit 3ae2dc7
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 1 deletion.
1 change: 1 addition & 0 deletions History.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* [#123](https://github.com/pmd/pmd-regression-tester/pull/123): Support ruby 3.3.0

## Fixed Issues
* [#126](https://github.com/pmd/pmd-regression-tester/pull/126): Fix integration tests

## External Contributions

Expand Down
1 change: 1 addition & 0 deletions Manifest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ resources/js/datatables.min.js
resources/js/jquery-3.6.4.slim.min.js
resources/js/popper-2.11.7.min.js
resources/js/project-report.js
resources/maven-settings.xml
resources/project_diff_report.html
resources/project_index.html
resources/project_pmd_report.html
7 changes: 7 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,15 @@ The tool creates the following folders:
bundle exec rake verify # run this command before commit your changes
bundle exec pmdtester ... # run this to directly execute pmdtester from source

Run all unit tests:
bundle exec rake clean test

Run all integration tests:
bundle exec rake clean integration-test

Run a single test class, e.g.:
bundle exec ruby -I test test/test_project_diff_report.rb
bundle exec ruby -I test test/integration_test_runner.rb

Run a single test, e.g.:
bundle exec ruby -I test test/test_project_diff_report.rb -n test_diff_report_builder
Expand Down
2 changes: 2 additions & 0 deletions lib/pmdtester/builders/pmd_report_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ def find_pmd_dist_target
def build_pmd_with_maven
logger.info "#{@pmd_branch_name}: Building PMD #{@pmd_version}..."
package_cmd = './mvnw clean package' \
" -s #{ResourceLocator.resource('maven-settings.xml')} " \
' -Pfor-dokka-maven-plugin' \
' -Dmaven.test.skip=true' \
' -Dmaven.javadoc.skip=true' \
' -Dmaven.source.skip=true' \
Expand Down
25 changes: 25 additions & 0 deletions resources/maven-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">

<profiles>
<profile>
<id>for-dokka-maven-plugin</id>
<pluginRepositories>
<pluginRepository>
<!-- needed for dokka-maven-plugin in pmd-lang-test -->
<id>kotlinx-html</id>
<name>KotlinxHTML Repository</name>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<url>https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>

</settings>
5 changes: 4 additions & 1 deletion test/test_pmd_report_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ def cleanup_pmd_dist_dir(base_dir:)

def stub_pmd_build_maven(binary_name:)
PmdTester::Cmd.stubs(:execute_successfully).with do |cmd|
if cmd == './mvnw clean package -Dmaven.test.skip=true' \
if cmd == './mvnw clean package ' \
"-s #{PmdTester::ResourceLocator.resource('maven-settings.xml')} " \
' -Pfor-dokka-maven-plugin' \
' -Dmaven.test.skip=true' \
' -Dmaven.javadoc.skip=true -Dmaven.source.skip=true' \
' -Dcheckstyle.skip=true -Dpmd.skip=true -T1C -B'
FileUtils.mkdir_p 'pmd-dist/target'
Expand Down

0 comments on commit 3ae2dc7

Please sign in to comment.