Pochatkin commented on code in PR #7402:
URL: https://github.com/apache/ignite-3/pull/7402#discussion_r2687207560
##########
modules/cli/src/integrationTest/java/org/apache/ignite/internal/cli/commands/unit/ItDeploymentUnitTest.java:
##########
@@ -323,6 +323,80 @@ void deploySemantic() {
});
}
+ @Test
+ @DisplayName("Should deploy a unit from directory with subdirectories
using --recursive")
+ void deployRecursive() throws IOException {
+ // Given a directory with subdirectories
+ Path recursiveDir =
Files.createDirectory(WORK_DIR.resolve("recursive-test"));
+ Path subDir = Files.createDirectory(recursiveDir.resolve("subdir"));
+ Files.createFile(recursiveDir.resolve("root-file.txt"));
+ Files.createFile(subDir.resolve("nested-file.txt"));
+
+ // When deploy with --recursive option
+ execute("cluster", "unit", "deploy", "test.unit.recursive.1",
"--version", "1.0.0",
+ "--path", recursiveDir.toString(), "--recursive");
+
+ // Then
+ assertAll(
+ this::assertExitCodeIsZero,
+ this::assertErrOutputIsEmpty,
+ () -> assertOutputContains("Done")
+ );
+
+ // And unit is deployed
+ await().untilAsserted(() -> {
+ execute("cluster", "unit", "list", "--plain",
"test.unit.recursive.1");
+
+ assertDeployed("test.unit.recursive.1");
+ });
+ }
+
+ @Test
+ @DisplayName("Should deploy a unit from deeply nested directory using
--recursive")
+ void deployRecursiveDeepNesting() throws IOException {
+ // Given a directory with deeply nested subdirectories
+ Path deepDir = Files.createDirectory(WORK_DIR.resolve("deep-test"));
+ Path level1 = Files.createDirectory(deepDir.resolve("level1"));
+ Path level2 = Files.createDirectory(level1.resolve("level2"));
+ Path level3 = Files.createDirectory(level2.resolve("level3"));
+ Files.createFile(deepDir.resolve("root.txt"));
+ Files.createFile(level1.resolve("file1.txt"));
+ Files.createFile(level2.resolve("file2.txt"));
+ Files.createFile(level3.resolve("file3.txt"));
+
+ // When deploy with --recursive option
+ execute("cluster", "unit", "deploy", "test.unit.recursive.2",
"--version", "1.0.0",
+ "--path", deepDir.toString(), "--recursive");
+
+ // Then
+ assertAll(
+ this::assertExitCodeIsZero,
+ this::assertErrOutputIsEmpty,
+ () -> assertOutputContains("Done")
+ );
+
+ // And unit is deployed
+ await().untilAsserted(() -> {
+ execute("cluster", "unit", "list", "--plain",
"test.unit.recursive.2");
+
+ assertDeployed("test.unit.recursive.2");
+ });
+ }
+
+ @Test
+ @DisplayName("Should display error when --recursive is used with a file
path")
Review Comment:
Fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]