@@ -696,6 +696,9 @@ var _ = Describe("app summary displayer", func() {
696
696
})
697
697
698
698
When ("there is an active deployment" , func () {
699
+ var LastStatusChangeTimeString = "2024-07-29T17:32:29Z"
700
+ var dateTimeRegexPattern = `[a-zA-Z]{3}\s\d{2}\s[a-zA-Z]{3}\s\d{2}\:\d{2}\:\d{2}\s[A-Z]{3}\s\d{4}`
701
+
699
702
When ("the deployment strategy is rolling" , func () {
700
703
When ("the deployment is in progress" , func () {
701
704
When ("last status change has a timestamp" , func () {
@@ -705,13 +708,14 @@ var _ = Describe("app summary displayer", func() {
705
708
Strategy : constant .DeploymentStrategyRolling ,
706
709
StatusValue : constant .DeploymentStatusValueActive ,
707
710
StatusReason : constant .DeploymentStatusReasonDeploying ,
708
- LastStatusChange : "2024-07-29T17:32:29Z" ,
711
+ LastStatusChange : LastStatusChangeTimeString ,
709
712
},
710
713
}
711
714
})
712
715
713
716
It ("displays the message" , func () {
714
- Expect (testUI .Out ).To (Say (`Rolling deployment currently DEPLOYING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
717
+ var actualOut = fmt .Sprintf ("%s" , testUI .Out )
718
+ Expect (actualOut ).To (MatchRegexp (`Rolling deployment currently DEPLOYING \(since %s\)` , dateTimeRegexPattern ))
715
719
})
716
720
})
717
721
@@ -741,13 +745,14 @@ var _ = Describe("app summary displayer", func() {
741
745
Strategy : constant .DeploymentStrategyRolling ,
742
746
StatusValue : constant .DeploymentStatusValueActive ,
743
747
StatusReason : constant .DeploymentStatusReasonCanceling ,
744
- LastStatusChange : "2024-07-29T17:32:29Z" ,
748
+ LastStatusChange : LastStatusChangeTimeString ,
745
749
},
746
750
}
747
751
})
748
752
749
753
It ("displays the message" , func () {
750
- Expect (testUI .Out ).To (Say (`Rolling deployment currently CANCELING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
754
+ var actualOut = fmt .Sprintf ("%s" , testUI .Out )
755
+ Expect (actualOut ).To (MatchRegexp (`Rolling deployment currently CANCELING \(since %s\)` , dateTimeRegexPattern ))
751
756
})
752
757
})
753
758
})
@@ -759,13 +764,14 @@ var _ = Describe("app summary displayer", func() {
759
764
Strategy : constant .DeploymentStrategyCanary ,
760
765
StatusValue : constant .DeploymentStatusValueActive ,
761
766
StatusReason : constant .DeploymentStatusReasonDeploying ,
762
- LastStatusChange : "2024-07-29T17:32:29Z" ,
767
+ LastStatusChange : LastStatusChangeTimeString ,
763
768
},
764
769
}
765
770
})
766
771
767
772
It ("displays the message" , func () {
768
- Expect (testUI .Out ).To (Say (`Canary deployment currently DEPLOYING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
773
+ var actualOut = fmt .Sprintf ("%s" , testUI .Out )
774
+ Expect (actualOut ).To (MatchRegexp (`Canary deployment currently DEPLOYING \(since %s\)` , dateTimeRegexPattern ))
769
775
Expect (testUI .Out ).NotTo (Say (`promote the canary deployment` ))
770
776
})
771
777
})
@@ -782,13 +788,14 @@ var _ = Describe("app summary displayer", func() {
782
788
Strategy : constant .DeploymentStrategyCanary ,
783
789
StatusValue : constant .DeploymentStatusValueActive ,
784
790
StatusReason : constant .DeploymentStatusReasonPaused ,
785
- LastStatusChange : "2024-07-29T17:32:29Z" ,
791
+ LastStatusChange : LastStatusChangeTimeString ,
786
792
},
787
793
}
788
794
})
789
795
790
796
It ("displays the message" , func () {
791
- Expect (testUI .Out ).To (Say (`Canary deployment currently PAUSED \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
797
+ var actualOut = fmt .Sprintf ("%s" , testUI .Out )
798
+ Expect (actualOut ).To (MatchRegexp (`Canary deployment currently PAUSED \(since %s\)` , dateTimeRegexPattern ))
792
799
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
800
})
794
801
})
@@ -800,13 +807,14 @@ var _ = Describe("app summary displayer", func() {
800
807
Strategy : constant .DeploymentStrategyCanary ,
801
808
StatusValue : constant .DeploymentStatusValueActive ,
802
809
StatusReason : constant .DeploymentStatusReasonCanceling ,
803
- LastStatusChange : "2024-07-29T17:32:29Z" ,
810
+ LastStatusChange : LastStatusChangeTimeString ,
804
811
},
805
812
}
806
813
})
807
814
808
815
It ("displays the message" , func () {
809
- Expect (testUI .Out ).To (Say (`Canary deployment currently CANCELING \(since Mon 29 Jul 13:32:29 EDT 2024\)` ))
816
+ var actualOut = fmt .Sprintf ("%s" , testUI .Out )
817
+ Expect (actualOut ).To (MatchRegexp (`Canary deployment currently CANCELING \(since %s\)` , dateTimeRegexPattern ))
810
818
Expect (testUI .Out ).NotTo (Say (`promote the canary deployment` ))
811
819
})
812
820
})
0 commit comments