Path: blob/main/install/installer/pkg/components/usage/configmap_test.go
2501 views
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.1/// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package usage56import (7"testing"89"github.com/gitpod-io/gitpod/installer/pkg/config/v1/experimental"10"github.com/stretchr/testify/require"11corev1 "k8s.io/api/core/v1"12)1314func TestConfigMap_ContainsSchedule(t *testing.T) {15ctx := renderContextWithUsageConfig(t, &experimental.UsageConfig{Enabled: true, Schedule: "2m", ResetUsageSchedule: "5m"})1617objs, err := configmap(ctx)18require.NoError(t, err)1920cfgmap, ok := objs[0].(*corev1.ConfigMap)21require.True(t, ok)2223require.JSONEq(t,24`{25"controllerSchedule": "2m",26"resetUsageSchedule": "5m",27"stripeCredentialsFile": "stripe-secret/apikeys",28"defaultSpendingLimit": {29"forUsers": 1000000000,30"forTeams": 1000000000,31"minForUsersOnStripe": 032},33"stripePrices": {34"individualUsagePriceIds": {35"eur": "",36"usd": ""37},38"teamUsagePriceIds": {39"eur": "",40"usd": ""41}42},43"serverAddress": "server.test-namespace.svc.cluster.local:9877",44"redis": {45"address": "redis.test-namespace.svc.cluster.local:6379"46},47"server": {48"services": {49"grpc": {50"address": "0.0.0.0:9001"51}52}53},54"gitpodHost": "https://test.domain.everything.awesome.is"55}`,56cfgmap.Data[configJSONFilename],57)58}596061