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

Add test for pkg/utils/flock #878

Closed
wants to merge 7 commits into from

Conversation

thom-at-redhat
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #878 (74792e2) into devel (63ee265) will increase coverage by 0.17%.
The diff coverage is n/a.

@@            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     

see 3 files with indirect coverage changes

t.Parallel()

if tt.name == "Good Test" {
f, err := os.CreateTemp("", "")
Copy link
Contributor

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

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@thom-at-redhat thom-at-redhat deleted the add_flock_test branch January 16, 2024 15:48
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