From 32be585d2916e5bebe13c5cfef568c8a67bb391a Mon Sep 17 00:00:00 2001 From: Devtools Date: Tue, 11 Nov 2025 17:48:20 +0100 Subject: [PATCH 1/2] check returned workato config --- .../e2e-tests/toolchainconfig.yaml | 1 + go.mod | 2 +- go.sum | 4 +-- .../e2e/parallel/registration_service_test.go | 29 +++++++++++++++++++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/deploy/host-operator/e2e-tests/toolchainconfig.yaml b/deploy/host-operator/e2e-tests/toolchainconfig.yaml index 9d2dfed1c..d491b6246 100644 --- a/deploy/host-operator/e2e-tests/toolchainconfig.yaml +++ b/deploy/host-operator/e2e-tests/toolchainconfig.yaml @@ -17,6 +17,7 @@ spec: environment: 'e2e-tests' # same number that is set in https://github.com/codeready-toolchain/host-operator/blob/master/deploy/registration-service/registration-service.yaml#L272-L273 replicas: 3 + workatoWebHookURL: https://webhooks.testwebhook verification: enabled: true excludedEmailDomains: 'redhat.com,acme.com' diff --git a/go.mod b/go.mod index fce42fdbc..e5da801c5 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,7 @@ module github.com/codeready-toolchain/toolchain-e2e require ( - github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd + github.com/codeready-toolchain/api v0.0.0-20251111133521-6e510c9bd2ee github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/fatih/color v1.18.0 diff --git a/go.sum b/go.sum index 85d9498ed..70ed86868 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/cloudflare/circl v1.1.0/go.mod h1:prBCrKB9DV4poKZY1l9zBXg2QJY7mvgRvtMxxK7fi4I= github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= -github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd h1:A6WOUwlUdgOf4PDzzgKvycRj4Pk+1F6npWV4YoPVFcM= -github.com/codeready-toolchain/api v0.0.0-20251008084914-06282b83d4cd/go.mod h1:TiQ/yNv3cGL4nxo3fgRtcHyYYuRf+nAgs6B1IAqvxOU= +github.com/codeready-toolchain/api v0.0.0-20251111133521-6e510c9bd2ee h1:xuUh5aTG6NEG+HDs9e6QomAmHd/5gff7KtLJbbAR9y8= +github.com/codeready-toolchain/api v0.0.0-20251111133521-6e510c9bd2ee/go.mod h1:TiQ/yNv3cGL4nxo3fgRtcHyYYuRf+nAgs6B1IAqvxOU= github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1 h1:jqs4yOuJbfW3CKe1EMJkkDo47wTKQ4M1OKox4DYWsKg= github.com/codeready-toolchain/toolchain-common v0.0.0-20251006132314-2591ebe0bdb1/go.mod h1:eySMK8JR/Py9eoUJlAkOXqvfPp1vjl39scgrECr99XM= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= diff --git a/test/e2e/parallel/registration_service_test.go b/test/e2e/parallel/registration_service_test.go index 9dcde1c55..b81e432c3 100644 --- a/test/e2e/parallel/registration_service_test.go +++ b/test/e2e/parallel/registration_service_test.go @@ -990,6 +990,35 @@ func TestUsernames(t *testing.T) { }) } +func TestUIConfig(t *testing.T) { + // given + t.Parallel() + awaitilities := WaitForDeployments(t) + route := awaitilities.Host().RegistrationServiceURL + // Create a token that will be used to invoke the /uiconfig api + identity := commonauth.NewIdentity() + emailValue := identity.Username + "@some.domain" + emailClaim := commonauth.WithEmailClaim(emailValue) + token, err := commonauth.GenerateSignedE2ETestToken(*identity, emailClaim) + require.NoError(t, err) + + t.Run("get uiconfig 200 response", func(t *testing.T) { + // given + // we have a user in the system + + // when + // we call the get uiconfig endpoint to get ui configuration + response := NewHTTPRequest(t). + InvokeEndpoint("GET", route+"/api/v1/uiconfig", token, "", http.StatusOK).UnmarshalMap() + + // then + // verify that the expected URL is there + workatoWebHookURL, ok := response["workatoWebHookURL"].(map[string]interface{}) + require.True(t, ok) + assert.Equal(t, "https://webhooks.testwebhook", workatoWebHookURL) + }) +} + func signup(t *testing.T, hostAwait *wait.HostAwaitility) (*toolchainv1alpha1.UserSignup, string) { route := hostAwait.RegistrationServiceURL From 377a4029bb32159fe73f2df1883876ea42296719 Mon Sep 17 00:00:00 2001 From: Devtools Date: Tue, 11 Nov 2025 18:54:40 +0100 Subject: [PATCH 2/2] fix --- test/e2e/parallel/registration_service_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/parallel/registration_service_test.go b/test/e2e/parallel/registration_service_test.go index b81e432c3..72c40a0bb 100644 --- a/test/e2e/parallel/registration_service_test.go +++ b/test/e2e/parallel/registration_service_test.go @@ -1013,7 +1013,7 @@ func TestUIConfig(t *testing.T) { // then // verify that the expected URL is there - workatoWebHookURL, ok := response["workatoWebHookURL"].(map[string]interface{}) + workatoWebHookURL, ok := response["workatoWebHookURL"].(string) require.True(t, ok) assert.Equal(t, "https://webhooks.testwebhook", workatoWebHookURL) })