You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/09/04 14:34:58 UTC
[GitHub] [nifi] exceptionfactory opened a new pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
exceptionfactory opened a new pull request #5368:
URL: https://github.com/apache/nifi/pull/5368
#### Description of PR
NIFI-9141 Refactors modules in nifi-provenance-repository-bundle using JUnit 5. Additional changes include reduction of debug logging and removal of conditional cipher key length checks.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [X] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [X] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [X] Has your PR been rebased against the latest commit within the target branch (typically `main`)?
- [X] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
### For code changes:
- [X] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
- [X] Have you written or updated unit tests to verify your changes?
- [X] Have you verified that the full build is successful on JDK 8?
- [X] Have you verified that the full build is successful on JDK 11?
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`?
- [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
- [ ] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] MikeThomsen commented on a change in pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
MikeThomsen commented on a change in pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#discussion_r702448118
##########
File path: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/ITestPersistentProvenanceRepository.java
##########
@@ -1307,13 +1186,12 @@ public boolean isAuthorized(ProvenanceEventRecord event, NiFiUser user) {
assertEquals(7, events.size());
final List<Long> eventIds = events.stream().map(event -> event.getEventId()).sorted().collect(Collectors.toList());
for (int i = 0; i < 7; i++) {
- Assert.assertEquals(i + 3, eventIds.get(i).intValue());
+ assertEquals(i + 3, eventIds.get(i).intValue());
}
}
- @Test(timeout = 10000)
+ @Test
Review comment:
We should probably put an @Timeout here to keep the behavior consistent.
##########
File path: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/ITestPersistentProvenanceRepository.java
##########
@@ -504,7 +485,6 @@ public void testIndexOnRolloverWithImmenseAttribute() throws IOException {
@Test
public void testIndexOnRolloverAndSubsequentSearch() throws IOException, InterruptedException, ParseException {
- assumeFalse(isWindowsEnvironment());
Review comment:
Shouldn't these have `@DisabledOnOs(OS.WINDOWS)` on them?
##########
File path: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/ITestPersistentProvenanceRepository.java
##########
@@ -1250,17 +1135,11 @@ public void authorize(ProvenanceEventRecord event, NiFiUser user) {
repo.waitForRollover();
- try {
- repo.getEvent(0L, null);
- Assert.fail("getEvent() did not throw an Exception");
- } catch (final Exception e) {
- Assert.assertSame(expectedException, e);
- }
+ assertThrows(expectedException.getClass(), () -> repo.getEvent(0, null));
}
@Test
public void testNotAuthorizedGetEventRange() throws IOException {
- assumeFalse(isWindowsEnvironment());
Review comment:
Why no DisabledOnOs?
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory commented on a change in pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#discussion_r702913747
##########
File path: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/ITestPersistentProvenanceRepository.java
##########
@@ -1307,13 +1186,12 @@ public boolean isAuthorized(ProvenanceEventRecord event, NiFiUser user) {
assertEquals(7, events.size());
final List<Long> eventIds = events.stream().map(event -> event.getEventId()).sorted().collect(Collectors.toList());
for (int i = 0; i < 7; i++) {
- Assert.assertEquals(i + 3, eventIds.get(i).intValue());
+ assertEquals(i + 3, eventIds.get(i).intValue());
}
}
- @Test(timeout = 10000)
+ @Test
Review comment:
Thanks for pointing that out. The test class had a variety of timeouts on different methods. As an integration test, the individual methods completed with a short duration, so I will add a class-level Timeout and revisit other updated tests.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] MikeThomsen commented on a change in pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
MikeThomsen commented on a change in pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#discussion_r702944281
##########
File path: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/ITestPersistentProvenanceRepository.java
##########
@@ -504,7 +485,6 @@ public void testIndexOnRolloverWithImmenseAttribute() throws IOException {
@Test
public void testIndexOnRolloverAndSubsequentSearch() throws IOException, InterruptedException, ParseException {
- assumeFalse(isWindowsEnvironment());
Review comment:
I'm fine with leaving it as-is based on your response.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory commented on a change in pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#discussion_r702909195
##########
File path: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/ITestPersistentProvenanceRepository.java
##########
@@ -1250,17 +1135,11 @@ public void authorize(ProvenanceEventRecord event, NiFiUser user) {
repo.waitForRollover();
- try {
- repo.getEvent(0L, null);
- Assert.fail("getEvent() did not throw an Exception");
- } catch (final Exception e) {
- Assert.assertSame(expectedException, e);
- }
+ assertThrows(expectedException.getClass(), () -> repo.getEvent(0, null));
}
@Test
public void testNotAuthorizedGetEventRange() throws IOException {
- assumeFalse(isWindowsEnvironment());
Review comment:
As mentioned in the other note, I could add the annotation at the class level, but it seems unnecessary now that this is an integration test instead of a unit test.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory commented on pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#issuecomment-913667777
Thanks for the feedback @MikeThomsen, I pushed an update to include class `Timeout` annotations for test classes that had previous method-based timeouts.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory commented on pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#issuecomment-914494173
Thanks @MikeThomsen!
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] asfgit closed pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #5368:
URL: https://github.com/apache/nifi/pull/5368
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] exceptionfactory commented on a change in pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#discussion_r702905489
##########
File path: nifi-nar-bundles/nifi-provenance-repository-bundle/nifi-persistent-provenance-repository/src/test/java/org/apache/nifi/provenance/ITestPersistentProvenanceRepository.java
##########
@@ -504,7 +485,6 @@ public void testIndexOnRolloverWithImmenseAttribute() throws IOException {
@Test
public void testIndexOnRolloverAndSubsequentSearch() throws IOException, InterruptedException, ParseException {
- assumeFalse(isWindowsEnvironment());
Review comment:
I considered adding the annotation, but since this is an integration test, it is not run automatically. It looks like the test was originally a unit test that was changed to an integration test for performance reasons. Since it doesn't run automatically, and does not appear to have platform-specific operations, it seems better to leave off the `DisabledOnOs` annotation, but I can add it at the class level if you think it still makes sense to retain.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nifi] MikeThomsen commented on pull request #5368: NIFI-9141 Refactored nifi-provenance-repository-bundle using JUnit 5
Posted by GitBox <gi...@apache.org>.
MikeThomsen commented on pull request #5368:
URL: https://github.com/apache/nifi/pull/5368#issuecomment-914493446
I'm going to let the current build finish before merging.
--
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: issues-unsubscribe@nifi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org