You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by markobean <gi...@git.apache.org> on 2018/04/08 19:22:54 UTC
[GitHub] nifi pull request #2617: NIFI-5055 added ability to unpenalize MockFlowFile ...
GitHub user markobean opened a pull request:
https://github.com/apache/nifi/pull/2617
NIFI-5055 added ability to unpenalize MockFlowFile directly or from M…
…ockProcessSession
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [ ] 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.
- [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
- [ ] Is your initial contribution a single, squashed commit?
### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] 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 travis-ci for build issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/markobean/nifi NIFI-5055
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/2617.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 #2617
----
commit 0e2cc73c4aac0a04a84ad921fed0ce0b0c7cd2a6
Author: Mark Bean <ma...@...>
Date: 2018-04-08T19:03:09Z
NIFI-5055 added ability to unpenalize MockFlowFile directly or from MockProcessSession
----
---
[GitHub] nifi pull request #2617: NIFI-5055 added ability to unpenalize MockFlowFile ...
Posted by markobean <gi...@git.apache.org>.
Github user markobean closed the pull request at:
https://github.com/apache/nifi/pull/2617
---
[GitHub] nifi pull request #2617: NIFI-5055 added ability to unpenalize MockFlowFile ...
Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2617#discussion_r180204173
--- Diff: nifi-mock/src/test/java/org/apache/nifi/util/TestMockProcessSession.java ---
@@ -101,6 +101,17 @@ public void testKeepPenalizedStatusAfterPuttingAttribute(){
assertEquals(true, ff1.isPenalized());
}
+ @Test
+ public void testUnpenalizeFlowFile() {
+ final Processor processor = new PoorlyBehavedProcessor();
+ final MockProcessSession session = new MockProcessSession(new SharedSessionState(processor, new AtomicLong(0L)), processor);
+ FlowFile ff1 = session.createFlowFile("hello, world".getBytes());
+ ff1 = session.penalize(ff1);
+ assertEquals(true, ff1.isPenalized());
+ ff1 = session.unpenalize(ff1);
+ assertEquals(false, ff1.isPenalized());
--- End diff --
Please change to `assertFalse`
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by ottobackwards <gi...@git.apache.org>.
Github user ottobackwards commented on the issue:
https://github.com/apache/nifi/pull/2617
Looks good to me
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by markobean <gi...@git.apache.org>.
Github user markobean commented on the issue:
https://github.com/apache/nifi/pull/2617
Changes committed to master. Closing PR.
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on the issue:
https://github.com/apache/nifi/pull/2617
@markobean You close the PR now. I merged the change.
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:
https://github.com/apache/nifi/pull/2617
That's correct @markobean - it has been merged into master with 274ed46d923e7d080b57ed121596b4ecfa997a2c.
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by markobean <gi...@git.apache.org>.
Github user markobean commented on the issue:
https://github.com/apache/nifi/pull/2617
Updated to use assertTrue and assertFalse. I had simply borrowed assertEquals from the previous unit test. So, while updating, I updated that test to use assertTrue as well. Commit, squashed and pushed.
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by markobean <gi...@git.apache.org>.
Github user markobean commented on the issue:
https://github.com/apache/nifi/pull/2617
So, does this PR need to be manually closed with the "Close and comment" button?
---
[GitHub] nifi pull request #2617: NIFI-5055 added ability to unpenalize MockFlowFile ...
Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2617#discussion_r180204129
--- Diff: nifi-mock/src/test/java/org/apache/nifi/util/TestMockProcessSession.java ---
@@ -101,6 +101,17 @@ public void testKeepPenalizedStatusAfterPuttingAttribute(){
assertEquals(true, ff1.isPenalized());
}
+ @Test
+ public void testUnpenalizeFlowFile() {
+ final Processor processor = new PoorlyBehavedProcessor();
+ final MockProcessSession session = new MockProcessSession(new SharedSessionState(processor, new AtomicLong(0L)), processor);
+ FlowFile ff1 = session.createFlowFile("hello, world".getBytes());
+ ff1 = session.penalize(ff1);
+ assertEquals(true, ff1.isPenalized());
--- End diff --
A little better if it's `assertTrue`
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by pvillard31 <gi...@git.apache.org>.
Github user pvillard31 commented on the issue:
https://github.com/apache/nifi/pull/2617
@MikeThomsen - just fyi, while merging a PR it's highly recommended to amend the commit message to include the magic words that will automatically close the github PR. The commands I usually execute when merging a PR are:
````
git checkout master
git pull origin master
git fetch github
git checkout github/pr/<PR ID>
git checkout -b pr<PR ID>
--- here you can do additional reviewing, maven builds, test with a running instance, etc ---
git commit --amend -s
--- you update the commit message to include "This closes #<PR ID>."
git log
--- the above command is to retrieve the commit ID ---
git checkout master
git cherry-pick <commit ID>
git push origin master
````
This is an example - there are probably other ways to do it.
---
[GitHub] nifi issue #2617: NIFI-5055 added ability to unpenalize MockFlowFile directl...
Posted by MikeThomsen <gi...@git.apache.org>.
Github user MikeThomsen commented on the issue:
https://github.com/apache/nifi/pull/2617
@pvillard31 Thanks. I finally figured it out after doing a second one today.
---