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 broken windows unit tests #1668

Merged
merged 1 commit into from
Sep 11, 2024
Merged

Fix broken windows unit tests #1668

merged 1 commit into from
Sep 11, 2024

Conversation

ptodev
Copy link
Contributor

@ptodev ptodev commented Sep 11, 2024

There were a couple of tests which were failing on the main branch since #1527 was merged.

One test was about pointer reuse:

--- FAIL: TestSetDefault_NoPointerReuse (0.00s)
    --- FAIL: TestSetDefault_NoPointerReuse/prometheus.exporter.windows (0.00s)
        all_test.go:27: 
            	Error Trace:	C:/drone/src/internal/component/all/all_test.go:61
            	            				C:/drone/src/internal/component/all/all_test.go:27
            	Error:      	Detected SetToDefault pointer reuse at github.com/grafana/alloy/internal/component/prometheus/exporter/windows.Arguments.Dfsr.SourcesEnabled
            	Test:       	TestSetDefault_NoPointerReuse/prometheus.exporter.windows
            	Messages:   	Types implementing syntax.Defaulter must not reuse pointers across multiple calls. Doing so leads to default values being changed when unmarshaling configuration files. If you're seeing this error, check the path above and ensure that copies are being made of any pointers in all instances of SetToDefault calls where that field is used.
FAIL
FAIL	github.com/grafana/alloy/internal/component/all	1.160s

The other failing tests were for the converters. The integration tests wanted to add smb and smb_client Alloy config, because the split function would output a [""] instead of [], and the converter tests thought that Alloy's defaults are different from static mode's defaults.

Btw static mode doesn't even support these smb and smb_client parameters... But I'm not 100% how to ignore them right now, so I'll leave this for another day 😄 It's not really important, since no one who uses static mode would set them in their config anyway.

@ptodev ptodev requested review from clayton-cornell and a team as code owners September 11, 2024 17:23
Copy link
Collaborator

@mattdurham mattdurham left a comment

Choose a reason for hiding this comment

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

LGTM

@ptodev ptodev merged commit be042d4 into main Sep 11, 2024
18 checks passed
@ptodev ptodev deleted the ptodev/fix-pointer-reuse branch September 11, 2024 17:37
ptodev added a commit that referenced this pull request Sep 11, 2024
ptodev added a commit that referenced this pull request Sep 11, 2024
This pull request was closed.
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.

2 participants