-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[processor/transform] Flatten functions #10489
[processor/transform] Flatten functions #10489
Conversation
/cc @anuraaga |
"go.opentelemetry.io/collector/pdata/pmetric" | ||
) | ||
|
||
func Test_convert_gauge_to_sum(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure there's really a benefit to matching the test name style (snake case). It should be easy enough to correlate using normal syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was actual to match the query language syntax, but I will use the actual Go function name instead bc that is what is being tested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@djaglowski updated test function names
* Add all existing scenarios to reflection * Update tests to only test NewFunctionCall * Break out switch statements * Small adjustments * Update changelog * Added testhelper * moved functions into their own files * added tests for keep_keys and limit * Switched tests to use generic ctx instead of trace * updated more tests * removed all instances of ptrace from common * fix merge * flattened metric functions * Simplify test context * Fix lint issues * Fix lint issues * Fix lint issues * ran make gotidy * Update test function names
Description:
This PR is the next step towards our ongoing function refactor. This PR moves each function into its own file with its own test file. This makes it easier to:
NewFunctionCall
. For functions incommon
, they can now be tested independently of any specific signal.functions.go
to register it. A CONTRIBUTING.md will be added in a separate PR.This PR does introduce a significant number of duplicate tests. Once this PR is merged I plan to remove all the duplicate tests from the signal-specific
functions.go
files.Link to tracking Issue:
#10101
Testing:
Updated unit tests
Documentation:
This is a no-functionality change, so all existing documentation is correct.