Skip to content

Commit 3ae2dc7

Browse files
committed
Fix integration tests (#126)
Merge pull request #126 from adangel:fix-integration-tests
2 parents bffce9e + da72928 commit 3ae2dc7

File tree

6 files changed

+40
-1
lines changed

6 files changed

+40
-1
lines changed

History.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* [#123](https://github.com/pmd/pmd-regression-tester/pull/123): Support ruby 3.3.0
77

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

1011
## External Contributions
1112

Manifest.txt

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ resources/js/datatables.min.js
5656
resources/js/jquery-3.6.4.slim.min.js
5757
resources/js/popper-2.11.7.min.js
5858
resources/js/project-report.js
59+
resources/maven-settings.xml
5960
resources/project_diff_report.html
6061
resources/project_index.html
6162
resources/project_pmd_report.html

README.rdoc

+7
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,15 @@ The tool creates the following folders:
136136
bundle exec rake verify # run this command before commit your changes
137137
bundle exec pmdtester ... # run this to directly execute pmdtester from source
138138

139+
Run all unit tests:
140+
bundle exec rake clean test
141+
142+
Run all integration tests:
143+
bundle exec rake clean integration-test
144+
139145
Run a single test class, e.g.:
140146
bundle exec ruby -I test test/test_project_diff_report.rb
147+
bundle exec ruby -I test test/integration_test_runner.rb
141148

142149
Run a single test, e.g.:
143150
bundle exec ruby -I test test/test_project_diff_report.rb -n test_diff_report_builder

lib/pmdtester/builders/pmd_report_builder.rb

+2
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ def find_pmd_dist_target
248248
def build_pmd_with_maven
249249
logger.info "#{@pmd_branch_name}: Building PMD #{@pmd_version}..."
250250
package_cmd = './mvnw clean package' \
251+
" -s #{ResourceLocator.resource('maven-settings.xml')} " \
252+
' -Pfor-dokka-maven-plugin' \
251253
' -Dmaven.test.skip=true' \
252254
' -Dmaven.javadoc.skip=true' \
253255
' -Dmaven.source.skip=true' \

resources/maven-settings.xml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
3+
4+
<profiles>
5+
<profile>
6+
<id>for-dokka-maven-plugin</id>
7+
<pluginRepositories>
8+
<pluginRepository>
9+
<!-- needed for dokka-maven-plugin in pmd-lang-test -->
10+
<id>kotlinx-html</id>
11+
<name>KotlinxHTML Repository</name>
12+
<releases>
13+
<enabled>true</enabled>
14+
<updatePolicy>never</updatePolicy>
15+
</releases>
16+
<snapshots>
17+
<enabled>false</enabled>
18+
</snapshots>
19+
<url>https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven/</url>
20+
</pluginRepository>
21+
</pluginRepositories>
22+
</profile>
23+
</profiles>
24+
25+
</settings>

test/test_pmd_report_builder.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,10 @@ def cleanup_pmd_dist_dir(base_dir:)
324324

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

0 commit comments

Comments
 (0)