@@ -127,7 +127,7 @@ describe("cloudchamber apply", () => {
127127 │ [[containers]]
128128 │ name = \\"my-container-app\\"
129129 │ instances = 3
130- │ scheduling_policy = \\"regional \\"
130+ │ scheduling_policy = \\"default \\"
131131 │
132132 │ [containers.configuration]
133133 │ image = \\"./Dockerfile\\"
@@ -169,7 +169,7 @@ describe("cloudchamber apply", () => {
169169 created_at : new Date ( ) . toString ( ) ,
170170 version : 1 ,
171171 account_id : "1" ,
172- scheduling_policy : SchedulingPolicy . REGIONAL ,
172+ scheduling_policy : SchedulingPolicy . DEFAULT ,
173173 configuration : {
174174 image : "./Dockerfile" ,
175175 } ,
@@ -245,7 +245,7 @@ describe("cloudchamber apply", () => {
245245 created_at : new Date ( ) . toString ( ) ,
246246 account_id : "1" ,
247247 version : 1 ,
248- scheduling_policy : SchedulingPolicy . REGIONAL ,
248+ scheduling_policy : SchedulingPolicy . DEFAULT ,
249249 configuration : {
250250 image : "./Dockerfile2" ,
251251 } ,
@@ -279,7 +279,7 @@ describe("cloudchamber apply", () => {
279279 │ [[containers]]
280280 │ name = \\"my-container-app-2\\"
281281 │ max_instances = 3
282- │ scheduling_policy = \\"regional \\"
282+ │ scheduling_policy = \\"default \\"
283283 │
284284 │ [containers.configuration]
285285 │ image = \\"other-app/Dockerfile\\"
@@ -335,7 +335,7 @@ describe("cloudchamber apply", () => {
335335 created_at : new Date ( ) . toString ( ) ,
336336 account_id : "1" ,
337337 version : 1 ,
338- scheduling_policy : SchedulingPolicy . REGIONAL ,
338+ scheduling_policy : SchedulingPolicy . DEFAULT ,
339339 configuration : {
340340 image : "./Dockerfile" ,
341341 } ,
@@ -366,7 +366,7 @@ describe("cloudchamber apply", () => {
366366 │ [[containers]]
367367 │ name = \\"my-container-app-2\\"
368368 │ instances = 1
369- │ scheduling_policy = \\"regional \\"
369+ │ scheduling_policy = \\"default \\"
370370 │
371371 │ [containers.configuration]
372372 │ image = \\"other-app/Dockerfile\\"
@@ -416,7 +416,7 @@ describe("cloudchamber apply", () => {
416416 created_at : new Date ( ) . toString ( ) ,
417417 account_id : "1" ,
418418 version : 1 ,
419- scheduling_policy : SchedulingPolicy . REGIONAL ,
419+ scheduling_policy : SchedulingPolicy . DEFAULT ,
420420 configuration : {
421421 image : "./Dockerfile" ,
422422 } ,
@@ -447,7 +447,7 @@ describe("cloudchamber apply", () => {
447447 │ [[containers]]
448448 │ name = \\"my-container-app-2\\"
449449 │ instances = 1
450- │ scheduling_policy = \\"regional \\"
450+ │ scheduling_policy = \\"default \\"
451451 │
452452 │ [containers.configuration]
453453 │ image = \\"other-app/Dockerfile\\"
@@ -518,7 +518,7 @@ describe("cloudchamber apply", () => {
518518 version : 1 ,
519519 created_at : new Date ( ) . toString ( ) ,
520520 account_id : "1" ,
521- scheduling_policy : SchedulingPolicy . REGIONAL ,
521+ scheduling_policy : SchedulingPolicy . DEFAULT ,
522522 configuration : {
523523 image : "./Dockerfile" ,
524524 labels : [
@@ -601,7 +601,7 @@ describe("cloudchamber apply", () => {
601601 /* eslint-enable */
602602 } ) ;
603603
604- test ( "can apply an application, and there is no changes" , async ( ) => {
604+ test ( "can apply an application, and there is no changes (retrocompatibility with regional scheduling policy) " , async ( ) => {
605605 setIsTTY ( false ) ;
606606 writeAppConfiguration ( {
607607 class_name : "DurableObjectClass" ,
@@ -646,7 +646,7 @@ describe("cloudchamber apply", () => {
646646 version : 1 ,
647647 created_at : new Date ( ) . toString ( ) ,
648648 account_id : "1" ,
649- scheduling_policy : SchedulingPolicy . REGIONAL ,
649+ scheduling_policy : SchedulingPolicy . DEFAULT ,
650650 configuration : {
651651 image : "./Dockerfile" ,
652652 labels : [
@@ -746,7 +746,7 @@ describe("cloudchamber apply", () => {
746746 created_at : new Date ( ) . toString ( ) ,
747747 class_name : "DurableObjectClass" ,
748748 account_id : "1" ,
749- scheduling_policy : SchedulingPolicy . REGIONAL ,
749+ scheduling_policy : SchedulingPolicy . DEFAULT ,
750750 configuration : {
751751 image : "./Dockerfile" ,
752752 labels : [
@@ -805,4 +805,103 @@ describe("cloudchamber apply", () => {
805805 expect ( std . stderr ) . toMatchInlineSnapshot ( `""` ) ;
806806 /* eslint-enable */
807807 } ) ;
808+
809+ test ( "can apply an application, and there is no changes" , async ( ) => {
810+ setIsTTY ( false ) ;
811+ writeAppConfiguration ( {
812+ class_name : "DurableObjectClass" ,
813+ name : "my-container-app" ,
814+ instances : 3 ,
815+ configuration : {
816+ image : "./Dockerfile" ,
817+ labels : [
818+ {
819+ name : "name" ,
820+ value : "value" ,
821+ } ,
822+ {
823+ name : "name-2" ,
824+ value : "value-2" ,
825+ } ,
826+ ] ,
827+ secrets : [
828+ {
829+ name : "MY_SECRET" ,
830+ type : SecretAccessType . ENV ,
831+ secret : "SECRET_NAME" ,
832+ } ,
833+ {
834+ name : "MY_SECRET_1" ,
835+ type : SecretAccessType . ENV ,
836+ secret : "SECRET_NAME_1" ,
837+ } ,
838+ {
839+ name : "MY_SECRET_2" ,
840+ type : SecretAccessType . ENV ,
841+ secret : "SECRET_NAME_2" ,
842+ } ,
843+ ] ,
844+ } ,
845+ } ) ;
846+ mockGetApplications ( [
847+ {
848+ id : "abc" ,
849+ name : "my-container-app" ,
850+ instances : 3 ,
851+ version : 1 ,
852+ created_at : new Date ( ) . toString ( ) ,
853+ account_id : "1" ,
854+ scheduling_policy : SchedulingPolicy . REGIONAL ,
855+ configuration : {
856+ image : "./Dockerfile" ,
857+ labels : [
858+ {
859+ name : "name" ,
860+ value : "value" ,
861+ } ,
862+ {
863+ name : "name-2" ,
864+ value : "value-2" ,
865+ } ,
866+ ] ,
867+ secrets : [
868+ {
869+ name : "MY_SECRET" ,
870+ type : SecretAccessType . ENV ,
871+ secret : "SECRET_NAME" ,
872+ } ,
873+ {
874+ name : "MY_SECRET_1" ,
875+ type : SecretAccessType . ENV ,
876+ secret : "SECRET_NAME_1" ,
877+ } ,
878+ {
879+ name : "MY_SECRET_2" ,
880+ type : SecretAccessType . ENV ,
881+ secret : "SECRET_NAME_2" ,
882+ } ,
883+ ] ,
884+ } ,
885+
886+ constraints : {
887+ tier : 1 ,
888+ } ,
889+ } ,
890+ ] ) ;
891+ await runWrangler ( "cloudchamber apply --json" ) ;
892+ /* eslint-disable */
893+ expect ( std . stdout ) . toMatchInlineSnapshot ( `
894+ "╭ Deploy a container application deploy changes to your application
895+ │
896+ │ Container application changes
897+ │
898+ ├ no changes my-container-app
899+ │
900+ ╰ No changes to be made
901+
902+ "
903+ ` ) ;
904+ expect ( std . stderr ) . toMatchInlineSnapshot ( `""` ) ;
905+ /* eslint-enable */
906+ } ) ;
808907} ) ;
0 commit comments