Mohammed Naser | c6e431b | 2024-03-15 01:21:44 -0400 | [diff] [blame] | 1 | package barbican |
| 2 | |
| 3 | import ( |
| 4 | _ "embed" |
| 5 | "os" |
| 6 | "testing" |
| 7 | |
| 8 | "github.com/goccy/go-yaml" |
| 9 | "github.com/stretchr/testify/require" |
| 10 | |
| 11 | "github.com/vexxhost/atmosphere/internal/openstack_helm" |
| 12 | "github.com/vexxhost/atmosphere/internal/testutils" |
| 13 | ) |
| 14 | |
| 15 | var ( |
| 16 | //go:embed vars/main.yml |
| 17 | varsFile []byte |
| 18 | vars Vars |
| 19 | ) |
| 20 | |
| 21 | type Vars struct { |
| 22 | openstack_helm.HelmValues `yaml:"_barbican_helm_values"` |
| 23 | } |
| 24 | |
| 25 | func TestMain(m *testing.M) { |
| 26 | t := &testing.T{} |
| 27 | err := yaml.UnmarshalWithOptions(varsFile, &vars) |
| 28 | require.NoError(t, err) |
| 29 | |
| 30 | code := m.Run() |
| 31 | os.Exit(code) |
| 32 | } |
| 33 | |
| 34 | func TestHelmValues(t *testing.T) { |
| 35 | vals, err := openstack_helm.CoalescedHelmValues("../../charts/barbican", &vars.HelmValues) |
| 36 | require.NoError(t, err) |
| 37 | |
| 38 | testutils.TestDatabaseConf(t, vals.Conf.Barbican.Database) |
| 39 | } |