@@ -25,8 +25,7 @@ func TestPortsUpdateState(t *testing.T) {
2525 type ExposureExpectation []ExposedPort
2626 type UpdateExpectation [][]* api.PortsStatus
2727 type ConfigChange struct {
28- workspace []* gitpod.PortConfig
29- instance []* gitpod.PortsItems
28+ instance []* gitpod.PortsItems
3029 }
3130 type Change struct {
3231 Config * ConfigChange
@@ -109,47 +108,6 @@ func TestPortsUpdateState(t *testing.T) {
109108 ExpectedExposure : ExposureExpectation (nil ),
110109 ExpectedUpdates : UpdateExpectation {{}},
111110 },
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- },
153111 {
154112 Desc : "serving port from the configured port range" ,
155113 Changes : []Change {
@@ -182,7 +140,7 @@ func TestPortsUpdateState(t *testing.T) {
182140 Desc : "auto expose configured ports" ,
183141 Changes : []Change {
184142 {
185- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
143+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
186144 {Port : 8080 , Visibility : "private" },
187145 }},
188146 },
@@ -244,7 +202,7 @@ func TestPortsUpdateState(t *testing.T) {
244202 Desc : "served between auto exposing configured and exposed update" ,
245203 Changes : []Change {
246204 {
247- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
205+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
248206 {Port : 8080 , Visibility : "private" },
249207 }},
250208 },
@@ -451,7 +409,7 @@ func TestPortsUpdateState(t *testing.T) {
451409 Desc : "port status has description set as soon as the port gets exposed, if there was a description configured" ,
452410 Changes : []Change {
453411 {
454- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
412+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
455413 {Port : 8080 , Visibility : "private" , Description : "Development server" },
456414 }},
457415 },
@@ -476,7 +434,7 @@ func TestPortsUpdateState(t *testing.T) {
476434 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" ,
477435 Changes : []Change {
478436 {
479- Config : & ConfigChange {workspace : []* gitpod.PortConfig {
437+ Config : & ConfigChange {instance : []* gitpod.PortsItems {
480438 {Port : 3000 , Visibility : "private" , Name : "react" },
481439 }},
482440 },
@@ -582,9 +540,6 @@ func TestPortsUpdateState(t *testing.T) {
582540 Changes : []Change {
583541 {
584542 Config : & ConfigChange {
585- workspace : []* gitpod.PortConfig {
586- {Port : 3000 , Visibility : "private" , Name : "react" },
587- },
588543 instance : []* gitpod.PortsItems {
589544 {Port : 3001 , Visibility : "private" , Name : "react" },
590545 {Port : 3000 , Visibility : "private" , Name : "react" },
@@ -593,9 +548,6 @@ func TestPortsUpdateState(t *testing.T) {
593548 },
594549 {
595550 Config : & ConfigChange {
596- workspace : []* gitpod.PortConfig {
597- {Port : 3000 , Visibility : "private" , Name : "react" },
598- },
599551 instance : []* gitpod.PortsItems {
600552 {Port : 3003 , Visibility : "private" , Name : "react" },
601553 {Port : 3001 , Visibility : "private" , Name : "react" },
@@ -612,9 +564,6 @@ func TestPortsUpdateState(t *testing.T) {
612564 },
613565 {
614566 Config : & ConfigChange {
615- workspace : []* gitpod.PortConfig {
616- {Port : 3000 , Visibility : "private" , Name : "react" },
617- },
618567 instance : []* gitpod.PortsItems {
619568 {Port : 3003 , Visibility : "private" , Name : "react" },
620569 {Port : 3000 , Visibility : "private" , Name : "react" },
@@ -623,9 +572,6 @@ func TestPortsUpdateState(t *testing.T) {
623572 },
624573 {
625574 Config : & ConfigChange {
626- workspace : []* gitpod.PortConfig {
627- {Port : 3000 , Visibility : "private" , Name : "react" },
628- },
629575 instance : []* gitpod.PortsItems {
630576 {Port : "3001-3005" , Visibility : "private" , Name : "react" },
631577 {Port : 3003 , Visibility : "private" , Name : "react" },
@@ -738,7 +684,6 @@ func TestPortsUpdateState(t *testing.T) {
738684 for _ , c := range test .Changes {
739685 if c .Config != nil {
740686 change := & Configs {}
741- change .workspaceConfigs = parseWorkspaceConfigs (c .Config .workspace )
742687 portConfigs , rangeConfigs := parseInstanceConfigs (c .Config .instance )
743688 change .instancePortConfigs = portConfigs
744689 change .instanceRangeConfigs = rangeConfigs
0 commit comments