Repository: bbc/wraith

Issue #293: Allow testing of subsets of config, not all paths
Created: 2015-10-04T18:47:50Z
If you have, say, 10 paths in your config.
But you're debugging, so only want to test 1 of those paths
When you comment out all the paths except the one you want to test
And you run Wraith
Then Wraith throws an error
When it should just generate a 1-image gallery.
(Fixing this would help more than just debugging. It would also allow multiple Wraith config files in the same repository, e.g. test.yaml and live.yaml, where not all environments might have the same number of endpoints).
IIRC, Wraith grabs all the images from the base directory and then compares them with all of the latest screenshots. We should turn this logic on its head, and have Wraith compare the latest screenshots with their equivalent in the base directory.

Duplicate issue #304: Make reliance on the base shots directory less brittle
Created: 2015-10-29T11:53:55Z
Say you have a shots directory with 2 subdirectories (corresponding to two paths in your YAML file).
If you comment out one of the paths and run wraith latest, you'll see an error like this:
Generating thumbnails
/usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:98:in `each': comparison of NilClass with 0.0 failed (ArgumentError)
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:98:in `max_by'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:98:in `block in sorting_dirs'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:98:in `each'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:98:in `sort_by'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:98:in `sorting_dirs'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:48:in `match'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:32:in `parse_directories'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/gallery.rb:122:in `generate_gallery'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/cli.rb:89:in `generate_gallery'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/lib/wraith/cli.rb:129:in `latest'
    from /usr/local/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /usr/local/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /usr/local/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /usr/local/lib/ruby/gems/2.1.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /usr/local/lib/ruby/gems/2.1.0/gems/wraith-2.6.0/bin/wraith:5:in `<top (required)>'
    from /usr/local/bin/wraith:23:in `load'
    from /usr/local/bin/wraith:23:in `<main>'

This is because Wraith grabs all the images in the base directory, then tries to compare against all the 'latest' screenshots - but by commenting out one of the paths, we now have too many base images.
Wraith should be smart enough to only grab the base images it requires.

Closing comment (2015-11-05T09:24:13Z): This is a duplicate of #293.