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][cmd/mdatagen] Properly test bytes attribute type #30106

Merged
merged 1 commit into from
Jan 5, 2024
Merged
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/mdatagen/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (a attribute) TestValue() string {
case pcommon.ValueTypeSlice:
return fmt.Sprintf(`[]any{"%s-item1", "%s-item2"}`, a.FullName, a.FullName)
case pcommon.ValueTypeBytes:
return fmt.Sprintf(`bytes("%s-val")`, a.FullName)
return fmt.Sprintf(`[]byte("%s-val")`, a.FullName)
Copy link

@mmynk mmynk Dec 20, 2023

Choose a reason for hiding this comment

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

Is it possible to unit test these?

Copy link
Member Author

Choose a reason for hiding this comment

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

There aren't tests for this at this point. It's not a bad idea, but given the facts that this is only used for generating test code, it shouldn't change very frequently, and it can't build when something is wrong, I don't see as much value for this specific test case at this point. I'm open to feedback from others though.

}
return ""
}
Expand Down