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 2022/01/18 11:31:01 UTC

[GitHub] [nifi-minifi-cpp] lordgamez opened a new pull request #1243: MINIFICPP-1696 Clean up the condition checking in behavior-based tests

lordgamez opened a new pull request #1243:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1243


   https://issues.apache.org/jira/browse/MINIFICPP-1696
   
   ---------------------------------------------------------------
   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   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 MINIFICPP-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 main)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code 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?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### 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 results 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-minifi-cpp] adamdebreceni closed pull request #1243: MINIFICPP-1696 Clean up the condition checking in behavior-based tests

Posted by GitBox <gi...@apache.org>.
adamdebreceni closed pull request #1243:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1243


   


-- 
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-minifi-cpp] szaszm commented on a change in pull request #1243: MINIFICPP-1696 Clean up the condition checking in behavior-based tests

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1243:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1243#discussion_r786677842



##########
File path: docker/test/integration/MiNiFi_integration_test_driver.py
##########
@@ -118,57 +118,57 @@ def rm_out_child(self):
     def add_file_system_observer(self, file_system_observer):
         self.file_system_observer = file_system_observer
 
-    def check_for_no_files_generated(self, timeout_seconds):
+    def check_for_no_files_generated(self, wait_time_in_seconds):
         output_validator = NoFileOutPutValidator()
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output_after_time_period(wait_time_in_seconds, output_validator)
 
     def check_for_single_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleFileOutputValidator(decode_escaped_str(content))
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
     def check_for_single_json_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleJSONFileOutputValidator(content)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
     def check_for_multiple_files_generated(self, file_count, timeout_seconds, expected_content=[]):
         output_validator = MultiFileOutputValidator(file_count, [decode_escaped_str(content) for content in expected_content])
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, file_count)
+        self.__check_output(timeout_seconds, output_validator, file_count)
 
     def check_for_at_least_one_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleOrMultiFileOutputValidator(decode_escaped_str(content))
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        expected_number_of_files = timeout_seconds
-        self.check_output(timeout_seconds, output_validator, expected_number_of_files)
+        self.__check_output(timeout_seconds, output_validator)
 
     def check_for_num_files_generated(self, num_flowfiles, timeout_seconds):
         output_validator = NoContentCheckFileNumberValidator(num_flowfiles)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, max(1, num_flowfiles))
+        self.__check_output(timeout_seconds, output_validator, max(1, num_flowfiles))
 
-    def check_for_num_file_range_generated(self, min_files, max_files, timeout_seconds):
+    def check_for_num_file_range_generated(self, min_files, max_files, wait_time_in_seconds):
         output_validator = NumFileRangeValidator(min_files, max_files)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output_force_wait(timeout_seconds, output_validator)
+        self.__check_output_after_time_period(wait_time_in_seconds, output_validator)
 
     def check_for_an_empty_file_generated(self, timeout_seconds):
         output_validator = EmptyFilesOutPutValidator()
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
-    def check_output_force_wait(self, timeout_seconds, output_validator):
-        time.sleep(timeout_seconds)
-        self.validate(output_validator)
+    def __check_output_after_time_period(self, wait_time_in_seconds, output_validator):

Review comment:
       Did you mean to make these "private"? According to some random internet sources, a double underscore prefix makes the interpreter use name mangling to avoid subclasses overriding these, but I see no subclasses here. The usual way to say "private" is a single underscore prefix, which seems more appropriate here, but let me know if I'm wrong.




-- 
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-minifi-cpp] lordgamez commented on a change in pull request #1243: MINIFICPP-1696 Clean up the condition checking in behavior-based tests

Posted by GitBox <gi...@apache.org>.
lordgamez commented on a change in pull request #1243:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1243#discussion_r786685508



##########
File path: docker/test/integration/MiNiFi_integration_test_driver.py
##########
@@ -118,57 +118,57 @@ def rm_out_child(self):
     def add_file_system_observer(self, file_system_observer):
         self.file_system_observer = file_system_observer
 
-    def check_for_no_files_generated(self, timeout_seconds):
+    def check_for_no_files_generated(self, wait_time_in_seconds):
         output_validator = NoFileOutPutValidator()
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output_after_time_period(wait_time_in_seconds, output_validator)
 
     def check_for_single_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleFileOutputValidator(decode_escaped_str(content))
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
     def check_for_single_json_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleJSONFileOutputValidator(content)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
     def check_for_multiple_files_generated(self, file_count, timeout_seconds, expected_content=[]):
         output_validator = MultiFileOutputValidator(file_count, [decode_escaped_str(content) for content in expected_content])
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, file_count)
+        self.__check_output(timeout_seconds, output_validator, file_count)
 
     def check_for_at_least_one_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleOrMultiFileOutputValidator(decode_escaped_str(content))
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        expected_number_of_files = timeout_seconds
-        self.check_output(timeout_seconds, output_validator, expected_number_of_files)
+        self.__check_output(timeout_seconds, output_validator)
 
     def check_for_num_files_generated(self, num_flowfiles, timeout_seconds):
         output_validator = NoContentCheckFileNumberValidator(num_flowfiles)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, max(1, num_flowfiles))
+        self.__check_output(timeout_seconds, output_validator, max(1, num_flowfiles))
 
-    def check_for_num_file_range_generated(self, min_files, max_files, timeout_seconds):
+    def check_for_num_file_range_generated(self, min_files, max_files, wait_time_in_seconds):
         output_validator = NumFileRangeValidator(min_files, max_files)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output_force_wait(timeout_seconds, output_validator)
+        self.__check_output_after_time_period(wait_time_in_seconds, output_validator)
 
     def check_for_an_empty_file_generated(self, timeout_seconds):
         output_validator = EmptyFilesOutPutValidator()
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
-    def check_output_force_wait(self, timeout_seconds, output_validator):
-        time.sleep(timeout_seconds)
-        self.validate(output_validator)
+    def __check_output_after_time_period(self, wait_time_in_seconds, output_validator):

Review comment:
       I usually use the double underscore for making a member "private" because of the mangling to make it harder for a user of the class to call it. I was not aware that it is only used for subclasses not to override these. In my understanding it was usually to use double underscore for private, single for protected and none for public members and I would default to using "private" members if no subclasses are there to use them.




-- 
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-minifi-cpp] szaszm commented on a change in pull request #1243: MINIFICPP-1696 Clean up the condition checking in behavior-based tests

Posted by GitBox <gi...@apache.org>.
szaszm commented on a change in pull request #1243:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1243#discussion_r786688764



##########
File path: docker/test/integration/MiNiFi_integration_test_driver.py
##########
@@ -118,57 +118,57 @@ def rm_out_child(self):
     def add_file_system_observer(self, file_system_observer):
         self.file_system_observer = file_system_observer
 
-    def check_for_no_files_generated(self, timeout_seconds):
+    def check_for_no_files_generated(self, wait_time_in_seconds):
         output_validator = NoFileOutPutValidator()
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output_after_time_period(wait_time_in_seconds, output_validator)
 
     def check_for_single_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleFileOutputValidator(decode_escaped_str(content))
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
     def check_for_single_json_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleJSONFileOutputValidator(content)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
     def check_for_multiple_files_generated(self, file_count, timeout_seconds, expected_content=[]):
         output_validator = MultiFileOutputValidator(file_count, [decode_escaped_str(content) for content in expected_content])
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, file_count)
+        self.__check_output(timeout_seconds, output_validator, file_count)
 
     def check_for_at_least_one_file_with_content_generated(self, content, timeout_seconds):
         output_validator = SingleOrMultiFileOutputValidator(decode_escaped_str(content))
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        expected_number_of_files = timeout_seconds
-        self.check_output(timeout_seconds, output_validator, expected_number_of_files)
+        self.__check_output(timeout_seconds, output_validator)
 
     def check_for_num_files_generated(self, num_flowfiles, timeout_seconds):
         output_validator = NoContentCheckFileNumberValidator(num_flowfiles)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, max(1, num_flowfiles))
+        self.__check_output(timeout_seconds, output_validator, max(1, num_flowfiles))
 
-    def check_for_num_file_range_generated(self, min_files, max_files, timeout_seconds):
+    def check_for_num_file_range_generated(self, min_files, max_files, wait_time_in_seconds):
         output_validator = NumFileRangeValidator(min_files, max_files)
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output_force_wait(timeout_seconds, output_validator)
+        self.__check_output_after_time_period(wait_time_in_seconds, output_validator)
 
     def check_for_an_empty_file_generated(self, timeout_seconds):
         output_validator = EmptyFilesOutPutValidator()
         output_validator.set_output_dir(self.file_system_observer.get_output_dir())
-        self.check_output(timeout_seconds, output_validator, 1)
+        self.__check_output(timeout_seconds, output_validator, 1)
 
-    def check_output_force_wait(self, timeout_seconds, output_validator):
-        time.sleep(timeout_seconds)
-        self.validate(output_validator)
+    def __check_output_after_time_period(self, wait_time_in_seconds, output_validator):

Review comment:
       Okay, this sounds reasonable. Thanks for clarifying.




-- 
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