Skip to content

Commit 9eab21d

Browse files
committed
Update manual integration tests
1 parent 8c296cc commit 9eab21d

File tree

2 files changed

+28
-13
lines changed

2 files changed

+28
-13
lines changed

History.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
## Enhancements
66
* [#118](https://github.com/pmd/pmd-regression-tester/pull/118): Update js libraries
7+
* [#119](https://github.com/pmd/pmd-regression-tester/pull/119): Update manual integration test for PMD 7
78
* [#120](https://github.com/pmd/pmd-regression-tester/pull/120): Support new PMD 7 binary dist filename
89

910
## Fixed Issues

test/manual_integration_tests.rb

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,25 @@ def test_case_1_single_java_rule_changed
5555
# errors might have been caused in the baseline for other rules (only visible in the stacktrace)
5656
# hence they might appear as removed
5757

58-
# project "apex-link" has 2 errors, since we only executed java rules, 2 errors are removed
59-
# project "checkstyle" has 10 errors removed and 11 changed
60-
# project "openjdk-11" has 1 error changed
58+
# project "apex-link" has 2 errors removed, since we only executed java rules
59+
# project "checkstyle" has 10 errors removed and 1 changed
60+
# project "openjdk-11" has 0 error removed or changed
6161
# project "spring-framework" has 1 error removed
62+
# each project has 1 config error removed (LoosePackageCoupling dysfunctional): in total 7 config errors removed
6263
assert_equal(13, @summary[:errors][:removed], 'found removed errors')
63-
assert_equal(12, @summary[:errors][:changed], 'found changed errors')
64+
# The stack overflow exception might vary in the beginning/end of the stack frames shown
65+
# This stack overflow error is from checkstyle's InputIndentationLongConcatenatedString.java
66+
# instead of assert_equal(0, @summary[:errors][:changed], 'found changed errors')
67+
# allow 0 or 1 changed errors
68+
assert @summary[:errors][:changed] <= 1
6469
assert_equal(0, @summary[:errors][:new], 'found new errors')
6570
assert_equal(0, @summary[:configerrors][:changed], 'found changed configerrors')
6671
assert_equal(0, @summary[:configerrors][:new], 'found new configerrors')
67-
assert_equal(0, @summary[:configerrors][:removed], 'found removed configerrors')
72+
assert_equal(7, @summary[:configerrors][:removed], 'found removed configerrors')
6873

6974
assert_equal("This changeset changes 0 violations,\n" \
7075
"introduces 0 new violations, 0 new errors and 0 new configuration errors,\n" \
71-
'removes 504 violations, 13 errors and 0 configuration errors.',
76+
'removes 504 violations, 13 errors and 7 configuration errors.',
7277
create_summary_message)
7378

7479
assert_file_equals("#{PATCHES_PATH}/expected_patch_config_1.xml", 'target/reports/diff/patch_config.xml')
@@ -93,20 +98,25 @@ def test_case_2_single_xpath_rule_changed
9398
# errors might have been caused in the baseline for other rules (only visible in the stacktrace)
9499
# hence they might appear as removed
95100

96-
# project "apex-link" has 2 errors, since we only executed java rules, 2 errors are removed
97-
# project "checkstyle" has 5 errors removed and 16 errors changed
98-
# project "openjdk-11" has 1 error changed
101+
# project "apex-link" has 2 errors removed, since we only executed java rules
102+
# project "checkstyle" has 5 errors removed and 1 errors changed
103+
# project "openjdk-11" has 0 error removed or changed
99104
# project "spring-framework" has 1 error removed
105+
# each project has 1 config error removed (LoosePackageCoupling dysfunctional): in total 7 config errors removed
100106
assert_equal(8, @summary[:errors][:removed], 'found removed errors')
101-
assert_equal(17, @summary[:errors][:changed], 'found changed errors')
107+
# The stack overflow exception might vary in the beginning/end of the stack frames shown
108+
# This stack overflow error is from checkstyle's InputIndentationLongConcatenatedString.java
109+
# instead of assert_equal(0, @summary[:errors][:changed], 'found changed errors')
110+
# allow 0 or 1 changed errors
111+
assert @summary[:errors][:changed] <= 1
102112
assert_equal(0, @summary[:errors][:new], 'found new errors')
103113
assert_equal(0, @summary[:configerrors][:changed], 'found changed configerrors')
104114
assert_equal(0, @summary[:configerrors][:new], 'found new configerrors')
105-
assert_equal(0, @summary[:configerrors][:removed], 'found removed configerrors')
115+
assert_equal(7, @summary[:configerrors][:removed], 'found removed configerrors')
106116

107117
assert_equal("This changeset changes 0 violations,\n" \
108118
"introduces 0 new violations, 0 new errors and 0 new configuration errors,\n" \
109-
'removes 22 violations, 8 errors and 0 configuration errors.',
119+
'removes 22 violations, 8 errors and 7 configuration errors.',
110120
create_summary_message)
111121

112122
assert_file_equals("#{PATCHES_PATH}/expected_patch_config_2.xml", 'target/reports/diff/patch_config.xml')
@@ -125,7 +135,11 @@ def test_case_3_change_in_core
125135
assert_equal(0, @summary[:violations][:new], 'found new violations')
126136
assert_equal(0, @summary[:violations][:removed], 'found removed violations')
127137
assert_equal(0, @summary[:errors][:removed], 'found removed errors')
128-
assert_equal(0, @summary[:errors][:changed], 'found changed errors')
138+
# The stack overflow exception might vary in the beginning/end of the stack frames shown
139+
# This stack overflow error is from checkstyle's InputIndentationLongConcatenatedString.java
140+
# instead of assert_equal(0, @summary[:errors][:changed], 'found changed errors')
141+
# allow 0 or 1 changed errors
142+
assert @summary[:errors][:changed] <= 1
129143
assert_equal(0, @summary[:errors][:new], 'found new errors')
130144
assert_equal(0, @summary[:configerrors][:changed], 'found changed configerrors')
131145
assert_equal(0, @summary[:configerrors][:new], 'found new configerrors')

0 commit comments

Comments
 (0)