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

chore: add tests to defend against influx parser changes #196

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

alexgreenbank
Copy link
Contributor

@alexgreenbank alexgreenbank commented Dec 17, 2024

replaceInvalidChars() shouldn't be called with an empty string but we can't guarantee that as it is called on the result(s) of an influx library call.

Add some defensive code just in case this assumption ever changes.

Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
@alexgreenbank alexgreenbank requested a review from a team December 17, 2024 21:33
Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
Copy link
Contributor

Go coverage report (click to expand)
File %
github.com/grafana/influx2cortex/cmd/influx2cortex/main.go 0.0%
github.com/grafana/influx2cortex/pkg/influx/api.go 95.1%
github.com/grafana/influx2cortex/pkg/influx/errors.go 92.6%
github.com/grafana/influx2cortex/pkg/influx/parser.go 85.1%
github.com/grafana/influx2cortex/pkg/influx/proxy.go 64.6%
github.com/grafana/influx2cortex/pkg/influx/recorder.go 91.7%
github.com/grafana/influx2cortex/pkg/internalserver/service.go 0.0%
total 62.6%

Signed-off-by: alexgreenbank <alex.greenbank@grafana.com>
@alexgreenbank alexgreenbank merged commit c4d6d69 into main Dec 18, 2024
8 checks passed
@alexgreenbank alexgreenbank deleted the alexg/fix-replace-bug branch December 18, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants