blob: f399407abccb07394298304cf95690af13fff88f [file] [log] [blame]
Mohammed Naserf5b77ee2023-11-29 23:10:43 -05001package senlin
2
3import (
4 _ "embed"
5 "os"
6 "testing"
7
8 "github.com/goccy/go-yaml"
9 "github.com/stretchr/testify/assert"
10 "github.com/stretchr/testify/require"
Mohammed Naserc6e431b2024-03-15 01:21:44 -040011
12 "github.com/vexxhost/atmosphere/internal/openstack_helm"
13 "github.com/vexxhost/atmosphere/internal/testutils"
Mohammed Naserf5b77ee2023-11-29 23:10:43 -050014)
15
16var (
17 //go:embed vars/main.yml
18 varsFile []byte
19 vars Vars
20)
21
22type Vars struct {
Mohammed Naserc6e431b2024-03-15 01:21:44 -040023 openstack_helm.HelmValues `yaml:"_senlin_helm_values"`
Mohammed Naserf5b77ee2023-11-29 23:10:43 -050024}
25
26func TestMain(m *testing.M) {
27 t := &testing.T{}
28 err := yaml.UnmarshalWithOptions(varsFile, &vars)
29 require.NoError(t, err)
30
31 code := m.Run()
32 os.Exit(code)
33}
34
Mohammed Naserc6e431b2024-03-15 01:21:44 -040035func TestHelmValues(t *testing.T) {
36 vals, err := openstack_helm.CoalescedHelmValues("../../charts/senlin", &vars.HelmValues)
37 require.NoError(t, err)
38
39 assert.Equal(t, int32(2), vals.Conf.Senlin.API.Workers)
40
41 testutils.TestDatabaseConf(t, vals.Conf.Senlin.Database)
Mohammed Naserf5b77ee2023-11-29 23:10:43 -050042}