@@ -210,7 +210,8 @@ void withoutSkipCrdsInstallsCrds() {
210210 .returns ("helm-install-with-crds" , Release ::getName )
211211 .returns ("deployed" , Release ::getStatus )
212212 .extracting (Release ::getOutput ).asString ()
213- .contains ("installwidgets.helm-java.example.com" );
213+ .contains ("creating 1 resource(s)" ) // CRD creation
214+ .contains ("creating 3 resource(s)" ); // Rest of the resources
214215 }
215216
216217 @ Test
@@ -225,7 +226,8 @@ void skipCrdsDoesNotInstallCrds() {
225226 .returns ("helm-install-skip-crds" , Release ::getName )
226227 .returns ("deployed" , Release ::getStatus )
227228 .extracting (Release ::getOutput ).asString ()
228- .doesNotContain ("installwidgets.helm-java.example.com" );
229+ .doesNotContain ("creating 1 resource(s)" ) // CRD creation
230+ .contains ("creating 3 resource(s)" ); // Rest of the resources
229231 }
230232 }
231233
@@ -662,38 +664,44 @@ void setUp() throws IOException {
662664 " openAPIV3Schema:\n " +
663665 " type: object\n " ).getBytes (StandardCharsets .UTF_8 ),
664666 StandardOpenOption .CREATE );
665- // Install the chart first to have a release to upgrade
666- helmWithCrds . install ()
667- . withKubeConfig ( kubeConfigFile )
668- . withName ( "upgrade-crd-release" )
669- .call ();
667+ }
668+
669+ @ AfterEach
670+ void tearDown () {
671+ Helm . uninstall ( "upgrade-crd-release" ). withKubeConfig ( kubeConfigFile ) .call ();
670672 }
671673
672674 @ Test
673675 void withoutSkipCrdsIncludesCrds () {
674676 final Release result = helmWithCrds .upgrade ()
675677 .withKubeConfig (kubeConfigFile )
676678 .withName ("upgrade-crd-release" )
679+ .install ()// Forces an installation if no prior release exists (including CRDs)
677680 .debug ()
678681 .call ();
679682 assertThat (result )
680- .returns ("2" , Release ::getRevision )
681- .returns ("deployed" , Release ::getStatus );
683+ .returns ("1" , Release ::getRevision )
684+ .returns ("deployed" , Release ::getStatus )
685+ .extracting (Release ::getOutput ).asString ()
686+ .contains ("creating 1 resource(s)" ) // CRD creation
687+ .contains ("creating 3 resource(s)" ); // Rest of the resources
682688 }
683689
684690 @ Test
685691 void skipCrdsExcludesCrds () {
686692 final Release result = helmWithCrds .upgrade ()
687693 .withKubeConfig (kubeConfigFile )
688694 .withName ("upgrade-crd-release" )
695+ .install () // Forces an installation if no prior release exists (including CRDs)
689696 .skipCrds ()
690697 .debug ()
691698 .call ();
692699 assertThat (result )
693- .returns ("2 " , Release ::getRevision )
700+ .returns ("1 " , Release ::getRevision )
694701 .returns ("deployed" , Release ::getStatus )
695702 .extracting (Release ::getOutput ).asString ()
696- .doesNotContain ("upgradewidgets.helm-java.example.com" );
703+ .doesNotContain ("creating 1 resource(s)" ) // CRD creation
704+ .contains ("creating 3 resource(s)" ); // Rest of the resources
697705 }
698706 }
699707
0 commit comments