You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "eziosudo (via GitHub)" <gi...@apache.org> on 2023/07/06 19:58:11 UTC

[GitHub] [kafka] eziosudo opened a new pull request, #13973: exclude integration tests in "./gradlew unitTest" by adding @Tag("integration") and @Category(IntegrationTest.class)

eziosudo opened a new pull request, #13973:
URL: https://github.com/apache/kafka/pull/13973

   Change these tests by adding @Tag("integration") and @Category(IntegrationTest.class).
   `
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.MetricsReporterIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.LagFetchIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.OptimizedKTableIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.RegexSourceIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.PurgeRepartitionTopicIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.StandbyTaskCreationIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.MetricsIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.KTableKTableForeignKeyInnerJoinMultiIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.KTableKTableForeignKeyJoinDistributedTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.NamedTopologyIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.QueryableStateIntegrationTest.html
   ./streams/build/reports/tests/unitTest/classes/org.apache.kafka.streams.integration.KTableEfficientRangeQueryTest.html
   ./connect/runtime/build/reports/tests/unitTest/classes/org.apache.kafka.connect.integration.StartAndStopCounterTest.html
   ./connect/runtime/build/reports/tests/unitTest/classes/org.apache.kafka.connect.integration.StartAndStopLatchTest.html
   `
   
   "stream" module's unitTest time reduced from 25 minutes to 17 minutes, "connect" module's unitTest time reduced from 18 minutes to 12 minutes.
   <img width="1050" alt="Screenshot 2023-07-06 at 12 51 21 PM" src="https://github.com/apache/kafka/assets/54128896/dc0e0518-b675-4140-b140-91ea0bd992a5">
   <img width="1040" alt="Screenshot 2023-07-06 at 12 52 33 PM" src="https://github.com/apache/kafka/assets/54128896/7d0afcce-47c9-45b8-b4be-a9715d3faeff">
   
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [x] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] eziosudo commented on a diff in pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "eziosudo (via GitHub)" <gi...@apache.org>.
eziosudo commented on code in PR #13973:
URL: https://github.com/apache/kafka/pull/13973#discussion_r1257387868


##########
streams/src/test/java/org/apache/kafka/streams/integration/MetricsIntegrationTest.java:
##########
@@ -68,6 +69,7 @@
 
 @Timeout(600)
 @Category({IntegrationTest.class})
+@Tag("integration")

Review Comment:
   Hi, thank you for telling "The latter is used by JUnit5 and former is used by JUnit4". I did more investigation, now I understand the difference. We do not need both annotations here, will fix this.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] eziosudo commented on pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "eziosudo (via GitHub)" <gi...@apache.org>.
eziosudo commented on PR #13973:
URL: https://github.com/apache/kafka/pull/13973#issuecomment-1625780465

   @divijvaidya Hi, can you help to review this PR?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] divijvaidya commented on pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #13973:
URL: https://github.com/apache/kafka/pull/13973#issuecomment-1629291572

   Thank you for addressing the comments. Are the results in the description updated after the latest change? If not, can you please update them. My motivation of asking this is to ensure that we are not accidentally removing the tests from running in either unitTest or integTests. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] divijvaidya commented on a diff in pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on code in PR #13973:
URL: https://github.com/apache/kafka/pull/13973#discussion_r1257227758


##########
streams/src/test/java/org/apache/kafka/streams/integration/MetricsIntegrationTest.java:
##########
@@ -68,6 +69,7 @@
 
 @Timeout(600)
 @Category({IntegrationTest.class})
+@Tag("integration")

Review Comment:
   Do we need both the annotations here? The latter is used by JUnit5 and former is used by JUnit4. You can consult the build logic at the following place to check how we use these tags.
   https://github.com/apache/kafka/blob/d481163d55a1cea3206fa6e386b24ac84e17c3d7/build.gradle#L473



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] eziosudo commented on a diff in pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "eziosudo (via GitHub)" <gi...@apache.org>.
eziosudo commented on code in PR #13973:
URL: https://github.com/apache/kafka/pull/13973#discussion_r1257378010


##########
streams/src/test/java/org/apache/kafka/streams/integration/MetricsIntegrationTest.java:
##########
@@ -68,6 +69,7 @@
 
 @Timeout(600)
 @Category({IntegrationTest.class})
+@Tag("integration")

Review Comment:
   I saw the build logic in 'build.gradle' file and I was confused because it excluded two tags here, but in the same test folder (.../streams/integration/utils) some tests only have @Category(IntegrationTest.class) were excluded from unitTest while some were not. For example, AbstractJoinIntegrationTest.java and MetricsReporterIntegrationTest.java both have "@Category({IntegrationTest.class})" annotation but the former could be excluded from unitTest while the latter not. 
   
   https://github.com/apache/kafka/blob/d481163d55a1cea3206fa6e386b24ac84e17c3d7/build.gradle#L517C1-L519C62
   
   So I didn't remove it since I was not sure if it is used in other scopes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] divijvaidya commented on pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya commented on PR #13973:
URL: https://github.com/apache/kafka/pull/13973#issuecomment-1632374675

   Thank you for the change. I have verified that the modified tests are running as part of the CI as well. Merging in.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] divijvaidya merged pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "divijvaidya (via GitHub)" <gi...@apache.org>.
divijvaidya merged PR #13973:
URL: https://github.com/apache/kafka/pull/13973


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] eziosudo commented on a diff in pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "eziosudo (via GitHub)" <gi...@apache.org>.
eziosudo commented on code in PR #13973:
URL: https://github.com/apache/kafka/pull/13973#discussion_r1257378010


##########
streams/src/test/java/org/apache/kafka/streams/integration/MetricsIntegrationTest.java:
##########
@@ -68,6 +69,7 @@
 
 @Timeout(600)
 @Category({IntegrationTest.class})
+@Tag("integration")

Review Comment:
   I saw the build logic in 'build.gradle' file and I was confused because it excluded two tags here, but in the same test folder (.../streams/integration/utils) some tests only have @Category(IntegrationTest.class) were excluded from unitTest while some were not. For example, AbstractJoinIntegrationTest.java and MetricsReporterIntegrationTest.java both have "@Category({IntegrationTest.class})" annotation but the former could be excluded from unitTest while the latter not. 
   
   https://github.com/apache/kafka/blob/d481163d55a1cea3206fa6e386b24ac84e17c3d7/build.gradle#L517-L519
   
   So I didn't remove it since I was not sure if it is used in other scopes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [kafka] eziosudo commented on pull request #13973: KAFKA-15148: Some integration tests are running as unit tests

Posted by "eziosudo (via GitHub)" <gi...@apache.org>.
eziosudo commented on PR #13973:
URL: https://github.com/apache/kafka/pull/13973#issuecomment-1631271129

   > Thank you for addressing the comments. Are the results in the description updated after the latest change? If not, can you please update them. My motivation of asking this is to ensure that we are not accidentally removing the tests from running in either unitTest or integTests.
   
   I agree. We shall be careful with every merge. So I run all the tests agian.
   
   These are integration tests in trunk branch after running './gradlew unitTest':
   <img width="1130" alt="image" src="https://github.com/apache/kafka/assets/54128896/80ea1f96-9aea-4779-a77a-3790a570889b">
   
   In my branch I run './gradlew unitTest' then filter integration tests and got nothing, which means integration cases are excluded.
   <img width="651" alt="image" src="https://github.com/apache/kafka/assets/54128896/6c4d632a-cc90-4937-ba0a-fb1ea116259a">
   
   After run './gradle integrationTest' in my branch, I get all the integration tests I changed in this PR, which means they are all included.
   <img width="1183" alt="image" src="https://github.com/apache/kafka/assets/54128896/56837acc-999d-4c34-8ee2-9fc1d1636b77">
   <img width="1045" alt="image" src="https://github.com/apache/kafka/assets/54128896/73e98e5d-0aaa-4ca7-af93-2398eb00181b">
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org