blob: f399407abccb07394298304cf95690af13fff88f [file] [log] [blame] [edit]
package senlin
import (
_ "embed"
"os"
"testing"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/vexxhost/atmosphere/internal/openstack_helm"
"github.com/vexxhost/atmosphere/internal/testutils"
)
var (
//go:embed vars/main.yml
varsFile []byte
vars Vars
)
type Vars struct {
openstack_helm.HelmValues `yaml:"_senlin_helm_values"`
}
func TestMain(m *testing.M) {
t := &testing.T{}
err := yaml.UnmarshalWithOptions(varsFile, &vars)
require.NoError(t, err)
code := m.Run()
os.Exit(code)
}
func TestHelmValues(t *testing.T) {
vals, err := openstack_helm.CoalescedHelmValues("../../charts/senlin", &vars.HelmValues)
require.NoError(t, err)
assert.Equal(t, int32(2), vals.Conf.Senlin.API.Workers)
testutils.TestDatabaseConf(t, vals.Conf.Senlin.Database)
}