Git Product home page Git Product logo

govuk-diff-pages's Introduction

govuk-diff-pages

This app provides a set of rake tasks that produce diffs of the staging and production GOV.UK websites. Diffs are provided in 3 distinct forms:

  • Visual
    • Screenshots of pages in each environment, compared and presented in an HTML gallery for viewing in a browser.
  • HTML
    • Diffs of the markup on each page, also presented in gallery form.
  • Text
    • Diffs of text content on each page, with the results sent to STDOUT.

Visual Diffs

These use a fork of the BBC's wraith gem (https://github.com/alphagov/wraith). The fork adds two extra configuration variables, allowing the user to specify the number of threads to use, and the maximum timeout when loading pages.

Running

The rake task expects an env var URI to be set - this should be the location of a YAML file containing a list of GOV.UK paths to run the diff against. See spec/fixtures/test_paths.yaml for an example.

bundle exec rake diff:visual URI=https://uri/to/a/yaml/file.yaml

Results are written to $PROJECT_ROOT/results/visual/gallery.html.

Dependencies

The following are required in order to run a visual diff. A pre-flight check for these dependencies runs when you execute the diff:visual task.

Examples

Example output

HTML Diffs

These use Diffy gem (https://github.com/samg/diffy) as the underlying diff library.

Running

Expects URI to be set, as with Visual Diffs.

bundle exec rake diff:html URI=https://uri/to/a/yaml/file.yaml

Results are written to $PROJECT_ROOT/results/html/gallery.html.

Text Diffs

These also use Diffy gem.

Running

bundle exec rake diff:text pages.yml

Where pages.yml is a YAML array of paths to compare. For example:

- government/organisations/prime-ministers-office-10-downing-street
- government/topical-events/budget-2016
- topic/competition/regulatory-appeals-references

Text diffs can also specify the domains to compare using the LEFT and RIGHT environment variables. Defaulting to our www-origin.staging and www-origin.publishing domains respectively.

Plain-text diffing can be parallelised by starting multiple processes with individual page files.

Running the test suite

bundle exec rspec

Licence

MIT License

govuk-diff-pages's People

Contributors

benlovell avatar tijmenb avatar stephenrichards-eu avatar davidslv avatar jackscotti avatar benhyland avatar

Stargazers

Keyth M Citizen  avatar Petru Hincu avatar

Watchers

Simon Whatley avatar  avatar Rebecca Cottrell avatar Steve Laing avatar Anika Henke avatar Ryan MacGillivray avatar Pete Goddard avatar Minno avatar Richard Baker avatar Tom avatar James Cloos avatar Mateusz Grotek avatar Adrian Clay avatar Chris Blackburn avatar Mark Hurrell avatar Tara Stockford avatar Andrew Leimdorfer avatar Rhian Lewis avatar  avatar Dr Keith Mitchell avatar Ash Chohan avatar Jani Kraner avatar Somme avatar Keith Lawrence avatar  avatar Barbara Slawinska avatar Dilwoar Hussain avatar Chae Cramb  avatar Johnathan Ishmael avatar  avatar Karl Baker avatar  avatar Leena Gupte avatar Rosa Fox avatar  avatar David Trussler avatar Jonathon Shire avatar Stephen Harker avatar Kevin Garwood avatar  avatar  avatar  avatar  avatar  avatar Shahina Rahman avatar Kyle MacPherson avatar Tasmin Steer avatar Rachel Smith avatar z-gooch avatar Jess Jones avatar Richard Morton avatar  avatar George Eaton avatar Ana Fernandez avatar Felix Harrison avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.