- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
test(zowex): Add system tests for zowex data-set commands #622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| Client artifacts: | 
5ae6772    to
    e1dbf28      
    Compare
  
    e1dbf28    to
    fa90f02      
    Compare
  
    | I know it's early, but can you include: 
 | 
| const char *debug = getenv("ZNP_TEST_LOG"); | ||
| if (debug == nullptr || strstr(debug, "ON") != nullptr) | ||
| { | ||
| pad_nesting(get_nesting()); | 
Check warning
Code scanning / CodeQL
Expression has no effect Warning test
pad_nesting
          
            
              
                
              
            
            Show autofix suggestion
            Hide autofix suggestion
          
      Copilot Autofix
AI 1 day ago
The recommended fix for this issue, per static analysis guidance, is to explicitly cast the function call expression to void, using (void)pad_nesting(get_nesting());. This documents that it is executed for its side effect only, and clarifies to reviewers and tools that the function’s return value (void) is intentionally ignored. The only change required is to line 414 of native/c/test/ztest.hpp, within the body of test_log, replacing the plain call to pad_nesting(get_nesting()); with (void)pad_nesting(get_nesting());. No imports or other changes are necessary.
- 
    
    
    Copy modified line R414 
| @@ -411,7 +411,7 @@ | ||
| const char *debug = getenv("ZNP_TEST_LOG"); | ||
| if (debug == nullptr || strstr(debug, "ON") != nullptr) | ||
| { | ||
| pad_nesting(get_nesting()); | ||
| (void)pad_nesting(get_nesting()); | ||
| std::cout << "[TEST_INFO] " << message << std::endl; | ||
| } | ||
| } | 
| int execute_command_with_output(const string &command, string &output) | ||
| { | ||
| output = ""; | ||
| // TestLog("Running: " + command); | 
Check notice
Code scanning / CodeQL
Commented-out code Note test
          
            
              
                
              
            
            Show autofix suggestion
            Hide autofix suggestion
          
      Copilot Autofix
AI 1 day ago
The best way to fix this problem is to remove the commented-out code, as retaining commented-out code leads to code rot and confusion. If the logging functionality is still desired or needed, the author should add a properly enabled logging statement, perhaps with a guard or modern logging mechanism. If it was left for future use or as a suggestion, it should be transformed into a regular code comment, not a commented-out code line.
For minimum intervention and to avoid changing behavior, the fix should be to delete line 38 entirely from native/c/test/ztest.utils.hpp. Only this line must be removed; no imports or other changes are necessary.
| @@ -35,7 +35,6 @@ | ||
| int execute_command_with_output(const string &command, string &output) | ||
| { | ||
| output = ""; | ||
| // TestLog("Running: " + command); | ||
|  | ||
| FILE *pipe = popen((command + " 2>&1").c_str(), "r"); | ||
| if (!pipe) | 
c10f6f9    to
    0398c45      
    Compare
  
    Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
c293a7c    to
    d534517      
    Compare
  
    Signed-off-by: Fernando Rijo Cedeno <[email protected]>
| 
 | 


What It Does
zowex dscommandsZNP_TEST_LOGoptional env-var to turnON|OFFany TestLog calls 🙏ztest.utils.hppwith common functions for zowex testszowex dstests tozowex.ds.test.cppHow to Test
nr z:testReview Checklist
I certify that I have:
Additional Comments