{"action":"created","comment":{"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments/83818039","pull_request_review_id":4634236,"id":83818039,"diff_hunk":"@@ -0,0 +1,47 @@\n+from app.schema_loader import schema_loader\n+import json\n+import jsonschema\n+import logging\n+import unittest\n+import os\n+\n+from app import settings\n+\n+from jsonschema import validate\n+\n+\n+logger = logging.getLogger(__name__)\n+\n+\n+class TestSchemaValidation(unittest.TestCase):\n+\n+    def test_schema(self):\n+\n+      errors = []\n+\n+      for file in schema_loader.available_schemas():\n+\n+        try:\n+\n+          schema_file = open(os.path.join(settings.EQ_SCHEMA_DIRECTORY, file), encoding=\"utf8\")\n+\n+          self.validate_json_against_schema(json.load(schema_file))\n+\n+        except jsonschema.exceptions.ValidationError as e:","path":"tests/app/data/test_schema_validation.py","position":30,"original_position":30,"commit_id":"f0e9dd6b005fd0a40a5d6f6ef08ea1f9b953cbbc","original_commit_id":"f0e9dd6b005fd0a40a5d6f6ef08ea1f9b953cbbc","user":{"login":"ajmaddaford","id":1754822,"avatar_url":"https://avatars.githubusercontent.com/u/1754822?v=3","gravatar_id":"","url":"https://api.github.com/users/ajmaddaford","html_url":"https://github.com/ajmaddaford","followers_url":"https://api.github.com/users/ajmaddaford/followers","following_url":"https://api.github.com/users/ajmaddaford/following{/other_user}","gists_url":"https://api.github.com/users/ajmaddaford/gists{/gist_id}","starred_url":"https://api.github.com/users/ajmaddaford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajmaddaford/subscriptions","organizations_url":"https://api.github.com/users/ajmaddaford/orgs","repos_url":"https://api.github.com/users/ajmaddaford/repos","events_url":"https://api.github.com/users/ajmaddaford/events{/privacy}","received_events_url":"https://api.github.com/users/ajmaddaford/received_events","type":"User","site_admin":false},"body":"The try and exception here should be around the `jsonschema.validate` method below.","created_at":"2016-10-18T09:46:40Z","updated_at":"2016-10-18T09:49:14Z","html_url":"https://github.com/ONSdigital/eq-survey-runner/pull/491#discussion_r83818039","pull_request_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491","_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments/83818039"},"html":{"href":"https://github.com/ONSdigital/eq-survey-runner/pull/491#discussion_r83818039"},"pull_request":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491"}}},"pull_request":{"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491","id":89202294,"html_url":"https://github.com/ONSdigital/eq-survey-runner/pull/491","diff_url":"https://github.com/ONSdigital/eq-survey-runner/pull/491.diff","patch_url":"https://github.com/ONSdigital/eq-survey-runner/pull/491.patch","issue_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/491","number":491,"state":"open","locked":false,"title":"added json schema validation as a test to validate all files in app/data","user":{"login":"jonnyshaw89","id":7594012,"avatar_url":"https://avatars.githubusercontent.com/u/7594012?v=3","gravatar_id":"","url":"https://api.github.com/users/jonnyshaw89","html_url":"https://github.com/jonnyshaw89","followers_url":"https://api.github.com/users/jonnyshaw89/followers","following_url":"https://api.github.com/users/jonnyshaw89/following{/other_user}","gists_url":"https://api.github.com/users/jonnyshaw89/gists{/gist_id}","starred_url":"https://api.github.com/users/jonnyshaw89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonnyshaw89/subscriptions","organizations_url":"https://api.github.com/users/jonnyshaw89/orgs","repos_url":"https://api.github.com/users/jonnyshaw89/repos","events_url":"https://api.github.com/users/jonnyshaw89/events{/privacy}","received_events_url":"https://api.github.com/users/jonnyshaw89/received_events","type":"User","site_admin":false},"body":"### What is the context of this PR?\r\nHave added a test that loads all of the json files in app/data and validates them against the schema\r\n\r\n### How to review \r\nCheck that the test is validating the json files\r\n","created_at":"2016-10-13T13:30:26Z","updated_at":"2016-10-18T09:49:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"09f46709d704607d6ff8fdcc41641ff4c8e334ba","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491/commits","review_comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491/comments","review_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/491/comments","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/f0e9dd6b005fd0a40a5d6f6ef08ea1f9b953cbbc","head":{"label":"ONSdigital:schema-validation","ref":"schema-validation","sha":"f0e9dd6b005fd0a40a5d6f6ef08ea1f9b953cbbc","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":49205589,"name":"eq-survey-runner","full_name":"ONSdigital/eq-survey-runner","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/eq-survey-runner","description":"eQ Survey Runner","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner","forks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/deployments","created_at":"2016-01-07T13:15:26Z","updated_at":"2016-08-31T19:47:26Z","pushed_at":"2016-10-18T09:26:28Z","git_url":"git://github.com/ONSdigital/eq-survey-runner.git","ssh_url":"git@github.com:ONSdigital/eq-survey-runner.git","clone_url":"https://github.com/ONSdigital/eq-survey-runner.git","svn_url":"https://github.com/ONSdigital/eq-survey-runner","homepage":null,"size":7529,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":3,"default_branch":"master"}},"base":{"label":"ONSdigital:master","ref":"master","sha":"8933dfb7e6e91cc9463cee5c3e505230a5f65a92","user":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"repo":{"id":49205589,"name":"eq-survey-runner","full_name":"ONSdigital/eq-survey-runner","owner":{"login":"ONSdigital","id":6865137,"avatar_url":"https://avatars.githubusercontent.com/u/6865137?v=3","gravatar_id":"","url":"https://api.github.com/users/ONSdigital","html_url":"https://github.com/ONSdigital","followers_url":"https://api.github.com/users/ONSdigital/followers","following_url":"https://api.github.com/users/ONSdigital/following{/other_user}","gists_url":"https://api.github.com/users/ONSdigital/gists{/gist_id}","starred_url":"https://api.github.com/users/ONSdigital/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ONSdigital/subscriptions","organizations_url":"https://api.github.com/users/ONSdigital/orgs","repos_url":"https://api.github.com/users/ONSdigital/repos","events_url":"https://api.github.com/users/ONSdigital/events{/privacy}","received_events_url":"https://api.github.com/users/ONSdigital/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ONSdigital/eq-survey-runner","description":"eQ Survey Runner","fork":false,"url":"https://api.github.com/repos/ONSdigital/eq-survey-runner","forks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/forks","keys_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/teams","hooks_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/hooks","issue_events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/events{/number}","events_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/events","assignees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/assignees{/user}","branches_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/branches{/branch}","tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/tags","blobs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/refs{/sha}","trees_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/{sha}","languages_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/languages","stargazers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/stargazers","contributors_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contributors","subscribers_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscribers","subscription_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/subscription","commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/commits{/sha}","git_commits_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/git/commits{/sha}","comments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/comments{/number}","issue_comment_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/comments{/number}","contents_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/contents/{+path}","compare_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/merges","archive_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/downloads","issues_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues{/number}","pulls_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls{/number}","milestones_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/milestones{/number}","notifications_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/labels{/name}","releases_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/releases{/id}","deployments_url":"https://api.github.com/repos/ONSdigital/eq-survey-runner/deployments","created_at":"2016-01-07T13:15:26Z","updated_at":"2016-08-31T19:47:26Z","pushed_at":"2016-10-18T09:26:28Z","git_url":"git://github.com/ONSdigital/eq-survey-runner.git","ssh_url":"git@github.com:ONSdigital/eq-survey-runner.git","clone_url":"https://github.com/ONSdigital/eq-survey-runner.git","svn_url":"https://github.com/ONSdigital/eq-survey-runner","homepage":null,"size":7529,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":14,"forks":1,"open_issues":14,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491"},"html":{"href":"https://github.com/ONSdigital/eq-survey-runner/pull/491"},"issue":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/491"},"comments":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/issues/491/comments"},"review_comments":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491/comments"},"review_comment":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/pulls/491/commits"},"statuses":{"href":"https://api.github.com/repos/ONSdigital/eq-survey-runner/statuses/f0e9dd6b005fd0a40a5d6f6ef08ea1f9b953cbbc"}}}}
{"actor":{"display_login":"ajmaddaford"}}