{"action":"created","comment":{"url":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/comments/48713878","id":48713878,"diff_hunk":"@@ -0,0 +1,85 @@\n+\"\"\"\n+This test file is part of the openPMD-viewer.\n+\n+It makes sure that the tutorial notebooks run without error.\n+\n+Usage:\n+This file is meant to be run from the root directory of openPMD-viewer,\n+by any of the following commands\n+$ python tests/test_tutorials.py\n+$ py.test\n+$ python setup.py test\n+\"\"\"\n+import os, urllib, tarfile\n+import re\n+\n+def test_tutorials():\n+    \"\"\"Test all the tutorial notebooks\"\"\"\n+\n+    # Go to the relative path where all tutorial notebooks are\n+    os.chdir( 'tutorials' )\n+    tutorial_notebooks = [ filename for filename in os.listdir('./') \\\n+                           if filename[-6:] == '.ipynb' ]\n+\n+    # Loop through the tutorials and test them\n+    for notebook_name in tutorial_notebooks:\n+\n+        # Do a first pass where only the non-IPython features are tested.\n+        # (This gives better debugging information.)\n+        # The notebook is converted to a standard Python script and\n+        # run directly with `execfile`\n+        script_name = notebook_name[:-6] + '.py'\n+        os.system( 'ipython nbconvert --to=python %s' %notebook_name )\n+        clean_ipython_features( script_name )\n+        execfile( script_name )","path":"tests/test_tutorials.py","position":34,"original_position":34,"commit_id":"c32d3879c0cc16dc35ff4c22c9a5fdf68e5b84ff","original_commit_id":"c32d3879c0cc16dc35ff4c22c9a5fdf68e5b84ff","user":{"login":"ax3l","id":1353258,"avatar_url":"https://avatars.githubusercontent.com/u/1353258?v=3","gravatar_id":"","url":"https://api.github.com/users/ax3l","html_url":"https://github.com/ax3l","followers_url":"https://api.github.com/users/ax3l/followers","following_url":"https://api.github.com/users/ax3l/following{/other_user}","gists_url":"https://api.github.com/users/ax3l/gists{/gist_id}","starred_url":"https://api.github.com/users/ax3l/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ax3l/subscriptions","organizations_url":"https://api.github.com/users/ax3l/orgs","repos_url":"https://api.github.com/users/ax3l/repos","events_url":"https://api.github.com/users/ax3l/events{/privacy}","received_events_url":"https://api.github.com/users/ax3l/received_events","type":"User","site_admin":false},"body":"do you really want to *source* the other script into the current one? Or just execute an other script?\r\nIn the latter case, execfile is not the right choice.","created_at":"2016-01-04T09:18:44Z","updated_at":"2016-01-04T09:18:44Z","html_url":"https://github.com/openPMD/openPMD-viewer/pull/33#discussion_r48713878","pull_request_url":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/comments/48713878"},"html":{"href":"https://github.com/openPMD/openPMD-viewer/pull/33#discussion_r48713878"},"pull_request":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33","id":54872160,"html_url":"https://github.com/openPMD/openPMD-viewer/pull/33","diff_url":"https://github.com/openPMD/openPMD-viewer/pull/33.diff","patch_url":"https://github.com/openPMD/openPMD-viewer/pull/33.patch","issue_url":"https://api.github.com/repos/openPMD/openPMD-viewer/issues/33","number":33,"state":"closed","locked":false,"title":"Close #22 : Add Continuous Integration","user":{"login":"RemiLehe","id":6685781,"avatar_url":"https://avatars.githubusercontent.com/u/6685781?v=3","gravatar_id":"","url":"https://api.github.com/users/RemiLehe","html_url":"https://github.com/RemiLehe","followers_url":"https://api.github.com/users/RemiLehe/followers","following_url":"https://api.github.com/users/RemiLehe/following{/other_user}","gists_url":"https://api.github.com/users/RemiLehe/gists{/gist_id}","starred_url":"https://api.github.com/users/RemiLehe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RemiLehe/subscriptions","organizations_url":"https://api.github.com/users/RemiLehe/orgs","repos_url":"https://api.github.com/users/RemiLehe/repos","events_url":"https://api.github.com/users/RemiLehe/events{/privacy}","received_events_url":"https://api.github.com/users/RemiLehe/received_events","type":"User","site_admin":false},"body":"**Please merge pull request #32 first**\r\n\r\n## Overview\r\n\r\nFollowing the advice of @ax3l, this pull requests:\r\n- Creates a set of automated tests. These tests can now be run by typing `python setup.py test`, as mentioned in CONTRIBUTING.md.\r\n- Links them to [Travis CI](https://travis-ci.org/), so that these tests are automatically run every time someone pushes commits to the Github repository. (The tests run on remote servers that provided for free by Travis CI.)\r\n\r\nI heavily relied on [Open Sourcing a Python Project the Right Way](https://www.jeffknupp.com/blog/2013/08/16/open-sourcing-a-python-project-the-right-way/), when doing these changes.\r\n\r\nNB: I also updated some of the installation instructions as they were no longer valid.\r\n\r\n## More details on the automated tests\r\n\r\nFor the moment they are quite basic: they simply make sure that the notebooks in the `tutorials` directory run without any problem. This is done by converting the notebooks to pure-Python scripts and running these scripts. Therefore, the features that are specific to the IPython notebook (mainly the GUI) are not tested (I did not find a way to test them, but it would be nice to have one !).\r\n\r\n## More details on the tests on Travis CI\r\n\r\nThe Travis CI instructions are given in `.travis.yml`. The tests include:\r\n- Installing openPMD-viewer from scratch, by first installing a light version of Anaconda ([Miniconda](http://conda.pydata.org/miniconda.html)), installing all the listed dependencies of openPMD-viewer, and installing openPMD-viewer itself.\r\n- Running `python setup.py test` to check the tutorial notebooks.\r\n\r\nThis is done for each push and also each pull requests, resulting in e.g. a nice button below saying that \"All checks have passed\".\r\n\r\nI have set up Travis CI for my own fork of openPMD-viewer, and for the main repository. But I think that for the other forks, their owner have to register to Travis CI themselves if they want the tests to be run on their forks. See [Getting started - Travis CI](https://docs.travis-ci.com/user/getting-started/)","created_at":"2015-12-31T17:15:09Z","updated_at":"2016-01-04T09:18:44Z","closed_at":"2016-01-04T08:30:19Z","merged_at":"2016-01-04T08:30:19Z","merge_commit_sha":"c0b9e9e0856e573df871285cf4717b0f9d325beb","assignee":{"login":"soerenjalas","id":10922951,"avatar_url":"https://avatars.githubusercontent.com/u/10922951?v=3","gravatar_id":"","url":"https://api.github.com/users/soerenjalas","html_url":"https://github.com/soerenjalas","followers_url":"https://api.github.com/users/soerenjalas/followers","following_url":"https://api.github.com/users/soerenjalas/following{/other_user}","gists_url":"https://api.github.com/users/soerenjalas/gists{/gist_id}","starred_url":"https://api.github.com/users/soerenjalas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soerenjalas/subscriptions","organizations_url":"https://api.github.com/users/soerenjalas/orgs","repos_url":"https://api.github.com/users/soerenjalas/repos","events_url":"https://api.github.com/users/soerenjalas/events{/privacy}","received_events_url":"https://api.github.com/users/soerenjalas/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33/commits","review_comments_url":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33/comments","review_comment_url":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openPMD/openPMD-viewer/issues/33/comments","statuses_url":"https://api.github.com/repos/openPMD/openPMD-viewer/statuses/c32d3879c0cc16dc35ff4c22c9a5fdf68e5b84ff","head":{"label":"RemiLehe:fix-automated-tests","ref":"fix-automated-tests","sha":"c32d3879c0cc16dc35ff4c22c9a5fdf68e5b84ff","user":{"login":"RemiLehe","id":6685781,"avatar_url":"https://avatars.githubusercontent.com/u/6685781?v=3","gravatar_id":"","url":"https://api.github.com/users/RemiLehe","html_url":"https://github.com/RemiLehe","followers_url":"https://api.github.com/users/RemiLehe/followers","following_url":"https://api.github.com/users/RemiLehe/following{/other_user}","gists_url":"https://api.github.com/users/RemiLehe/gists{/gist_id}","starred_url":"https://api.github.com/users/RemiLehe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RemiLehe/subscriptions","organizations_url":"https://api.github.com/users/RemiLehe/orgs","repos_url":"https://api.github.com/users/RemiLehe/repos","events_url":"https://api.github.com/users/RemiLehe/events{/privacy}","received_events_url":"https://api.github.com/users/RemiLehe/received_events","type":"User","site_admin":false},"repo":{"id":43904662,"name":"openPMD-viewer","full_name":"RemiLehe/openPMD-viewer","owner":{"login":"RemiLehe","id":6685781,"avatar_url":"https://avatars.githubusercontent.com/u/6685781?v=3","gravatar_id":"","url":"https://api.github.com/users/RemiLehe","html_url":"https://github.com/RemiLehe","followers_url":"https://api.github.com/users/RemiLehe/followers","following_url":"https://api.github.com/users/RemiLehe/following{/other_user}","gists_url":"https://api.github.com/users/RemiLehe/gists{/gist_id}","starred_url":"https://api.github.com/users/RemiLehe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RemiLehe/subscriptions","organizations_url":"https://api.github.com/users/RemiLehe/orgs","repos_url":"https://api.github.com/users/RemiLehe/repos","events_url":"https://api.github.com/users/RemiLehe/events{/privacy}","received_events_url":"https://api.github.com/users/RemiLehe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/RemiLehe/openPMD-viewer","description":"Python visualization tools for openPMD files","fork":true,"url":"https://api.github.com/repos/RemiLehe/openPMD-viewer","forks_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/forks","keys_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/teams","hooks_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/hooks","issue_events_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/issues/events{/number}","events_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/events","assignees_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/assignees{/user}","branches_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/branches{/branch}","tags_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/tags","blobs_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/statuses/{sha}","languages_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/languages","stargazers_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/stargazers","contributors_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/contributors","subscribers_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/subscribers","subscription_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/subscription","commits_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/contents/{+path}","compare_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/merges","archive_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/downloads","issues_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/issues{/number}","pulls_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/pulls{/number}","milestones_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/milestones{/number}","notifications_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/labels{/name}","releases_url":"https://api.github.com/repos/RemiLehe/openPMD-viewer/releases{/id}","created_at":"2015-10-08T17:11:36Z","updated_at":"2015-12-11T21:34:12Z","pushed_at":"2015-12-31T17:31:11Z","git_url":"git://github.com/RemiLehe/openPMD-viewer.git","ssh_url":"git@github.com:RemiLehe/openPMD-viewer.git","clone_url":"https://github.com/RemiLehe/openPMD-viewer.git","svn_url":"https://github.com/RemiLehe/openPMD-viewer","homepage":null,"size":1024,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"openPMD:dev","ref":"dev","sha":"692f776d1baf19a143606e8d52be65173f330cab","user":{"login":"openPMD","id":13621712,"avatar_url":"https://avatars.githubusercontent.com/u/13621712?v=3","gravatar_id":"","url":"https://api.github.com/users/openPMD","html_url":"https://github.com/openPMD","followers_url":"https://api.github.com/users/openPMD/followers","following_url":"https://api.github.com/users/openPMD/following{/other_user}","gists_url":"https://api.github.com/users/openPMD/gists{/gist_id}","starred_url":"https://api.github.com/users/openPMD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openPMD/subscriptions","organizations_url":"https://api.github.com/users/openPMD/orgs","repos_url":"https://api.github.com/users/openPMD/repos","events_url":"https://api.github.com/users/openPMD/events{/privacy}","received_events_url":"https://api.github.com/users/openPMD/received_events","type":"Organization","site_admin":false},"repo":{"id":43901924,"name":"openPMD-viewer","full_name":"openPMD/openPMD-viewer","owner":{"login":"openPMD","id":13621712,"avatar_url":"https://avatars.githubusercontent.com/u/13621712?v=3","gravatar_id":"","url":"https://api.github.com/users/openPMD","html_url":"https://github.com/openPMD","followers_url":"https://api.github.com/users/openPMD/followers","following_url":"https://api.github.com/users/openPMD/following{/other_user}","gists_url":"https://api.github.com/users/openPMD/gists{/gist_id}","starred_url":"https://api.github.com/users/openPMD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openPMD/subscriptions","organizations_url":"https://api.github.com/users/openPMD/orgs","repos_url":"https://api.github.com/users/openPMD/repos","events_url":"https://api.github.com/users/openPMD/events{/privacy}","received_events_url":"https://api.github.com/users/openPMD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openPMD/openPMD-viewer","description":"Python visualization tools for openPMD files","fork":false,"url":"https://api.github.com/repos/openPMD/openPMD-viewer","forks_url":"https://api.github.com/repos/openPMD/openPMD-viewer/forks","keys_url":"https://api.github.com/repos/openPMD/openPMD-viewer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openPMD/openPMD-viewer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openPMD/openPMD-viewer/teams","hooks_url":"https://api.github.com/repos/openPMD/openPMD-viewer/hooks","issue_events_url":"https://api.github.com/repos/openPMD/openPMD-viewer/issues/events{/number}","events_url":"https://api.github.com/repos/openPMD/openPMD-viewer/events","assignees_url":"https://api.github.com/repos/openPMD/openPMD-viewer/assignees{/user}","branches_url":"https://api.github.com/repos/openPMD/openPMD-viewer/branches{/branch}","tags_url":"https://api.github.com/repos/openPMD/openPMD-viewer/tags","blobs_url":"https://api.github.com/repos/openPMD/openPMD-viewer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openPMD/openPMD-viewer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openPMD/openPMD-viewer/git/refs{/sha}","trees_url":"https://api.github.com/repos/openPMD/openPMD-viewer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openPMD/openPMD-viewer/statuses/{sha}","languages_url":"https://api.github.com/repos/openPMD/openPMD-viewer/languages","stargazers_url":"https://api.github.com/repos/openPMD/openPMD-viewer/stargazers","contributors_url":"https://api.github.com/repos/openPMD/openPMD-viewer/contributors","subscribers_url":"https://api.github.com/repos/openPMD/openPMD-viewer/subscribers","subscription_url":"https://api.github.com/repos/openPMD/openPMD-viewer/subscription","commits_url":"https://api.github.com/repos/openPMD/openPMD-viewer/commits{/sha}","git_commits_url":"https://api.github.com/repos/openPMD/openPMD-viewer/git/commits{/sha}","comments_url":"https://api.github.com/repos/openPMD/openPMD-viewer/comments{/number}","issue_comment_url":"https://api.github.com/repos/openPMD/openPMD-viewer/issues/comments{/number}","contents_url":"https://api.github.com/repos/openPMD/openPMD-viewer/contents/{+path}","compare_url":"https://api.github.com/repos/openPMD/openPMD-viewer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openPMD/openPMD-viewer/merges","archive_url":"https://api.github.com/repos/openPMD/openPMD-viewer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openPMD/openPMD-viewer/downloads","issues_url":"https://api.github.com/repos/openPMD/openPMD-viewer/issues{/number}","pulls_url":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls{/number}","milestones_url":"https://api.github.com/repos/openPMD/openPMD-viewer/milestones{/number}","notifications_url":"https://api.github.com/repos/openPMD/openPMD-viewer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openPMD/openPMD-viewer/labels{/name}","releases_url":"https://api.github.com/repos/openPMD/openPMD-viewer/releases{/id}","created_at":"2015-10-08T16:22:47Z","updated_at":"2015-11-09T22:26:43Z","pushed_at":"2016-01-04T09:16:27Z","git_url":"git://github.com/openPMD/openPMD-viewer.git","ssh_url":"git@github.com:openPMD/openPMD-viewer.git","clone_url":"https://github.com/openPMD/openPMD-viewer.git","svn_url":"https://github.com/openPMD/openPMD-viewer","homepage":null,"size":1025,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33"},"html":{"href":"https://github.com/openPMD/openPMD-viewer/pull/33"},"issue":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/issues/33"},"comments":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/openPMD/openPMD-viewer/statuses/c32d3879c0cc16dc35ff4c22c9a5fdf68e5b84ff"}}}}