{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-analytics-pipeline/issues/109","labels_url":"https://api.github.com/repos/edx/edx-analytics-pipeline/issues/109/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-analytics-pipeline/issues/109/comments","events_url":"https://api.github.com/repos/edx/edx-analytics-pipeline/issues/109/events","html_url":"https://github.com/edx/edx-analytics-pipeline/pull/109","id":83691024,"number":109,"title":"Jamesrowan/unit tests refactor","user":{"login":"jrowan","id":5571464,"avatar_url":"https://avatars.githubusercontent.com/u/5571464?v=3","gravatar_id":"","url":"https://api.github.com/users/jrowan","html_url":"https://github.com/jrowan","followers_url":"https://api.github.com/users/jrowan/followers","following_url":"https://api.github.com/users/jrowan/following{/other_user}","gists_url":"https://api.github.com/users/jrowan/gists{/gist_id}","starred_url":"https://api.github.com/users/jrowan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrowan/subscriptions","organizations_url":"https://api.github.com/users/jrowan/orgs","repos_url":"https://api.github.com/users/jrowan/repos","events_url":"https://api.github.com/users/jrowan/events{/privacy}","received_events_url":"https://api.github.com/users/jrowan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/edx/edx-analytics-pipeline/labels/needs%20triage","name":"needs triage","color":"e11d21"},{"url":"https://api.github.com/repos/edx/edx-analytics-pipeline/labels/open-source-contribution","name":"open-source-contribution","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-01T20:59:37Z","updated_at":"2015-06-01T21:02:49Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-analytics-pipeline/pulls/109","html_url":"https://github.com/edx/edx-analytics-pipeline/pull/109","diff_url":"https://github.com/edx/edx-analytics-pipeline/pull/109.diff","patch_url":"https://github.com/edx/edx-analytics-pipeline/pull/109.patch"},"body":"updated -- the old PR was listed as an OSPR\r\n\r\nGeneralized the mixins in tasks/tests/map_reduce_mixins.py, which initially had only refactored video and student engagement tasks, to cover almost all other tasks (i.e. all but those tested in test_enrollment_validation.py or test_answer_dist.py, which have more complicated event dictionary formats).\r\n\r\nEquipped the mapper and reducer test mixins with additional methods to check outputs depending on the needs of particular subclasses, and in those subclasses defined the _check_output methods in terms of the general ones given in the mixins (except in test_answer_dist.py, which had a fairly specialized _check_output method).\r\n\r\nModified the individual test cases to be subclasses of the mixins and use mixin methods rather than repeating the same code (e.g. the code for checking that no mapper output is produced or the code for getting reducer output).\r\n\r\nRefactors were aimed at\r\n\r\n1) reducing the presence of copy-pasted methods and blocks of code to allow for increased readiness for change\r\n\r\n2) providing a clearer, more task-agnostic set of mixins for future test development. In particular, the mixins had setUp and reducer output check methods specific to the student_engagement and video tests, which failed to generalize nicely to the majority of our other test classes (which, for example, had to specify parameters other than interval and output_root in their init methods).\r\n\r\n@jab5569 @brianhw @mulby\r\n"},"comment":{"url":"https://api.github.com/repos/edx/edx-analytics-pipeline/issues/comments/107710450","html_url":"https://github.com/edx/edx-analytics-pipeline/pull/109#issuecomment-107710450","issue_url":"https://api.github.com/repos/edx/edx-analytics-pipeline/issues/109","id":107710450,"user":{"login":"sarina","id":1985317,"avatar_url":"https://avatars.githubusercontent.com/u/1985317?v=3","gravatar_id":"","url":"https://api.github.com/users/sarina","html_url":"https://github.com/sarina","followers_url":"https://api.github.com/users/sarina/followers","following_url":"https://api.github.com/users/sarina/following{/other_user}","gists_url":"https://api.github.com/users/sarina/gists{/gist_id}","starred_url":"https://api.github.com/users/sarina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarina/subscriptions","organizations_url":"https://api.github.com/users/sarina/orgs","repos_url":"https://api.github.com/users/sarina/repos","events_url":"https://api.github.com/users/sarina/events{/privacy}","received_events_url":"https://api.github.com/users/sarina/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T21:02:49Z","updated_at":"2015-06-01T21:02:49Z","body":"@jrowan the bot takes awhile to update, and I had deleted the last OSPR ticket, there was no problem with just leaving the last one open. I will delete this ticket. Please just use this pull request, don't close and create a new one - it won't be \"listed\" as an OSPR ticket once I delete the ticket."}}