canvas-lms/gems/canvas_http
Brian Palmer 554789efbf fix the CanvasHttp::Error superclass
It was inheriting from Exception, so the rescue clause in
external_feed_aggregator.rb wasn't catching it, causing the entire
ExternalFeedAggregator.process job to fail.

Looking at the other uses of CanvasHttp, I see no reason to believe that
this was intentional.

closes CNVS-21213

Test plan: as mentioned above the problem here is that when an
ExternalFeed throws this error, it was not being caught properly and so
all external feeds afterwards in the queue would not be processed.  In
order to recreate these conditions we need a feed that fails and then we
need to make sure there are more feeds afterwards in the queue.
- First add a valid rss external feed.  We'll use this just to make sure
  the system is working.
- Then add a url (doesn't even have to be to an rss feed) that redirects
  more than 3 times before resolving.  This will trigger the redirect
  error, that was causing the problem.  You can verify if a url will break
  by running CanvasHttp.get('http://broken.redirects') in a rails console
- Then add another valid rss feed.  This will be the one that comes
  after the broken one, and it working successfully is what we're
  looking for.
- The system loads feeds to check in order of a "refresh_date" which is
  initially set to the time they were created, and then reset to the last
  time they were updated. This is why the order of creation is important
  above, because we'll create a refresh order that has a valid feed after
  a broken feed.
- The feed import system is set up to ignore rss entries that were
  created before the feed object was created. To get around this, you
  can manually update the created_at time of these objects.  Find a time
  that is before the last entry in the two valid feeds, and run:
    `ExternalFeed.update_all(created_at: 6.hours.ago)`
- Finally we're set, just run this in the console, to simulate the
  delayed job that runs:
    `ExternalFeedAggregator.process`
- And ensure that new entries from both the first and third feeds are
  imported.

Change-Id: If60158719d1b618c1e706ea0d056bc6b08f87457
Reviewed-on: https://gerrit.instructure.com/53494
Reviewed-by: Simon Williams <simon@instructure.com>
Tested-by: Jenkins
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2015-06-17 14:44:40 +00:00
..
lib fix the CanvasHttp::Error superclass 2015-06-17 14:44:40 +00:00
spec align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
Gemfile Extract canvas_http into seperate gem. 2014-04-02 17:22:38 +00:00
Rakefile Extract canvas_http into seperate gem. 2014-04-02 17:22:38 +00:00
canvas_http.gemspec align rspec version in gems with parent 2014-08-12 22:27:39 +00:00
test.sh bundle check before bundle install for gem tests 2014-06-03 20:09:10 +00:00