umputun / feed-master

Pulls multiple podcast feeds (RSS) and republishes as a common feed, properly sorted and podcast-client friendly.
https://feed-master.umputun.dev
MIT License
118 stars 26 forks source link

Improve tests coverage #93

Closed umputun closed 1 year ago

umputun commented 2 years ago

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

romangr commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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