Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented May 22, 2018

What changes were proposed in this pull request?

This PR proposes to check Java lint via SBT for Jenkins. It uses the SBT wrapper for checkstyle.

I manually tested. If we build the codes once, running this script takes 2 mins at maximum in my local:

Test codes:

Checkstyle failed at following occurrences:
[error] Checkstyle error found in /.../spark/core/src/test/java/test/org/apache/spark/JavaAPISuite.java:82: Line is longer than 100 characters (found 103).
[error] 1 issue(s) found in Checkstyle report: /.../spark/core/target/checkstyle-test-report.xml
[error] Checkstyle error found in /.../spark/sql/hive/src/test/java/org/apache/spark/sql/hive/JavaDataFrameSuite.java:84: Line is longer than 100 characters (found 115).
[error] 1 issue(s) found in Checkstyle report: /.../spark/sql/hive/target/checkstyle-test-report.xml
...

Main codes:

Checkstyle failed at following occurrences:
[error] Checkstyle error found in /.../spark/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/InputPartition.java:39: Line is longer than 100 characters (found 104).
[error] Checkstyle error found in /.../spark/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/InputPartitionReader.java:26: Line is longer than 100 characters (found 110).
[error] Checkstyle error found in /.../spark/sql/core/src/main/java/org/apache/spark/sql/sources/v2/reader/InputPartitionReader.java:30: Line is longer than 100 characters (found 104).
...

How was this patch tested?

Manually tested. Jenkins build should test this.

@SparkQA
Copy link

SparkQA commented May 22, 2018

Test build #90973 has started for PR 21399 at commit 15e4cf8.

@dongjoon-hyun
Copy link
Member

This is the one? Finally, nice! @HyukjinKwon .

@HyukjinKwon
Copy link
Member Author

Thanks @dongjoon-hyun. BTW, I am pushing some commits to check if it works in Jenkins and show the results.

@SparkQA
Copy link

SparkQA commented May 22, 2018

Test build #90976 has finished for PR 21399 at commit b004047.

  • This patch fails Java style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

)
}

object CheckStyle {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about call it as CheckJavaStyle.

CheckStyle seems a broad concept which should include scala style chceck.

And dev/sbt-checkstyle -> dev/sbt-checkjavastyle or similar

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sbt-checkstyle is actually a package name which is consistent in dev scripts.

CheckStyle is also a package name like Unidoc.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me fix CheckStyle to Checkstyle while I am here btw.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see.

Thanks for clarification as it's a bit confusing.

libraryDependencies += "com.puppycrawl.tools" % "checkstyle" % "8.2"

// checkstyle uses guava 23.0.
libraryDependencies += "com.google.guava" % "guava" % "23.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little surprised this is not causing other problems... when I was testing this, it was overriding Spark's own Guava import (which is version 14).

But if it works, awesome.

Copy link
Member Author

@HyukjinKwon HyukjinKwon May 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea but it's plugin dependency here. I was a little surprised too because I was stuck here for a while.

@HyukjinKwon
Copy link
Member Author

HyukjinKwon commented May 22, 2018

Let me push some more commits in main code and test code too to double check.

@SparkQA
Copy link

SparkQA commented May 22, 2018

Test build #90983 has finished for PR 21399 at commit 6e4f6c3.

  • This patch fails Java style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 22, 2018

Test build #90982 has finished for PR 21399 at commit 0cf6de0.

  • This patch fails Java style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 22, 2018

Test build #90980 has finished for PR 21399 at commit 54d070d.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 22, 2018

Test build #90977 has finished for PR 21399 at commit 558b1be.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 22, 2018

Test build #90984 has finished for PR 21399 at commit 7bb0eb3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented May 23, 2018

Test build #91000 has finished for PR 21399 at commit 7bb0eb3.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member Author

@vanzin, I will leave it to you as I believe you are the most appropriate one to review this - I assume the approach you initially took is the same with this. I feel quite sure on the current change FWIW.

Copy link
Contributor

@vanzin vanzin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check what things look like after the build is finished, but otherwise this looks good.

for f in changed_files):
# run_java_style_checks()
pass
run_java_style_checks()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really minor, but now you'll be running this when building with maven too. That could be avoided by checking that the build is not using maven; and also changing the maven target from package to verify so that these checks run.

You can add [build-maven] to the PR title to try it out (or locally with AMPLAB_JENKINS_BUILD_TOOL=maven).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no problem.

@vanzin
Copy link
Contributor

vanzin commented May 23, 2018

Checked locally and looks good. Feel free to merge if you don't want to address the comment above in this PR.

@HyukjinKwon HyukjinKwon changed the title [SPARK-22269][BUILD] Run Java linter via SBT for Jenkins [SPARK-22269][BUILD][test-maven] Run Java linter via SBT for Jenkins May 24, 2018
@HyukjinKwon
Copy link
Member Author

retest this please

@SparkQA
Copy link

SparkQA commented May 24, 2018

Test build #91076 has finished for PR 21399 at commit 7bb0eb3.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented May 24, 2018

Test build #91084 has finished for PR 21399 at commit 294e189.

  • This patch fails Java style tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member Author

^ this one was ran with Maven. I am merging this in.

@HyukjinKwon HyukjinKwon changed the title [SPARK-22269][BUILD][test-maven] Run Java linter via SBT for Jenkins [SPARK-22269][BUILD] Run Java linter via SBT for Jenkins May 24, 2018
@HyukjinKwon
Copy link
Member Author

Merged to master.

Thanks all, @dongjoon-hyun, @advancedxy, @vanzin and @felixcheung.

@asfgit asfgit closed this in 4a14dc0 May 24, 2018
@SparkQA
Copy link

SparkQA commented May 24, 2018

Test build #91085 has finished for PR 21399 at commit 6943ff8.

  • This patch fails due to an unknown error code, -9.
  • This patch merges cleanly.
  • This patch adds no public classes.

asfgit pushed a commit that referenced this pull request Oct 8, 2018
## What changes were proposed in this pull request?

#12980 added Travis CI file mainly for linter because we disabled Java lint check in Jenkins.

It's enabled as of #21399 and now SBT runs it. Looks we can now remove the file added before.

## How was this patch tested?

N/A

Closes #22665

Closes #22667 from HyukjinKwon/SPARK-25673.

Authored-by: hyukjinkwon <[email protected]>
Signed-off-by: hyukjinkwon <[email protected]>
(cherry picked from commit 2199224)
Signed-off-by: hyukjinkwon <[email protected]>
HyukjinKwon added a commit to HyukjinKwon/spark that referenced this pull request Oct 8, 2018
## What changes were proposed in this pull request?

apache#12980 added Travis CI file mainly for linter because we disabled Java lint check in Jenkins.

It's enabled as of apache#21399 and now SBT runs it. Looks we can now remove the file added before.

## How was this patch tested?

N/A

Closes apache#22665

Closes apache#22667 from HyukjinKwon/SPARK-25673.

Authored-by: hyukjinkwon <[email protected]>
Signed-off-by: hyukjinkwon <[email protected]>
@HyukjinKwon HyukjinKwon deleted the SPARK-22269 branch October 16, 2018 12:43
jackylee-ch pushed a commit to jackylee-ch/spark that referenced this pull request Feb 18, 2019
## What changes were proposed in this pull request?

apache#12980 added Travis CI file mainly for linter because we disabled Java lint check in Jenkins.

It's enabled as of apache#21399 and now SBT runs it. Looks we can now remove the file added before.

## How was this patch tested?

N/A

Closes apache#22665

Closes apache#22667 from HyukjinKwon/SPARK-25673.

Authored-by: hyukjinkwon <[email protected]>
Signed-off-by: hyukjinkwon <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants