Skip to content
This repository has been archived by the owner on Jul 4, 2024. It is now read-only.

Commit

Permalink
Align self register e2e tests (#2101)
Browse files Browse the repository at this point in the history
* Merge tests

* bump version
  • Loading branch information
ataleksandrov committed Nov 8, 2021
1 parent cc3cb45 commit 9685326
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 67 deletions.
4 changes: 0 additions & 4 deletions chart/compass/templates/tests/director/director-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ spec:
value: {{ .Values.global.connector.secrets.ca.keyKey | quote }}
- name: SKIP_TESTS_REGEX
value: {{ .Values.global.tests.director.skipPattern }}
- name: APP_SELF_REGISTER_DISTINGUISH_LABEL_KEY
value: {{ .Values.global.director.selfRegister.distinguishLabel }}
- name: APP_SELF_REGISTER_LABEL_KEY
value: {{ .Values.global.director.selfRegister.label }}
{{ if .Values.global.isLocalEnv }}
volumeMounts:
- mountPath: "/src/github.com/kyma-incubator/compass/components/director/examples"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ spec:
value: "0.0.0.0:{{.Values.global.tests.token.server.port}}"
- name: SKIP_TESTS_REGEX
value: {{ .Values.global.tests.ordService.skipPattern }}
- name: APP_SELF_REGISTER_DISTINGUISH_LABEL_KEY
value: {{ .Values.global.director.selfRegister.distinguishLabel }}
- name: APP_SELF_REGISTER_LABEL_KEY
value: {{ .Values.global.director.selfRegister.label }}
{{if eq .Values.global.database.embedded.enabled false}}
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.23.0-alpine
Expand Down
2 changes: 1 addition & 1 deletion chart/compass/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ global:
version: "PR-46"
e2e_tests:
dir:
version: "PR-2096"
version: "PR-2101"
isLocalEnv: false
oauth2:
host: oauth2
Expand Down
50 changes: 0 additions & 50 deletions tests/director/tests/self_reg_test.go

This file was deleted.

2 changes: 2 additions & 0 deletions tests/ord-service/tests/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ type config struct {
ClientSecret string
SubscriptionProviderLabelKey string
ConsumerSubaccountIdsLabelKey string
SelfRegisterDistinguishLabelKey string `envconfig:"APP_SELF_REGISTER_DISTINGUISH_LABEL_KEY"`
SelfRegisterLabelKey string `envconfig:"APP_SELF_REGISTER_LABEL_KEY"`
}

var testConfig config
Expand Down
5 changes: 5 additions & 0 deletions tests/ord-service/tests/subscription_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func TestSelfRegisterFlow(stdT *testing.T) {
t := testingx.NewT(stdT)
t.Run("TestSelfRegisterFlow flow: label definitions of the parent tenant are not overwritten", func(t *testing.T) {
ctx := context.Background()
distinguishLblValue := "test-distinguish-value"

// defaultTenantId is the parent of the subaccountID
defaultTenantId := tenant.TestTenants.GetDefaultTenantID()
Expand Down Expand Up @@ -75,11 +76,15 @@ func TestSelfRegisterFlow(stdT *testing.T) {
runtimeInput := graphql.RuntimeInput{
Name: "selfRegisterRuntime",
Description: ptr.String("selfRegisterRuntime-description"),
Labels: graphql.Labels{testConfig.SelfRegisterDistinguishLabelKey: distinguishLblValue},
}
runtime, err := fixtures.RegisterRuntimeFromInputWithinTenant(t, ctx, directorCertSecuredClient, defaultTenantId, &runtimeInput)
defer fixtures.CleanupRuntime(t, ctx, directorCertSecuredClient, defaultTenantId, &runtime)
require.NoError(t, err)
require.NotEmpty(t, runtime.ID)
strLbl, ok := runtime.Labels[testConfig.SelfRegisterLabelKey].(string)
require.True(t, ok)
require.Contains(t, strLbl, distinguishLblValue)

labelDefinitions, err := fixtures.ListLabelDefinitionsWithinTenant(t, ctx, dexGraphQLClient, defaultTenantId)
require.NoError(t, err)
Expand Down
22 changes: 10 additions & 12 deletions tests/pkg/config/director.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@ package config

type DirectorConfig struct {
BaseDirectorConfig
HealthUrl string `envconfig:"default=https://director.kyma.local/healthz"`
WebhookUrl string `envconfig:"default=https://kyma-project.io"`
InfoUrl string `envconfig:"APP_INFO_API_ENDPOINT,default=https://director.kyma.local/v1/info"`
CertIssuer string `envconfig:"APP_INFO_CERT_ISSUER"`
CertSubject string `envconfig:"APP_INFO_CERT_SUBJECT"`
DefaultScenarioEnabled bool `envconfig:"default=true"`
DefaultNormalizationPrefix string `envconfig:"default=mp-"`
GatewayOauth string
DirectorExternalCertSecuredURL string
SelfRegisterDistinguishLabelKey string `envconfig:"APP_SELF_REGISTER_DISTINGUISH_LABEL_KEY"`
SelfRegisterLabelKey string `envconfig:"APP_SELF_REGISTER_LABEL_KEY"`
CA ConnectorCAConfig
HealthUrl string `envconfig:"default=https://director.kyma.local/healthz"`
WebhookUrl string `envconfig:"default=https://kyma-project.io"`
InfoUrl string `envconfig:"APP_INFO_API_ENDPOINT,default=https://director.kyma.local/v1/info"`
CertIssuer string `envconfig:"APP_INFO_CERT_ISSUER"`
CertSubject string `envconfig:"APP_INFO_CERT_SUBJECT"`
DefaultScenarioEnabled bool `envconfig:"default=true"`
DefaultNormalizationPrefix string `envconfig:"default=mp-"`
GatewayOauth string
DirectorExternalCertSecuredURL string
CA ConnectorCAConfig
}

type BaseDirectorConfig struct {
Expand Down

0 comments on commit 9685326

Please sign in to comment.