nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi-minifi-cpp] asdaraujo commented on a change in pull request #668: MINIFICPP-1072 - Fixed temporary path for GetFileTests on Windows
Date Wed, 13 Nov 2019 20:03:48 GMT
asdaraujo commented on a change in pull request #668: MINIFICPP-1072 - Fixed temporary path
for GetFileTests on Windows
URL: https://github.com/apache/nifi-minifi-cpp/pull/668#discussion_r345974895
 
 

 ##########
 File path: extensions/standard-processors/tests/unit/GetFileTests.cpp
 ##########
 @@ -52,7 +52,7 @@ TEST_CASE("GetFile: MaxSize", "[getFileFifo]") {  // NOLINT
   std::string in_file = temp_path + utils::file::FileUtils::get_separator() + "testfifo";
 
   // Define test input file
-  std::string hidden_in_file(in_dir);
+  std::string hidden_in_file(temp_path);
 
 Review comment:
   Are you sure it's wrong? It seems right to me.
   
   If you look closely `in_dir` is just a template that is used by `createTempDirectory()`
to generate a unique dir name, which is then assigned to `temp_path`.
   
   The `in_file` path was already built using `temp_path`, but `hidden_in_file` was using
`in_dir` instead, which seems wrong to me and would cause both files to be at different locations.
   
   The test never failed because the Processor would not get the file either way since it
ignores hidden files.
   
   There's one more improvement to be done here: both file paths are constructed in different
ways, which just makes it confusing. I can make them consistent, following your suggestion
above, but using `temp_path` instead:
   
   ```
   // Define test input files
   std::string in_file(temp_path + utils::file::FileUtils::get_separator() + "testfifo");
   std::string hidden_in_file(temp_path + utils::file::FileUtils::get_separator() + ".testfifo")
   ```
   
   @arpadboda Let me know your thoughts.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message