@@ -207,16 +207,18 @@ func TestAuth(t *testing.T) {
207207 t .Parallel ()
208208
209209 cases := []struct {
210- name string
211- cfg func () * model.ConfigConfig
212- useTlS bool
213- expected func () * Service
210+ name string
211+ cfg func () * model.ConfigConfig
212+ useTlS bool
213+ exposePort uint
214+ expected func () * Service
214215 }{
215216 {
216- name : "default" ,
217- cfg : getConfig ,
218- useTlS : false ,
219- expected : expectedAuth ,
217+ name : "default" ,
218+ cfg : getConfig ,
219+ useTlS : false ,
220+ exposePort : 0 ,
221+ expected : expectedAuth ,
220222 },
221223 {
222224 name : "pre-0.22.0" ,
@@ -225,7 +227,8 @@ func TestAuth(t *testing.T) {
225227 cfg .Auth .Version = ptr ("0.21.3" )
226228 return cfg
227229 },
228- useTlS : false ,
230+ useTlS : false ,
231+ exposePort : 0 ,
229232 expected : func () * Service {
230233 svc := expectedAuth ()
231234 svc .Image = "nhost/hasura-auth:0.21.3"
@@ -237,13 +240,34 @@ func TestAuth(t *testing.T) {
237240 return svc
238241 },
239242 },
243+ {
244+ name : "custom port" ,
245+ cfg : getConfig ,
246+ useTlS : false ,
247+ exposePort : 8080 ,
248+ expected : func () * Service {
249+ svc := expectedAuth ()
250+
251+ svc .Environment ["AUTH_SERVER_URL" ] = "http://dev.auth.local.nhost.run:8080/v1"
252+ svc .Ports = []Port {
253+ {
254+ Mode : "ingress" ,
255+ Target : 4000 ,
256+ Published : "8080" ,
257+ Protocol : "tcp" ,
258+ },
259+ }
260+
261+ return svc
262+ },
263+ },
240264 }
241265
242266 for _ , tc := range cases {
243267 t .Run (tc .name , func (t * testing.T ) {
244268 t .Parallel ()
245269
246- got , err := auth (tc .cfg (), "dev" , 1336 , tc .useTlS , "/tmp/nhost" , 0 )
270+ got , err := auth (tc .cfg (), "dev" , 1336 , tc .useTlS , "/tmp/nhost" , tc . exposePort )
247271 if err != nil {
248272 t .Errorf ("got error: %v" , err )
249273 }
0 commit comments