Skip to content

Commit

Permalink
test: Fix TestGetAllURLs failure on tb-wsldd-16 (ddev#6708) [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay authored Nov 11, 2024
1 parent 5bb7523 commit 9aa0fc2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions pkg/ddevapp/ddevapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3609,9 +3609,17 @@ func TestGetAllURLs(t *testing.T) {
urlMap[u] = true
}

// We expect two URLs for each hostname (http/https) and two direct web container address.
expectedNumUrls := len(app.GetHostnames())*2 + 2
assert.Equal(len(urlMap), expectedNumUrls, "Unexpected number of URLs returned: %d", len(urlMap))
if app.CanUseHTTPOnly() {
t.Logf("Warning: app.CanUseHTTPOnly=%v", app.CanUseHTTPOnly())
}
// We expect one or two URLs for each hostname (http/https) and one or two direct web container address.
baseURLExpectation := len(app.GetHostnames())
if !app.CanUseHTTPOnly() {
baseURLExpectation = baseURLExpectation*2 + 2
} else {
baseURLExpectation = baseURLExpectation + 1
}
assert.Equal(baseURLExpectation, len(urlMap), "Unexpected number of URLs returned: %d. CanUseHTTPOnly=%v Actual URLs are %v. urls=%v app.GetHostnames()=%v", len(urlMap), app.CanUseHTTPOnly(), urlMap, urls, app.GetHostnames())

// Ensure urlMap contains direct address of the web container
webContainer, err := app.FindContainerByType("web")
Expand Down

0 comments on commit 9aa0fc2

Please sign in to comment.