Skip to content

Commit 93746a6

Browse files
it tests - wip
1 parent 711c75b commit 93746a6

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

integration-tests/config-discover/expected/codacy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ tools:
77
88
99
10-
- pmd@6.55.0
10+
- pmd@7.11.0
1111
1212

integration-tests/config-discover/expected/tools-configs/ruleset.xml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
<?xml version="1.0"?>
2-
<ruleset name="Codacy PMD Ruleset"
3-
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="Codacy PMD 7 Ruleset"
3+
xmlns="https://pmd.github.io/ruleset/2.0.0"
44
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5-
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
6-
<description>Codacy PMD Ruleset</description>
5+
xsi:schemaLocation="https://pmd.github.io/ruleset/2.0.0 https://pmd.github.io/schemas/pmd-7.0.0.xsd">
6+
<description>Codacy PMD 7 Ruleset</description>
77
<rule ref="category/ecmascript/codestyle.xml/AssignmentInOperand">
88
<properties>
99
<property name="allowFor" value="false"/>
@@ -47,7 +47,7 @@ xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourcef
4747
</rule>
4848
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass">
4949
<properties>
50-
<property name="annotations" value="org.springframework.beans.factory.annotation.Autowired,javax.inject.Inject"/>
50+
<property name="annotations" value="org.springframework.beans.factory.annotation.Autowired,javax.inject.Inject,com.google.inject.Inject,lombok.Builder"/>
5151
</properties>
5252
</rule>
5353
<rule ref="category/plsql/design.xml/TooManyMethods">
@@ -60,11 +60,6 @@ xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourcef
6060
<property name="validTypes" value="pom,jar,maven-plugin,ejb,war,ear,rar,par"/>
6161
</properties>
6262
</rule>
63-
<rule ref="category/vm/design.xml/ExcessiveTemplateLength">
64-
<properties>
65-
<property name="minimum" value="1000"/>
66-
</properties>
67-
</rule>
6863
<rule ref="category/xsl/performance.xml/AvoidAxisNavigation">
6964
<properties>
7065
<property name="checkSelfDescendantAbreviation" value="false"/>

integration-tests/run.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,16 @@ run_init_test() {
485485
[ -d "$test_dir" ] || { echo "❌ Test directory does not exist: $test_dir"; exit 1; }
486486

487487
cd "$test_dir" || exit 1
488+
489+
# Set up cleanup trap to ensure .codacy is always removed
490+
cleanup_codacy() {
491+
if [ -d ".codacy" ]; then
492+
rm -rf .codacy
493+
echo "🧹 Cleaned up .codacy directory"
494+
fi
495+
}
496+
trap cleanup_codacy EXIT
497+
488498
rm -rf .codacy
489499

490500
if [ "$use_token" = "true" ]; then
@@ -495,8 +505,11 @@ run_init_test() {
495505
fi
496506

497507
compare_files "expected" ".codacy" "Test $test_name"
508+
498509
echo "✅ Test $test_name completed successfully"
499510
echo "----------------------------------------"
511+
512+
# Cleanup will happen automatically via trap
500513
}
501514

502515
run_config_discover_test() {
@@ -507,6 +520,16 @@ run_config_discover_test() {
507520
[ -d "$test_dir" ] || { echo "❌ Test directory does not exist: $test_dir"; exit 1; }
508521

509522
cd "$test_dir" || exit 1
523+
524+
# Set up cleanup trap to ensure .codacy is always removed
525+
cleanup_codacy() {
526+
if [ -d ".codacy" ]; then
527+
rm -rf .codacy
528+
echo "🧹 Cleaned up .codacy directory"
529+
fi
530+
}
531+
trap cleanup_codacy EXIT
532+
510533
# Clean up previous test results
511534
rm -rf .codacy
512535

@@ -553,8 +576,11 @@ EOF
553576
"$CLI_PATH" config discover .
554577

555578
compare_files "expected" ".codacy" "Test $test_name"
579+
556580
echo "✅ Test $test_name completed successfully"
557581
echo "----------------------------------------"
582+
583+
# Cleanup will happen automatically via trap
558584
}
559585

560586
# Run all tests

0 commit comments

Comments
 (0)