Skip to content

Run tests in CI and fix failing tests. #1672

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

Merged

Conversation

jeschkies
Copy link
Contributor

@jeschkies jeschkies commented Apr 7, 2025

The unit tests weren't running with each PR. This change adds a test_go step to the GitHub actions workflow.

Some tests were failing. This is due to a breaking change in Prometheus supporting UTF-8 characters.

NameValidationScheme is set to LegacyValidation globally to ensure the behaviour or former releases.

@jeschkies jeschkies force-pushed the karsten/ci-tests branch 5 times, most recently from 013873b to 5b3c575 Compare April 7, 2025 13:23
@@ -38,16 +38,16 @@ type cachingFactory interface {
Clear()
}

func NewScraper(featureFlags []string) *scraper { //nolint:revive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth making scraper public as it's used only in main.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The linter was complaining about the lint being present.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I saw a nolintlint false-positive bug recently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could be it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC we could revert this specific change if it was just a false positive?

Comment on lines +75 to +80
originalValidationScheme := model.NameValidationScheme
model.NameValidationScheme = model.LegacyValidation
defer func() {
model.NameValidationScheme = originalValidationScheme
}()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should raise attention to the breaking changes that added utf8 support:

These two dependencies are now merged on master (unreleased), meaning that yace can now potentially export labels with utf8 characters. If the remote write destination does not support utf8, this would result in breaking behaviour right? I'm wondering if we should stick to the old validation scheme for some more time and add a feature flag to enable the new scheme.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Could we do this in a follow up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do the part where we set the legacy validation in this PR? Once pandora's box is opened, I guess it's worth merging a fully usable solution.

@cristiangreco
Copy link
Contributor

@jeschkies can you please update the commit message and PR description with more info on the change?

@jeschkies jeschkies changed the title Run tests in CI Run tests in CI and fix failing tests. Apr 8, 2025
@jeschkies jeschkies force-pushed the karsten/ci-tests branch 3 times, most recently from dc702f8 to 1f2882c Compare April 9, 2025 07:00
Signed-off-by: Karsten Jeschkies <[email protected]>
@cristiangreco cristiangreco merged commit 19c4b9a into prometheus-community:master Apr 9, 2025
9 checks passed
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