Skip to content

Conversation

@jace-roell
Copy link
Contributor

What It Does

How to Test

Review Checklist
I certify that I have:

Additional Comments

traeok and others added 8 commits October 24, 2025 18:24
* 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]>
@github-project-automation github-project-automation bot moved this to New Issues in Zowe CLI Squad Oct 29, 2025
@zowe-robot zowe-robot moved this from New Issues to In Progress in Zowe CLI Squad Oct 29, 2025
@github-actions
Copy link

github-actions bot commented Oct 29, 2025

Signed-off-by: jace-roell <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 29, 2025

Base automatically changed from feat/test-utils to main October 29, 2025 20:44

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

Poorly documented function: fewer than 2% comments for a function of 464 lines.

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.


Suggested changeset 1
native/c/test/uss.test.cpp

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/native/c/test/uss.test.cpp b/native/c/test/uss.test.cpp
--- a/native/c/test/uss.test.cpp
+++ b/native/c/test/uss.test.cpp
@@ -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
 }
\ No newline at end of file
EOF
@@ -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
}
Copilot is powered by AI and may make mistakes. Always verify output.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
5.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

4 participants