Skip to content

Commit

Permalink
Issue #529: Deprecate launch.groovy and merge functionality into diff…
Browse files Browse the repository at this point in the history
….groovy
  • Loading branch information
nrmancuso committed Mar 21, 2021
1 parent 8dbf190 commit 71def16
Show file tree
Hide file tree
Showing 7 changed files with 1,067 additions and 40 deletions.
65 changes: 64 additions & 1 deletion .ci/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ patch-diff-report-tool)
checkstyle-tester-launch-groovy)
checkout_from https://github.com/checkstyle/checkstyle
cd .ci-temp/checkstyle
LOCAL_GIT_REPO=$(pwd)
mvn --batch-mode clean install -Passembly
cd ../../checkstyle-tester
groovy launch.groovy -l projects-for-travis.properties -c my_check.xml -i
groovy diff.groovy -r "$LOCAL_GIT_REPO" -l projects-for-travis.properties --patchConfig my_check.xml \
--patchBranch master --mode single --allowExcludes
;;

checkstyle-tester-diff-groovy-patch)
Expand Down Expand Up @@ -69,6 +71,67 @@ checkstyle-tester-diff-groovy-patch-only)
-pc my_check.xml -p patch-branch -r ../.ci-temp/checkstyle -m single
;;

checkstyle-tester-diff-groovy-regression-single)
# Check out lateset checkstyle from master
checkout_from https://github.com/checkstyle/checkstyle

# Run report from master branch of contribution
checkout_from https://github.com/checkstyle/contribution
cd .ci-temp/contribution/checkstyle-tester
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
export MAVEN_OPTS="-Xmx2048m"
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
-pc ../../../checkstyle-tester/diff-groovy-regression-config.xml \
-r ../../checkstyle \
-m single -p master

# Run report with current branch
cd ../../../checkstyle-tester/
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
-pc diff-groovy-regression-config.xml -r ../.ci-temp/checkstyle/ \
-m single -p master

cd ..
# We need to ignore file paths below, since they will be different between reports
diff -I "contribution" checkstyle-tester/reports/diff/checkstyle/index.html \
.ci-temp/contribution/checkstyle-tester/reports/diff/checkstyle/index.html
;;

checkstyle-tester-diff-groovy-regression)
# Check out latest checkstyle from master
checkout_from https://github.com/checkstyle/checkstyle
cd .ci-temp/checkstyle
MASTER_BRANCH_SHA=$(git log -n 1 --pretty=format:"%H")
cd ../..

# Run report from master branch of contribution
checkout_from https://github.com/checkstyle/contribution
cd .ci-temp/contribution/checkstyle-tester
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
export MAVEN_OPTS="-Xmx2048m"
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
-c ../../../checkstyle-tester/diff-groovy-regression-config.xml \
-r ../../checkstyle \
-b "$MASTER_BRANCH_SHA" -p 7190c47ca5515ad8cb827bc4065ae7664d2766c1

# Run report with current branch
cd ../../../checkstyle-tester/
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
sed -i'' 's/#checkstyle|/checkstyle|/' projects-to-test-on.properties
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
-c diff-groovy-regression-config.xml -r ../.ci-temp/checkstyle/ \
-b "$MASTER_BRANCH_SHA" -p 7190c47ca5515ad8cb827bc4065ae7664d2766c1

cd ..
# We need to ignore file paths below, since they will be different between reports
diff -I "contribution" checkstyle-tester/reports/diff/checkstyle/index.html \
.ci-temp/contribution/checkstyle-tester/reports/diff/checkstyle/index.html
;;

codenarc)
cd checkstyle-tester
./codenarc.sh . diff.groovy > diff.log && cat diff.log && grep '(p1=0; p2=0; p3=0)' diff.log
Expand Down
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ matrix:
- DESC="checkstyle-tester (diff.groovy) on linux with enabled patchOnly"
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-patch-only"

- jdk: openjdk8
env:
- DESC="checkstyle-tester (diff.groovy) regression on linux in single mode"
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-regression-single"

- jdk: openjdk8
env:
- DESC="checkstyle-tester (diff.groovy) regression on linux with master specified"
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-regression"

- jdk: openjdk8
env:
- DESC="checkstyle-tester (diff.groovy) regression on linux with default settings"
- CMD="./.ci/travis.sh checkstyle-tester-diff-groovy-regression-default"

# disabled till https://github.com/checkstyle/contribution/issues/448
# - jdk: openjdk8
# env:
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ environment:
CMD3: " && cd checkstyle && git checkout -b patch-branch"
CMD4: " "
CMD5: " && cd ..\\checkstyle-tester "
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -c my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -i -s"
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -c my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -s"
- JAVA_HOME: C:\Program Files\Java\jdk1.8.0
DESC: "checkstyle-tester (diff.groovy with base and patch configs) on guava"
CMD1: " git clone -q --depth=10 --branch=master "
CMD2: " https://github.com/checkstyle/checkstyle C:\\projects\\contribution\\checkstyle "
CMD3: " && cd checkstyle && git checkout -b patch-branch"
CMD4: " "
CMD5: " && cd ..\\checkstyle-tester "
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -bc my_check.xml -pc my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -i -s"
CMD6: " && groovy diff.groovy -l projects-for-travis.properties -bc my_check.xml -pc my_check.xml -b master -p patch-branch -r C:\\projects\\contribution\\checkstyle -s"

build_script:
- ps: >
Expand Down
2 changes: 2 additions & 0 deletions checkstyle-tester/LAUNCH_GROOVY_README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# _LAUNCH.GROOVY IS BEING DEPRECATED!!!_

# launch.groovy

Checkstyle report generation
Expand Down
17 changes: 17 additions & 0 deletions checkstyle-tester/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,23 @@ This option is useful for Windows users where they are restricted to maximum dir
to maven during the Checkstyle regression run. For example, if you want to skip site generation, you
would add `--extraMvnRegressionOptions "-Dmaven.site.skip=true"` to `diff.groovy` execution.

**failsOnError** (f) - this option tells maven to fail if a checkstyle error is encountered during
report generation. This means that your configuration uses the `<property name="severity" value="warning"/>
` property. If Checkstyle reports a violation for any of the projects that are being tested, the report
generation will fail. This option is good for usage in Checkstyle CI for no-error testing
(optional, default is false).

**allowExcludes** (g) - this option tells `diff.groovy` to allow paths and files defined in a
`projects*.properties` file to be excluded from report generation (optional, default is false).

**checkstyleVersion** (cv) - used to set the Checkstyle version to be used by maven during report
generation; this option should mainly be used by satiellite projects
(optional, default is the latest snapshot).

**sevntuVersion** (sv) - used to set the Sevntu-Checkstyle version to be used by maven during
report generation; this option should mainly be used by satiellite projects
(optional, default is the latest release).

## Outputs

When the script finishes its work the following directory structure will be created
Expand Down
Loading

0 comments on commit 71def16

Please sign in to comment.