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 unit tests for pkg/util #1343

Merged
merged 3 commits into from
Jun 10, 2021
Merged

Conversation

willbeason
Copy link
Member

@willbeason willbeason commented Jun 7, 2021

Several logic paths weren't tested, so this commit adds tests for those
paths. This gets test coverage for the package from ~82% to ~94%.

Also use new go 1.13 error checking for these tests.

Several logic paths weren't tested, so this commit adds tests for those
paths.

Also use new go1.13 error checking for these tests.

Signed-off-by: Will Beason <willbeason@google.com>
Copy link
Contributor

@maxsmythe maxsmythe left a comment

Choose a reason for hiding this comment

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

@codecov-commenter
Copy link

Codecov Report

Merging #1343 (7f1354c) into master (b1ebeb5) will increase coverage by 0.43%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1343      +/-   ##
==========================================
+ Coverage   48.42%   48.86%   +0.43%     
==========================================
  Files          68       68              
  Lines        4913     4916       +3     
==========================================
+ Hits         2379     2402      +23     
+ Misses       2181     2157      -24     
- Partials      353      357       +4     
Flag Coverage Δ
unittests 48.86% <100.00%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/util/enforcement_action.go 100.00% <100.00%> (+75.00%) ⬆️
pkg/util/pack.go 78.12% <100.00%> (+78.12%) ⬆️
...onstrainttemplate/constrainttemplate_controller.go 53.07% <0.00%> (-3.89%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b1ebeb5...7f1354c. Read the comment docs.

@maxsmythe maxsmythe merged commit 1eca2c6 into open-policy-agent:master Jun 10, 2021
@willbeason willbeason deleted the test-util branch June 10, 2021 15:16
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.

4 participants