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 InstrumentedEnqueueRequestForObject #15

Merged
merged 4 commits into from
Jul 30, 2020

Conversation

jmrodri
Copy link
Member

@jmrodri jmrodri commented Jul 26, 2020

Added a test for the InstrumentedEnqueueRequestForObject to increase the code coverage.

Before the test, handler was at 71.2%

$ make test                                                          
ok      github.com/operator-framework/operator-lib/handler      1.080s  coverage: 71.2% of statements   
...

After adding the test, coverage goes to 100%

$ make test                                                  
ok      github.com/operator-framework/operator-lib/handler      1.082s  coverage: 100.0% of statements
...

@coveralls
Copy link

coveralls commented Jul 26, 2020

Pull Request Test Coverage Report for Build 188099145

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+8.8%) to 80.052%

Totals Coverage Status
Change from base Build 187369912: 8.8%
Covered Lines: 309
Relevant Lines: 386

💛 - Coveralls

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

Just a few nits:

@jmrodri
Copy link
Member Author

jmrodri commented Jul 28, 2020

Just a few nits:

* Could we add the suffix `_test` which has [special meaning for the Go compiler](https://github.com/golang/go/issues/25223)? So, it would be `package handler_test` instead of `package handler`
  `

No, I wanted it in the same package as the code so I could also test the unexported methods. If we put it in package handler_test then we can only test the exported method which is great but sometimes it's easier to test the error conditions of the unexported methods directly.

Copy link
Contributor

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

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

/lgtm 👍

Copy link
Member

@joelanford joelanford left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2020
@jmrodri jmrodri merged commit d5362cf into operator-framework:main Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants