Skip to content

Commit

Permalink
Introduce script to sync ruling results, deleting the files that are …
Browse files Browse the repository at this point in the history
…gone (#4569)
  • Loading branch information
ilia-kebets-sonarsource authored Feb 13, 2024
1 parent 6402d1a commit 13cc668
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/DEV.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ The "Ruling Test" is an integration test which launches the analysis of a large
npm run ruling
```

If everything looks good to you, you can copy the file with the actual issues located at `packages/ruling/tests/actual/`
You can copy the files with the actual issues located at `packages/ruling/tests/actual/`
into the directory with the expected issues `its/ruling/src/test/resources/expected/`.

From the project root, run: `cp -R packages/ruling/tests/actual/jsts/ its/ruling/src/test/expected/jsts`
From the project root, run: `npm run ruling-sync`

You can review the Ruling difference by running `diff -rq its/ruling/src/test/expected/jsts packages/ruling/tests/target/actual/jsts`.
For CSS, run `diff -rq its/ruling/src/test/expected/css `
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"bf": "npm run build:fast",
"new-rule": "ts-node tools/newRule.ts",
"ruling": "node tools/prepare-ruling.js && jest ./packages/ruling/tests/projects/*.ruling.test.ts",
"ruling-sync": "rsync -avh packages/ruling/tests/actual/jsts/ its/ruling/src/test/expected/jsts/ --delete",
"update-ruling-data": "mvn -f sonar-plugin/sonar-javascript-plugin/pom.xml compile && ts-node packages/ruling/tests/tools/parseRulesData.ts",
"bridge:compile": "tsc -b packages profiling",
"bridge:test": "jest --maxWorkers=40% --coverage --testPathIgnorePatterns=/packages/ruling/tests/",
Expand Down

0 comments on commit 13cc668

Please sign in to comment.