- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1
Zowex uss system tests #626
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
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: Trae Yelovich <[email protected]>
* fix: false-positives for deploy dir in VSCE Signed-off-by: Trae Yelovich <[email protected]> * refactor: make validate fn separate, add tests for it Signed-off-by: Trae Yelovich <[email protected]> * chore: sdk changelog Signed-off-by: Trae Yelovich <[email protected]> * refactor: only remove tilde at beginning of path Signed-off-by: Trae Yelovich <[email protected]> * fix: avoid use of bind as it seems unreliable Signed-off-by: Trae Yelovich <[email protected]> --------- Signed-off-by: Trae Yelovich <[email protected]>
Signed-off-by: jace-roell <[email protected]>
| Server artifacts: | 
Signed-off-by: jace-roell <[email protected]>
| Client artifacts: | 
Signed-off-by: jace-roell <[email protected]>
Signed-off-by: jace-roell <[email protected]>
Signed-off-by: jace-roell <[email protected]>
Signed-off-by: jace-roell <[email protected]>
Signed-off-by: Jace Roell <[email protected]>
|  | ||
| const string zowex_command = "./../build-out/zowex"; | ||
| const string ussTestDir = "/tmp/zowex-uss"; | ||
| void uss_tests() | 
Check warning
Code scanning / CodeQL
Poorly documented large function Warning test
          
            
              
                
              
            
            Show autofix suggestion
            Hide autofix suggestion
          
      Copilot Autofix
AI about 2 hours ago
To fix this problem, we should add high-level documentation comments describing the overall purpose of the uss_tests function and introduce inline comments throughout the function to clarify the roles of major code sections, such as test setup, utility lambdas, and individual test suites/cases. This will improve maintainability and readability without altering any logic or flow of the tests. Only the native/c/test/uss.test.cpp file needs editing, restricted to the body of the uss_tests function. No new imports, methods, or definitions are necessary for this kind of documentation fix; only comments need to be added.
- 
    
    
    Copy modified lines R25-R33 
- 
    
    
    Copy modified line R36 
- 
    
    
    Copy modified line R42 
- 
    
    
    Copy modified line R45 
- 
    
    
    Copy modified line R48 
- 
    
    
    Copy modified line R52 
- 
    
    
    Copy modified line R47 
- 
    
    
    Copy modified line R56 
- 
    
    
    Copy modified line R126 
- 
    
    
    Copy modified line R490 
| @@ -22,20 +22,34 @@ | ||
|  | ||
| const string zowex_command = "./../build-out/zowex"; | ||
| const string ussTestDir = "/tmp/zowex-uss"; | ||
| /** | ||
| * @brief End-to-end functional tests for USS (Unix System Services) operations | ||
| * | ||
| * This function defines a series of test suites and test cases to verify basic USS operations such as | ||
| * file and directory creation, permission changes, user/group changes, and deletion within the USS environment. | ||
| * It sets up and tears down test infrastructure, provides utility helper functions for use in tests, | ||
| * and organizes functionality into logically grouped "describe" blocks. Each test validates the proper behavior | ||
| * of the target command-line interface using Zowe's command executor. | ||
| */ | ||
| void uss_tests() | ||
| { | ||
| // Top-level USS functional test suite | ||
| describe("uss tests", | ||
| []() -> void | ||
| { | ||
| int rc; | ||
| string response; | ||
| // Set up test directory before running all USS tests | ||
| beforeAll([&response]() -> void | ||
| { execute_command_with_output(zowex_command + " uss create-dir " + ussTestDir + " --mode 777", response); }); | ||
| // Reset return code before each test | ||
| beforeEach([&rc]() -> void | ||
| { rc = 0; }); | ||
| // Uncomment to clean up the test directory after all tests if desired | ||
| // afterAll([&response]() -> void | ||
| // { execute_command_with_output(zowex_command + " uss delete /tmp/zowex-uss --recursive", response); }); | ||
|  | ||
| // Helper lambda for easily creating a test file via USS command | ||
| auto create_test_file_cmd = [&](const string &uss_file, const string &options = "") -> void | ||
| { | ||
| string command = zowex_command + " uss create-file " + uss_file + " " + options; | ||
| @@ -44,6 +44,7 @@ | ||
| Expect(response).ToContain("USS file '" + uss_file + "' created"); | ||
| }; | ||
|  | ||
| // Helper lambda for easily creating a test directory via USS command | ||
| auto create_test_dir_cmd = [&](const string &uss_dir, const string &options = "") -> void | ||
| { | ||
| string command = zowex_command + " uss create-dir " + uss_dir + " " + options; | ||
| @@ -52,6 +53,7 @@ | ||
| Expect(response).ToContain("USS directory '" + uss_dir + "' created"); | ||
| }; | ||
|  | ||
| // Test suite for verifying "chmod" functionality on USS | ||
| describe("chmod", | ||
| [&]() -> void | ||
| { | ||
| @@ -121,6 +123,7 @@ | ||
| Expect(response).ToContain("Path '" + uss_file + "' does not exist"); | ||
| }); | ||
| }); | ||
| // Test suite for verifying "chown" and "chgrp" functionality on USS | ||
| describe("chown", | ||
| [&]() -> void | ||
| { | ||
| @@ -484,5 +487,5 @@ | ||
| Expect(view_response).ToContain("Hello World!"); | ||
| }); | ||
| }); | ||
| }); | ||
| }); // End top-level USS test suite | ||
| } | 
Signed-off-by: jace-roell <[email protected]>
Signed-off-by: jace-roell <[email protected]>
Signed-off-by: Timothy Johnson <[email protected]>
| 
 | 


What It Does
How to Test
Review Checklist
I certify that I have:
Additional Comments