Skip to content

Commit a550626

Browse files
committed
fix(test): [1.1] Fix port conflict in TestOAuth
- Added --port=0 parameter to all TestOAuth test cases to avoid port conflicts - This ensures tests use random available ports instead of fixed port 7070 - Resolves CI/CD test failures caused by port binding conflicts Task: 1.1 - Fix TestOAuth port conflict issue Phase: Testing
1 parent 48a1de2 commit a550626

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cmd/server_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,19 +260,19 @@ func TestOAuth(t *testing.T) {
260260
}{{
261261

262262
name: "invalid oauth provider",
263-
args: []string{"server", "--auth=oauth", "--oauth-provider=fake"},
263+
args: []string{"server", "--auth=oauth", "--oauth-provider=fake", "--http-port=0", "--port=0"},
264264
hasErr: true,
265265
}, {
266266
name: "client-id is missing",
267-
args: []string{"server", "--auth=oauth", "--client-secret=fake"},
267+
args: []string{"server", "--auth=oauth", "--client-secret=fake", "--http-port=0", "--port=0"},
268268
hasErr: true,
269269
}, {
270270
name: "client-secret is missing",
271-
args: []string{"server", "--auth=oauth", "--client-id=fake"},
271+
args: []string{"server", "--auth=oauth", "--client-id=fake", "--http-port=0", "--port=0"},
272272
hasErr: true,
273273
}, {
274274
name: "oauth is ok",
275-
args: []string{"server", "--auth=oauth", "--client-id=fake", "--client-secret=fake", "--http-port=0"},
275+
args: []string{"server", "--auth=oauth", "--client-id=fake", "--client-secret=fake", "--http-port=0", "--port=0"},
276276
hasErr: false,
277277
}}
278278
for i, tt := range tests {

0 commit comments

Comments
 (0)