Feature: Announcing ready videos to the catalogue A video is only worth showing once its transcode has finished. When MediaConvert reports a job complete, cms announces that video on a queue of its own — the seam the read side reads to build the public catalogue, so nothing downstream has to poll cms or reach into its database. The announcement is the published contract: the video's id, its title, the URL a player can open, and the categories it is filed under, named rather than numbered so a reader needs nothing from cms to make sense of it. Background: Given the CMS API is available Scenario: A finished job announces the video to the catalogue Given I have registered a video that is being transcoded When MediaConvert reports that the job reached "COMPLETE" Then the video eventually has status "ready" And the catalogue is told about the video And the announcement carries the video's title, playback URL and categories # The catalogue is a list of things worth showing. A job that ended in an # error produced nothing to play, so it is recorded against the video and # goes no further. Scenario Outline: A job that did not finish is not announced Given I have registered a video that is being transcoded When MediaConvert reports that the job reached "" Then the video eventually has status "failed" And the catalogue is told nothing about the video Examples: | state | | ERROR | | CANCELED | # A video can be filed under several categories, so the announcement carries # all of them. Names, not the ids the register call took: what cms numbers # them is its own business. Scenario: The announcement lists every category the video is filed under Given I have registered a video being transcoded under categories "documentary, news, podcast" When MediaConvert reports that the job reached "COMPLETE" Then the video eventually has status "ready" And the catalogue is told about the video And the announcement files it under "documentary, news, podcast"