Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
with:
name: ${{ matrix.item.runner }}_${{ matrix.item.profile }}
it-dir: its/ruling
expected-dir: src/test/resources
expected-dir: src/test/resources/expected
actual-dir: target/actual

ruling-update-notify:
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
with:
pr-number: ${{ github.event.pull_request.number }}
ruling-failed: ${{ steps.check-ruling.outputs.ruling-failed }}
ruling-root: 'its/ruling/src/test/resources'
ruling-root: 'its/ruling/src/test/resources/expected'
sources-root: 'its/sources'
env:
GH_TOKEN: ${{ github.token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ruling-diff-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
repository: ${{ github.repository }}
base-sha: ${{ inputs.base-sha || github.event.pull_request.base.sha }}
head-sha: ${{ inputs.head-sha || github.event.pull_request.head.sha }}
ruling-root: 'its/ruling/src/test/resources'
ruling-root: 'its/ruling/src/test/resources/expected'
sources-root: 'its/sources'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ str="<line including <substring>>"; sub="<substring>"; pre="${str%%"$sub"*}" suf

Ruling tests validate that rule fixes don't break existing true positives. They run the analyzer against real-world Java projects (`guava`, `commons-beanutils`, `eclipse-jetty`, `sonar-server`, `jboss-ejb3-tutorial`, `regex-examples`) and compare results to expected baselines.

- Expected ruling files: `its/ruling/src/test/resources/<project>/java-<RULE_ID>.json`
- Expected ruling files: `its/ruling/src/test/resources/expected/<project>/java-<RULE_ID>.json`
- Actual ruling output: `its/ruling/target/actual/<project>/java-<RULE_ID>.json`
- Format: `{"group:artifact:path/to/File.java": [line1, line2, ...], ...}`
- Ruling sources: `its/sources/<project>/`
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ All the `json` files contain a list of lines, indexed by file, explaining where

Into the directory with the expected issues:

its/ruling/src/test/resources/
its/ruling/src/test/resources/expected/

For example using the command:

cp its/ruling/target/actual/* its/ruling/src/test/resources/
cp its/ruling/target/actual/* its/ruling/src/test/resources/expected/

#### Debugging Integration Tests
You can debug ITs by adding `-Dmaven.binary=mvnDebug` as an option when running the tests. This will cause the analyzer JVM to wait for a debugger to be attached before continuing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static void afterAllAnalysis() throws IOException {
}

private static void prepareDumpOldFolder() throws Exception {
Path allRulesFolder = Paths.get("src/test/resources");
Path allRulesFolder = Paths.get("src/test/resources/expected");
Comment thread
gitar-bot[bot] marked this conversation as resolved.
if (SUBSET_OF_ENABLED_RULES.isEmpty()) {
effectiveDumpOldFolder = allRulesFolder.toAbsolutePath();
} else {
Expand Down
6 changes: 0 additions & 6 deletions its/ruling/src/test/resources/diff_S9130.json

This file was deleted.

6 changes: 0 additions & 6 deletions its/ruling/src/test/resources/diff_S9147.json

This file was deleted.

Loading
Loading