Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #1261

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/pint/tests/0206_parser_schema_err.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=ERROR msg="Fatal error" err="failed to load config file \".pint.hcl\": unsupported parser scheme: bogus"
level=ERROR msg="Fatal error" err="failed to load config file \".pint.hcl\": unsupported parser schema: bogus"
-- rules/1.yml --
groups:
- name: foo
Expand Down
8 changes: 8 additions & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2343,6 +2343,14 @@ func TestConfigErrors(t *testing.T) {
config: `parser {include = [".+", ".+++"]}`,
err: "error parsing regexp: invalid nested repetition operator: `++`",
},
{
config: `parser {schema = "foo"}`,
err: "unsupported parser schema: foo",
},
{
config: `parser {names = "foo"}`,
err: "unsupported parser names: foo",
},
{
config: `repository {
bitbucket {
Expand Down
2 changes: 1 addition & 1 deletion internal/config/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (p Parser) validate() error {
case SchemaPrometheus:
case SchemaThanos:
default:
return fmt.Errorf("unsupported parser scheme: %s", s)
return fmt.Errorf("unsupported parser schema: %s", s)
}

switch n := p.getNames(); n {
Expand Down
8 changes: 7 additions & 1 deletion internal/config/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ func TestParserSettings(t *testing.T) {
conf: Parser{
Schema: "xxx",
},
err: errors.New("unsupported parser scheme: xxx"),
err: errors.New("unsupported parser schema: xxx"),
},
{
conf: Parser{
Names: "xxx",
},
err: errors.New("unsupported parser names: xxx"),
},
}

Expand Down
Loading