@@ -697,35 +697,117 @@ var _ = Describe("app summary displayer", func() {
697
697
698
698
When ("there is an active deployment" , func () {
699
699
When ("the deployment strategy is rolling" , func () {
700
+ When ("the deployment is in progress" , func () {
701
+ When ("last status change has a timestamp" , func () {
702
+ BeforeEach (func () {
703
+ summary = v7action.DetailedApplicationSummary {
704
+ Deployment : resources.Deployment {
705
+ Strategy : constant .DeploymentStrategyRolling ,
706
+ StatusValue : constant .DeploymentStatusValueActive ,
707
+ StatusReason : constant .DeploymentStatusReasonDeploying ,
708
+ LastStatusChange : "2024-07-29T17:32:29Z" ,
709
+ },
710
+ }
711
+ })
712
+
713
+ It ("displays the message" , func () {
714
+ Expect (testUI .Out ).To (Say (`Rolling deployment currently DEPLOYING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
715
+ })
716
+ })
717
+
718
+ When ("last status change is an empty string" , func () {
719
+ BeforeEach (func () {
720
+ summary = v7action.DetailedApplicationSummary {
721
+ Deployment : resources.Deployment {
722
+ Strategy : constant .DeploymentStrategyRolling ,
723
+ StatusValue : constant .DeploymentStatusValueActive ,
724
+ StatusReason : constant .DeploymentStatusReasonDeploying ,
725
+ LastStatusChange : "" ,
726
+ },
727
+ }
728
+ })
729
+
730
+ It ("displays the message" , func () {
731
+ Expect (testUI .Out ).To (Say (`Rolling deployment currently DEPLOYING\n` ))
732
+ Expect (testUI .Out ).NotTo (Say (`\(since` ))
733
+ })
734
+ })
735
+ })
736
+
737
+ When ("the deployment is cancelled" , func () {
738
+ BeforeEach (func () {
739
+ summary = v7action.DetailedApplicationSummary {
740
+ Deployment : resources.Deployment {
741
+ Strategy : constant .DeploymentStrategyRolling ,
742
+ StatusValue : constant .DeploymentStatusValueActive ,
743
+ StatusReason : constant .DeploymentStatusReasonCanceling ,
744
+ LastStatusChange : "2024-07-29T17:32:29Z" ,
745
+ },
746
+ }
747
+ })
748
+
749
+ It ("displays the message" , func () {
750
+ Expect (testUI .Out ).To (Say (`Rolling deployment currently CANCELING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
751
+ })
752
+ })
753
+ })
754
+ When ("the deployment strategy is canary" , func () {
700
755
When ("the deployment is in progress" , func () {
701
756
BeforeEach (func () {
702
757
summary = v7action.DetailedApplicationSummary {
703
758
Deployment : resources.Deployment {
704
- Strategy : constant .DeploymentStrategyRolling ,
705
- StatusValue : constant .DeploymentStatusValueActive ,
706
- StatusReason : constant .DeploymentStatusReasonDeploying ,
759
+ Strategy : constant .DeploymentStrategyCanary ,
760
+ StatusValue : constant .DeploymentStatusValueActive ,
761
+ StatusReason : constant .DeploymentStatusReasonDeploying ,
762
+ LastStatusChange : "2024-07-29T17:32:29Z" ,
707
763
},
708
764
}
709
765
})
710
766
711
767
It ("displays the message" , func () {
712
- Expect (testUI .Out ).To (Say ("Rolling deployment currently DEPLOYING." ))
768
+ Expect (testUI .Out ).To (Say (`Canary deployment currently DEPLOYING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
769
+ Expect (testUI .Out ).NotTo (Say (`promote the canary deployment` ))
713
770
})
714
771
})
715
772
716
- When ("the deployment is cancelled" , func () {
773
+ When ("the deployment is paused" , func () {
774
+ BeforeEach (func () {
775
+ summary = v7action.DetailedApplicationSummary {
776
+ ApplicationSummary : v7action.ApplicationSummary {
777
+ Application : resources.Application {
778
+ Name : "foobar" ,
779
+ },
780
+ },
781
+ Deployment : resources.Deployment {
782
+ Strategy : constant .DeploymentStrategyCanary ,
783
+ StatusValue : constant .DeploymentStatusValueActive ,
784
+ StatusReason : constant .DeploymentStatusReasonPaused ,
785
+ LastStatusChange : "2024-07-29T17:32:29Z" ,
786
+ },
787
+ }
788
+ })
789
+
790
+ It ("displays the message" , func () {
791
+ Expect (testUI .Out ).To (Say (`Canary deployment currently PAUSED \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
792
+ Expect (testUI .Out ).To (Say ("Please run `cf continue-deployment foobar` to promote the canary deployment, or `cf cancel-deployment foobar` to rollback to the previous version." ))
793
+ })
794
+ })
795
+
796
+ When ("the deployment is canceling" , func () {
717
797
BeforeEach (func () {
718
798
summary = v7action.DetailedApplicationSummary {
719
799
Deployment : resources.Deployment {
720
- Strategy : constant .DeploymentStrategyRolling ,
721
- StatusValue : constant .DeploymentStatusValueActive ,
722
- StatusReason : constant .DeploymentStatusReasonCanceling ,
800
+ Strategy : constant .DeploymentStrategyCanary ,
801
+ StatusValue : constant .DeploymentStatusValueActive ,
802
+ StatusReason : constant .DeploymentStatusReasonCanceling ,
803
+ LastStatusChange : "2024-07-29T17:32:29Z" ,
723
804
},
724
805
}
725
806
})
726
807
727
808
It ("displays the message" , func () {
728
- Expect (testUI .Out ).To (Say ("Rolling deployment currently CANCELING." ))
809
+ Expect (testUI .Out ).To (Say (`Canary deployment currently CANCELING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
810
+ Expect (testUI .Out ).NotTo (Say (`promote the canary deployment` ))
729
811
})
730
812
})
731
813
})
0 commit comments