(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func TestValidateValuesFileSchemaFailure(t *testing.T) { |
| 87 | // 1234 is an int, not a string. This should fail. |
| 88 | yaml := "username: 1234\npassword: swordfish" |
| 89 | tmpdir := ensure.TempFile(t, "values.yaml", []byte(yaml)) |
| 90 | createTestingSchema(t, tmpdir) |
| 91 | |
| 92 | valfile := filepath.Join(tmpdir, "values.yaml") |
| 93 | |
| 94 | err := validateValuesFile(valfile, map[string]any{}, false) |
| 95 | if err == nil { |
| 96 | t.Fatal("expected values file to fail parsing") |
| 97 | } |
| 98 | |
| 99 | assert.Contains(t, err.Error(), "- at '/username': got number, want string") |
| 100 | } |
| 101 | |
| 102 | func TestValidateValuesFileSchemaFailureButWithSkipSchemaValidation(t *testing.T) { |
| 103 | // 1234 is an int, not a string. This should fail normally but pass with skipSchemaValidation. |
nothing calls this directly
no test coverage detected
searching dependent graphs…