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

chore: increases rule.go test coverage #786

Merged
merged 5 commits into from May 9, 2023

Conversation

M4tteoP
Copy link
Member

@M4tteoP M4tteoP commented May 5, 2023

PR meant to increase rule.go test coverage

@M4tteoP M4tteoP requested a review from a team as a code owner May 5, 2023 10:41
@M4tteoP M4tteoP changed the title Increases rule.go test coverage chore: increases rule.go test coverage May 5, 2023

type dummyFlowAction struct{}

func (a *dummyFlowAction) Init(_ plugintypes.RuleMetadata, data string) error {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
func (a *dummyFlowAction) Init(_ plugintypes.RuleMetadata, data string) error {
func (a *dummyFlowAction) Init(_ plugintypes.RuleMetadata, _ string) error {

func (a *dummyFlowAction) Init(_ plugintypes.RuleMetadata, data string) error {
return nil
}
func (a *dummyFlowAction) Evaluate(r plugintypes.RuleMetadata, tx plugintypes.TransactionState) {
Copy link
Member

Choose a reason for hiding this comment

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

You don´t need the receiver here (namely a) as you aren't accesing any field.

Copy link
Member

@jcchavezs jcchavezs left a comment

Choose a reason for hiding this comment

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

Just very small nits around parameter name and receivers as they aren't needed but overall looks great.

@jcchavezs jcchavezs requested a review from anuraaga May 5, 2023 11:19
@codecov
Copy link

codecov bot commented May 5, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.13 🎉

Comparison is base (21dfb41) 81.78% compared to head (aa65b2b) 81.92%.

Additional details and impacted files
@@            Coverage Diff             @@
##           v3/dev     #786      +/-   ##
==========================================
+ Coverage   81.78%   81.92%   +0.13%     
==========================================
  Files         153      153              
  Lines        8204     8205       +1     
==========================================
+ Hits         6710     6722      +12     
+ Misses       1274     1266       -8     
+ Partials      220      217       -3     
Flag Coverage Δ
default 78.20% <100.00%> (+0.17%) ⬆️
examples 25.95% <0.00%> (-0.01%) ⬇️
ftw 49.06% <100.00%> (+<0.01%) ⬆️
ftw-multiphase 49.18% <100.00%> (+<0.01%) ⬆️
tinygo 77.36% <100.00%> (+0.18%) ⬆️

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

Impacted Files Coverage Δ
internal/corazawaf/rule.go 80.04% <100.00%> (+2.46%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

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

LGTM

@jcchavezs jcchavezs merged commit 75478a3 into corazawaf:v3/dev May 9, 2023
9 checks passed
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.

None yet

3 participants