@@ -25,8 +25,7 @@ func TestPortsUpdateState(t *testing.T) {
25
25
type ExposureExpectation []ExposedPort
26
26
type UpdateExpectation [][]* api.PortsStatus
27
27
type ConfigChange struct {
28
- workspace []* gitpod.PortConfig
29
- instance []* gitpod.PortsItems
28
+ instance []* gitpod.PortsItems
30
29
}
31
30
type Change struct {
32
31
Config * ConfigChange
@@ -109,47 +108,6 @@ func TestPortsUpdateState(t *testing.T) {
109
108
ExpectedExposure : ExposureExpectation (nil ),
110
109
ExpectedUpdates : UpdateExpectation {{}},
111
110
},
112
- {
113
- Desc : "serving configured workspace port" ,
114
- Changes : []Change {
115
- {Config : & ConfigChange {
116
- workspace : []* gitpod.PortConfig {
117
- {Port : 8080 , OnOpen : "open-browser" },
118
- {Port : 9229 , OnOpen : "ignore" , Visibility : "private" },
119
- },
120
- }},
121
- {
122
- Exposed : []ExposedPort {
123
- {LocalPort : 8080 , Public : true , URL : "8080-foobar" },
124
- {LocalPort : 9229 , Public : false , URL : "9229-foobar" },
125
- },
126
- },
127
- {
128
- Served : []ServedPort {
129
- {net .IPv4zero , 8080 , false },
130
- {net .IPv4 (127 , 0 , 0 , 1 ), 9229 , true },
131
- },
132
- },
133
- },
134
- ExpectedExposure : []ExposedPort {
135
- {LocalPort : 8080 },
136
- {LocalPort : 9229 },
137
- },
138
- ExpectedUpdates : UpdateExpectation {
139
- {},
140
- []* api.PortsStatus {
141
- {LocalPort : 8080 , OnOpen : api .PortsStatus_open_browser },
142
- {LocalPort : 9229 , OnOpen : api .PortsStatus_ignore }},
143
- []* api.PortsStatus {
144
- {LocalPort : 8080 , OnOpen : api .PortsStatus_open_browser , Exposed : & api.ExposedPortInfo {Visibility : api .PortVisibility_public , Url : "8080-foobar" , OnExposed : api .OnPortExposedAction_open_browser }},
145
- {LocalPort : 9229 , OnOpen : api .PortsStatus_ignore , Exposed : & api.ExposedPortInfo {Visibility : api .PortVisibility_private , Url : "9229-foobar" , OnExposed : api .OnPortExposedAction_ignore }},
146
- },
147
- []* api.PortsStatus {
148
- {LocalPort : 8080 , Served : true , OnOpen : api .PortsStatus_open_browser , Exposed : & api.ExposedPortInfo {Visibility : api .PortVisibility_public , Url : "8080-foobar" , OnExposed : api .OnPortExposedAction_open_browser }},
149
- {LocalPort : 9229 , Served : true , OnOpen : api .PortsStatus_ignore , Exposed : & api.ExposedPortInfo {Visibility : api .PortVisibility_private , Url : "9229-foobar" , OnExposed : api .OnPortExposedAction_ignore }},
150
- },
151
- },
152
- },
153
111
{
154
112
Desc : "serving port from the configured port range" ,
155
113
Changes : []Change {
@@ -182,7 +140,7 @@ func TestPortsUpdateState(t *testing.T) {
182
140
Desc : "auto expose configured ports" ,
183
141
Changes : []Change {
184
142
{
185
- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
143
+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
186
144
{Port : 8080 , Visibility : "private" },
187
145
}},
188
146
},
@@ -244,7 +202,7 @@ func TestPortsUpdateState(t *testing.T) {
244
202
Desc : "served between auto exposing configured and exposed update" ,
245
203
Changes : []Change {
246
204
{
247
- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
205
+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
248
206
{Port : 8080 , Visibility : "private" },
249
207
}},
250
208
},
@@ -451,7 +409,7 @@ func TestPortsUpdateState(t *testing.T) {
451
409
Desc : "port status has description set as soon as the port gets exposed, if there was a description configured" ,
452
410
Changes : []Change {
453
411
{
454
- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
412
+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
455
413
{Port : 8080 , Visibility : "private" , Description : "Development server" },
456
414
}},
457
415
},
@@ -476,7 +434,7 @@ func TestPortsUpdateState(t *testing.T) {
476
434
Desc : "port status has the name attribute set as soon as the port gets exposed, if there was a name configured in Gitpod's Workspace" ,
477
435
Changes : []Change {
478
436
{
479
- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
437
+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
480
438
{Port : 3000 , Visibility : "private" , Name : "react" },
481
439
}},
482
440
},
@@ -582,9 +540,6 @@ func TestPortsUpdateState(t *testing.T) {
582
540
Changes : []Change {
583
541
{
584
542
Config : & ConfigChange {
585
- workspace : []* gitpod.PortConfig {
586
- {Port : 3000 , Visibility : "private" , Name : "react" },
587
- },
588
543
instance : []* gitpod.PortsItems {
589
544
{Port : 3001 , Visibility : "private" , Name : "react" },
590
545
{Port : 3000 , Visibility : "private" , Name : "react" },
@@ -593,9 +548,6 @@ func TestPortsUpdateState(t *testing.T) {
593
548
},
594
549
{
595
550
Config : & ConfigChange {
596
- workspace : []* gitpod.PortConfig {
597
- {Port : 3000 , Visibility : "private" , Name : "react" },
598
- },
599
551
instance : []* gitpod.PortsItems {
600
552
{Port : 3003 , Visibility : "private" , Name : "react" },
601
553
{Port : 3001 , Visibility : "private" , Name : "react" },
@@ -612,9 +564,6 @@ func TestPortsUpdateState(t *testing.T) {
612
564
},
613
565
{
614
566
Config : & ConfigChange {
615
- workspace : []* gitpod.PortConfig {
616
- {Port : 3000 , Visibility : "private" , Name : "react" },
617
- },
618
567
instance : []* gitpod.PortsItems {
619
568
{Port : 3003 , Visibility : "private" , Name : "react" },
620
569
{Port : 3000 , Visibility : "private" , Name : "react" },
@@ -623,9 +572,6 @@ func TestPortsUpdateState(t *testing.T) {
623
572
},
624
573
{
625
574
Config : & ConfigChange {
626
- workspace : []* gitpod.PortConfig {
627
- {Port : 3000 , Visibility : "private" , Name : "react" },
628
- },
629
575
instance : []* gitpod.PortsItems {
630
576
{Port : "3001-3005" , Visibility : "private" , Name : "react" },
631
577
{Port : 3003 , Visibility : "private" , Name : "react" },
@@ -738,7 +684,6 @@ func TestPortsUpdateState(t *testing.T) {
738
684
for _ , c := range test .Changes {
739
685
if c .Config != nil {
740
686
change := & Configs {}
741
- change .workspaceConfigs = parseWorkspaceConfigs (c .Config .workspace )
742
687
portConfigs , rangeConfigs := parseInstanceConfigs (c .Config .instance )
743
688
change .instancePortConfigs = portConfigs
744
689
change .instanceRangeConfigs = rangeConfigs
0 commit comments