-
Notifications
You must be signed in to change notification settings - Fork 4
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
Skip metrics/traces with refactor #105
base: main
Are you sure you want to change the base?
Skip metrics/traces with refactor #105
Conversation
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.
LGTM, thanks for this!
I'd have preferred two PRs, one with the refactor and one adding the new config, but I think this is clear enough to be merged as one.
internal/transform/suites.go
Outdated
Meter(string) metric.Meter | ||
} | ||
|
||
func TransformAndLoadSuites(ctx context.Context, cfg *config.Config, provider OtelProvider, |
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.
nit: is the function name duplicating the package name? Having to use it like this transform.TransformAndLoadSuites
seems weird. The natural AndLoadSuites
sounds incorrect, although not sure about WithLoadSuites
. wdyt?
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 will think about this on my walk and adjust the name when I get back.
|
||
import "os" | ||
|
||
type FileReader struct { |
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.
question: if this is used only in tests, do we need it to be exposed, even under the internal package?
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.
In the future we may use it for more than tests. If a switch is added to take a file path we can use it for that.
I agree. I almost made a separate PR. I wanted to also have the skip metric/trace tests to demonstrate why the |
At some point I'm going to want to add an interface mocker to improve test coverage. Any objections or preferences on which? |
11567df
to
723d5c6
Compare
I made some adjustments that I think addresses the concerns with the naming. |
@ryanrolds I've not forgotten this 🙏 I'm at Gophercon SG returning back to Spain next Monday. |
Here is a purposed implementation of skip metrics/traces with a refactoring of the project structure and introduction of a config package. The refactor made adding the tests easier and will make implementing tests easier in the future.
Please let me know what you think. I'm happy to adjust it.
Major changes
internal
.intenal/config
package to handle configurationMain
toRun
TestReader
toFileReader
FakeGitRepo
that required the samples existing in the same dir as the test and the root of the repo