Skip to content

Commit 6e4e386

Browse files
fix: move withSetFile test to correct nested class
The withSetFile test was incorrectly placed in the WithCrds nested class, which has a tearDown() method that tries to uninstall "upgrade-crd-release". However, the withSetFile test creates a release named "upgrade-with-set-file", causing the tearDown to fail with "release: not found". Moving the test to the Valid nested class fixes this issue.
1 parent 4f6ad14 commit 6e4e386

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

helm-java/src/test/java/com/marcnuri/helm/HelmKubernetesTest.java

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,24 @@ void skipCrdsWithoutCrdsInChart() {
646646
.returns("2", Release::getRevision)
647647
.returns("deployed", Release::getStatus);
648648
}
649+
650+
@Test
651+
void withSetFile(@TempDir Path tempDir) throws IOException {
652+
final Path configFile = Files.write(tempDir.resolve("upgrade-config.txt"),
653+
"foobar".getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE);
654+
helm.install().withName("upgrade-with-set-file").withKubeConfig(kubeConfigFile).call();
655+
final Release result = helm.upgrade()
656+
.withKubeConfig(kubeConfigFile)
657+
.withName("upgrade-with-set-file")
658+
.setFile("configData", configFile)
659+
.debug()
660+
.call();
661+
assertThat(result)
662+
.returns("2", Release::getRevision)
663+
.returns("deployed", Release::getStatus)
664+
.extracting(Release::getOutput).asString()
665+
.contains("configData: foobar");
666+
}
649667
}
650668

651669
@Nested
@@ -716,24 +734,6 @@ void skipCrdsExcludesCrds() {
716734
.doesNotContain("creating 1 resource(s)") // CRD creation
717735
.contains("creating 3 resource(s)"); // Rest of the resources
718736
}
719-
720-
@Test
721-
void withSetFile(@TempDir Path tempDir) throws IOException {
722-
final Path configFile = Files.write(tempDir.resolve("upgrade-config.txt"),
723-
"foobar".getBytes(StandardCharsets.UTF_8), StandardOpenOption.CREATE);
724-
helm.install().withName("upgrade-with-set-file").withKubeConfig(kubeConfigFile).call();
725-
final Release result = helm.upgrade()
726-
.withKubeConfig(kubeConfigFile)
727-
.withName("upgrade-with-set-file")
728-
.setFile("configData", configFile)
729-
.debug()
730-
.call();
731-
assertThat(result)
732-
.returns("2", Release::getRevision)
733-
.returns("deployed", Release::getStatus)
734-
.extracting(Release::getOutput).asString()
735-
.contains("configData: foobar");
736-
}
737737
}
738738

739739
@Nested

0 commit comments

Comments
 (0)