-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add test for pkg/utils/flock #878
Conversation
Codecov Report
@@ Coverage Diff @@
## devel #878 +/- ##
==========================================
+ Coverage 37.53% 37.70% +0.17%
==========================================
Files 44 44
Lines 8576 8576
==========================================
+ Hits 3219 3234 +15
+ Misses 5111 5095 -16
- Partials 246 247 +1 |
pkg/utils/flock_test.go
Outdated
t.Parallel() | ||
|
||
if tt.name == "Good Test" { | ||
f, err := os.CreateTemp("", "") |
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.
So this style of testing creates files and directories on the system running these tests. If we look at other unit tests in receptor, we wrap these types of calls so that nothing is created on the system and we mock the responses.
Some examples of this can be found in how calls to the os
library have been mocked in stdio_utils.go
and then used in stdio_utils_test.go
.
Please consider wrapping the syscall
's in flock using the Accept interfaces, return structs
principle
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
No description provided.