You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by greghogan <gi...@git.apache.org> on 2017/05/18 17:24:06 UTC

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

GitHub user greghogan opened a pull request:

    https://github.com/apache/flink/pull/3941

    [FLINK-6603] [streaming] Enable checkstyle on test sources

    Follow-up to FLINK-6107.
    
    The first commit sets the import order as [discussed](https://issues.apache.org/jira/browse/FLINK-6107?focusedCommentId=15985221&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15985221): first Flink imports, then other imports, then javax, then java (we could consider placing javax and java together; I have not looked into the required regex and we only have a few instances of javax). The groups are separated by a single newline with static imports moved to the bottom.
    
    The second commit applies the strict checkstyle to the `flink-streaming-java` tests. The checkstyle line length was increased from 2500 to 3000.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/greghogan/flink 6603_enable_checkstyle_on_test_sources

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/3941.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3941
    
----
commit b71b24f4b3e9a3bb3625e698ea2db18531520379
Author: Greg Hogan <co...@greghogan.com>
Date:   2017-05-17T12:01:04Z

    Import order

commit 201ab2a6994a9be153cf08a16d3e6f317246dc33
Author: Greg Hogan <co...@greghogan.com>
Date:   2017-05-17T16:02:50Z

    Fix checkstyle violations

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3941: [FLINK-6603] [streaming] Enable checkstyle on test source...

Posted by greghogan <gi...@git.apache.org>.
Github user greghogan commented on the issue:

    https://github.com/apache/flink/pull/3941
  
    @StephanEwen please verify the first commit implements the desired/traditional import order.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463482
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1696,13 +1699,13 @@ public void testSideOutputDueToLatenessSessionZeroLateness() throws Exception {
     	}
     
     	@Test
    -	public void testDropDueToLatenessSessionWithLatenessPurgingTrigger() throws Exception {
    +	public void testDropDueTolatenessSessionWithlatenessPurgingTrigger() throws Exception {
    --- End diff --
    
    .


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463365
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1237,9 +1240,9 @@ public void testProcessingTimeSessionWindows() throws Throwable {
     	}
     
     	@Test
    -	public void testLateness() throws Exception {
    -		final int WINDOW_SIZE = 2;
    -		final long LATENESS = 500;
    +	public void testlateness() throws Exception {
    --- End diff --
    
    This change looks wrong, it should be "**L**ateness".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3941: [FLINK-6603] [streaming] Enable checkstyle on test source...

Posted by StephanEwen <gi...@git.apache.org>.
Github user StephanEwen commented on the issue:

    https://github.com/apache/flink/pull/3941
  
    @greghogan Awesome, looks good! Thanks a lot for taking this into account!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3941: [FLINK-6603] [streaming] Enable checkstyle on test source...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/3941
  
    +1 to merge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/flink/pull/3941


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463501
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1783,13 +1786,13 @@ public void testDropDueToLatenessSessionWithLatenessPurgingTrigger() throws Exce
     	}
     
     	@Test
    -	public void testNotSideOutputDueToLatenessSessionWithLateness() throws Exception {
    -		// same as testSideOutputDueToLatenessSessionWithLateness() but with an accumulating trigger, i.e.
    +	public void testNotSideOutputDueTolatenessSessionWithlateness() throws Exception {
    --- End diff --
    
    .


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463433
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1438,10 +1441,10 @@ public void testSideOutputDueToLatenessTumbling() throws Exception {
     	}
     
     	@Test
    -	public void testSideOutputDueToLatenessSliding() throws Exception {
    -		final int WINDOW_SIZE = 3;
    -		final int WINDOW_SLIDE = 1;
    -		final long LATENESS = 0;
    +	public void testSideOutputDueTolatenessSliding() throws Exception {
    --- End diff --
    
    same here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463445
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1518,9 +1521,9 @@ public void testSideOutputDueToLatenessSliding() throws Exception {
     	}
     
     	@Test
    -	public void testSideOutputDueToLatenessSessionZeroLatenessPurgingTrigger() throws Exception {
    -		final int GAP_SIZE = 3;
    -		final long LATENESS = 0;
    +	public void testSideOutputDueTolatenessSessionZerolatenessPurgingTrigger() throws Exception {
    --- End diff --
    
    same here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3941: [FLINK-6603] [streaming] Enable checkstyle on test source...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/3941
  
    @greghogan Do we have a checkstyle rule for an empty line before the package declaration? I saw you added a commit for it, but couldn't find the corresponding checkstyle rule.
    
    Travis is also failing at the moment due to a checkstyle violation:
    
    ```[ERROR] src/test/java/org/apache/flink/streaming/util/OperatorSnapshotUtil.java:[51] (regexp) RegexpSingleline: Trailing whitespace```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3941: [FLINK-6603] [streaming] Enable checkstyle on test source...

Posted by greghogan <gi...@git.apache.org>.
Github user greghogan commented on the issue:

    https://github.com/apache/flink/pull/3941
  
    Thanks for the review @zentol. The mistake was caused by not performing a case-sensitive find-replace. I redid the file with variable rename.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3941: [FLINK-6603] [streaming] Enable checkstyle on test source...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/3941
  
    @greghogan +1, feel free to merge it :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463416
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1374,9 +1377,9 @@ public long getCurrentProcessingTime() {
     	}
     
     	@Test
    -	public void testSideOutputDueToLatenessTumbling() throws Exception {
    -		final int WINDOW_SIZE = 2;
    -		final long LATENESS = 0;
    +	public void testSideOutputDueTolatenessTumbling() throws Exception {
    --- End diff --
    
    same here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3941: [FLINK-6603] [streaming] Enable checkstyle on test source...

Posted by greghogan <gi...@git.apache.org>.
Github user greghogan commented on the issue:

    https://github.com/apache/flink/pull/3941
  
    @zentol added `EmptyLineSeparator` to the strict checkstyle.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463463
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1610,9 +1613,9 @@ public void testSideOutputDueToLatenessSessionZeroLatenessPurgingTrigger() throw
     	}
     
     	@Test
    -	public void testSideOutputDueToLatenessSessionZeroLateness() throws Exception {
    -		final int GAP_SIZE = 3;
    -		final long LATENESS = 0;
    +	public void testSideOutputDueTolatenessSessionZerolateness() throws Exception {
    --- End diff --
    
    same here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463516
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1887,10 +1890,10 @@ public void testNotSideOutputDueToLatenessSessionWithLateness() throws Exception
     	}
     
     	@Test
    -	public void testNotSideOutputDueToLatenessSessionWithHugeLatenessPurgingTrigger() throws Exception {
    +	public void testNotSideOutputDueTolatenessSessionWithHugelatenessPurgingTrigger() throws Exception {
    --- End diff --
    
    .


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3941: [FLINK-6603] [streaming] Enable checkstyle on test...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/3941#discussion_r117463525
  
    --- Diff: flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/WindowOperatorTest.java ---
    @@ -1979,9 +1982,9 @@ public void testNotSideOutputDueToLatenessSessionWithHugeLatenessPurgingTrigger(
     	}
     
     	@Test
    -	public void testNotSideOutputDueToLatenessSessionWithHugeLateness() throws Exception {
    -		final int GAP_SIZE = 3;
    -		final long LATENESS = 10000;
    +	public void testNotSideOutputDueTolatenessSessionWithHugelateness() throws Exception {
    --- End diff --
    
    .


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---