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

Improve tests coverage #93

Closed
umputun opened this issue Apr 24, 2022 · 3 comments
Closed

Improve tests coverage #93

umputun opened this issue Apr 24, 2022 · 3 comments

Comments

@umputun
Copy link
Owner

umputun commented Apr 24, 2022

The overall coverage is not what impressive and there are a few important files/units we would like to cover first:

  • proc/processor.go - not tested, but should be easy to do, all deps in interfaces already
  • proc/twitter.go - the primary method Send is not covered. Needs some abstractions for testing as it hits anaconda directly
  • main.go - we need some integration tests. Running a local httptest to serve feeds with local mp3 and check resulting feed will be very nice. main has no termination support which needed to such a test
  • proc/telegram.go - Send is not covered Add tests to telegram package #87
@romangr
Copy link
Contributor

romangr commented Apr 25, 2022

I'm looking at proc/processor.go but have a couple of questions:

  1. There is a direct http call in rss, err := feed.Parse(url). Shouldn't we add an abstraction here as well?

  2. I'm not sure how to correctly terminate for {} loop in the processor's Do func. I guess it should be some mechanism that can be used to implement termination in the main.go integration test as well.

@umputun
Copy link
Owner Author

umputun commented Apr 25, 2022

I'm not sure how to correctly terminate for {} loop in the processor's Do

We just need to support ctx as a first parameter and use it for cancelation

There is a direct http call in rss, err := feed.Parse(url). Shouldn't we add an abstraction here as well?

I'm not sure if it is really necessary, because we can make httptest.Server to respond to URL without any mocking of feed.Parse

@romangr
Copy link
Contributor

romangr commented Apr 25, 2022

OK, thx for your answers, I'll try to implement it this week

oneils added a commit to oneils/feed-master that referenced this issue Dec 16, 2022
   - added test for covering Send
oneils added a commit to oneils/feed-master that referenced this issue Dec 18, 2022
   - added test for covering Send
oneils added a commit to oneils/feed-master that referenced this issue Dec 18, 2022
   - added test for covering Send
umputun pushed a commit that referenced this issue Dec 18, 2022
   - added test for covering Send
@umputun umputun closed this as completed Aug 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants