{"action":"created","comment":{"url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/comments/198721574","pull_request_review_id":132702066,"id":198721574,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODcyMTU3NA==","diff_hunk":"@@ -0,0 +1,76 @@\n+#!/bin/bash -e\n+# End to end test script\n+\n+# Settings\n+S3_ENDPOINT_URL=\"http://localhost:10080\"\n+\n+# handle exit and clean up containers\n+#   ref. https://fumiyas.github.io/2013/12/06/tempfile.sh-advent-calendar.html\n+handle_exit() {\n+  docker-compose down -v\n+}\n+trap handle_exit EXIT\n+trap 'rc=$?; trap - EXIT; handle_exit; exit $?' INT PIPE TERM\n+\n+# assert file exist on s3\n+#   ARGS\n+#     $1 ... ENDPOINT_URL: Endpoint URL of S3\n+#     $2 ... S3_FILE_PATH: File path of S3 to be checked for existence\n+assert_file_exists_on_s3() {\n+  if [ $# -ne 2 ]; then return 100; fi\n+\n+  ENDPOINT_URL=$1\n+  S3_FILE_PATH=$2\n+  HTTP_OK=$(curl -I -L --silent \"${ENDPOINT_URL}/${S3_FILE_PATH}\" 2>&1 | grep -e '^HTTP/.\\+200 OK')\n+  if [ \"x${HTTP_OK}\" = \"x\" ]; then echo 'assert_file_exists_on_s3 FAILED'; exit 1; fi\n+}\n+\n+# assert restore is successful\n+assert_dummy_record_exists_on_mongodb () {\n+  docker-compose exec mongo bash -c 'echo -e \"use dummy;\\n db.dummy.find({name: \\\"test\\\"})\\n\" | mongo | grep -q \"ObjectId\"'\n+  if [ $? -ne 0 ]; then echo 'assert_restore_dummy_record FAILED'; exit 1; fi\n+}\n+\n+# Start test script\n+CWD=$(dirname $0)\n+cd $CWD\n+\n+TODAY=`/bin/date +%Y%m%d` # It is used to generate file name to restore\n+\n+# Clean up before start s3proxy and mongodb\n+docker-compose down -v\n+\n+# Start s3proxy and mongodb\n+docker-compose up --build s3proxy mongo &\n+sleep 3 # wait for that network of docker-compose is ready\n+docker-compose up --build init\n+\n+# Execute app_default\n+docker-compose up --build app_default\n+# Expect for app_default\n+assert_file_exists_on_s3 ${S3_ENDPOINT_URL} \"app_default/backup-${TODAY}.tar.bz2\"\n+# Exit test for app_default\n+echo 'Finished test for app_default: OK'\n+\n+# Expect for app_restore\n+docker-compose up --build app_restore\n+# Expect for app_restore\n+assert_dummy_record_exists_on_mongodb\n+# Exit test for app_restore\n+echo 'Finished test for app_restore: OK'\n+\n+# Expect for app_backup_cronmode\n+docker-compose up --build app_backup_cronmode &\n+sleep 3 # wait for that network of docker-compose is ready\n+## stop container\n+##   before stop, sleep 65s because test backup is executed every minute in cron mode\n+docker-compose stop -t 65 app_backup_cronmode","path":"test/e2e.sh","position":67,"original_position":67,"commit_id":"8496ddfec2e4697e43fef1b90c93fa32d03fb643","original_commit_id":"8496ddfec2e4697e43fef1b90c93fa32d03fb643","user":{"login":"skomma","id":4454401,"node_id":"MDQ6VXNlcjQ0NTQ0MDE=","avatar_url":"https://avatars1.githubusercontent.com/u/4454401?v=4","gravatar_id":"","url":"https://api.github.com/users/skomma","html_url":"https://github.com/skomma","followers_url":"https://api.github.com/users/skomma/followers","following_url":"https://api.github.com/users/skomma/following{/other_user}","gists_url":"https://api.github.com/users/skomma/gists{/gist_id}","starred_url":"https://api.github.com/users/skomma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skomma/subscriptions","organizations_url":"https://api.github.com/users/skomma/orgs","repos_url":"https://api.github.com/users/skomma/repos","events_url":"https://api.github.com/users/skomma/events{/privacy}","received_events_url":"https://api.github.com/users/skomma/received_events","type":"User","site_admin":false},"body":"ん～ここの `-t` は↑の sleep と一緒にしちゃっていいんじゃない？","created_at":"2018-06-28T06:37:38Z","updated_at":"2018-06-28T06:38:01Z","html_url":"https://github.com/weseek/mongodb-awesome-backup/pull/6#discussion_r198721574","pull_request_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/comments/198721574"},"html":{"href":"https://github.com/weseek/mongodb-awesome-backup/pull/6#discussion_r198721574"},"pull_request":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6","id":193857851,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkzODU3ODUx","html_url":"https://github.com/weseek/mongodb-awesome-backup/pull/6","diff_url":"https://github.com/weseek/mongodb-awesome-backup/pull/6.diff","patch_url":"https://github.com/weseek/mongodb-awesome-backup/pull/6.patch","issue_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/6","number":6,"state":"open","locked":false,"title":"support/e2e-test","user":{"login":"ryu-sato","id":32702772,"node_id":"MDQ6VXNlcjMyNzAyNzcy","avatar_url":"https://avatars3.githubusercontent.com/u/32702772?v=4","gravatar_id":"","url":"https://api.github.com/users/ryu-sato","html_url":"https://github.com/ryu-sato","followers_url":"https://api.github.com/users/ryu-sato/followers","following_url":"https://api.github.com/users/ryu-sato/following{/other_user}","gists_url":"https://api.github.com/users/ryu-sato/gists{/gist_id}","starred_url":"https://api.github.com/users/ryu-sato/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryu-sato/subscriptions","organizations_url":"https://api.github.com/users/ryu-sato/orgs","repos_url":"https://api.github.com/users/ryu-sato/repos","events_url":"https://api.github.com/users/ryu-sato/events{/privacy}","received_events_url":"https://api.github.com/users/ryu-sato/received_events","type":"User","site_admin":false},"body":"Reivew & merge task\r\n* https://weseek.myjetbrains.com/youtrack/issue/INFRA-274\r\n\r\ndocker-compose を使った e2e テストを追加","created_at":"2018-06-11T01:34:13Z","updated_at":"2018-06-28T06:38:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cd5db4d67502a8bb92035c12fc70773caf99380e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6/commits","review_comments_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6/comments","review_comment_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/6/comments","statuses_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/statuses/8496ddfec2e4697e43fef1b90c93fa32d03fb643","head":{"label":"weseek:support/e2e-test","ref":"support/e2e-test","sha":"8496ddfec2e4697e43fef1b90c93fa32d03fb643","user":{"login":"weseek","id":6468105,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjgxMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/6468105?v=4","gravatar_id":"","url":"https://api.github.com/users/weseek","html_url":"https://github.com/weseek","followers_url":"https://api.github.com/users/weseek/followers","following_url":"https://api.github.com/users/weseek/following{/other_user}","gists_url":"https://api.github.com/users/weseek/gists{/gist_id}","starred_url":"https://api.github.com/users/weseek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weseek/subscriptions","organizations_url":"https://api.github.com/users/weseek/orgs","repos_url":"https://api.github.com/users/weseek/repos","events_url":"https://api.github.com/users/weseek/events{/privacy}","received_events_url":"https://api.github.com/users/weseek/received_events","type":"Organization","site_admin":false},"repo":{"id":114969039,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ5NjkwMzk=","name":"mongodb-awesome-backup","full_name":"weseek/mongodb-awesome-backup","owner":{"login":"weseek","id":6468105,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjgxMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/6468105?v=4","gravatar_id":"","url":"https://api.github.com/users/weseek","html_url":"https://github.com/weseek","followers_url":"https://api.github.com/users/weseek/followers","following_url":"https://api.github.com/users/weseek/following{/other_user}","gists_url":"https://api.github.com/users/weseek/gists{/gist_id}","starred_url":"https://api.github.com/users/weseek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weseek/subscriptions","organizations_url":"https://api.github.com/users/weseek/orgs","repos_url":"https://api.github.com/users/weseek/repos","events_url":"https://api.github.com/users/weseek/events{/privacy}","received_events_url":"https://api.github.com/users/weseek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weseek/mongodb-awesome-backup","description":"Backup scripts of MongoDB Databases to Amazon S3","fork":false,"url":"https://api.github.com/repos/weseek/mongodb-awesome-backup","forks_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/forks","keys_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/teams","hooks_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/hooks","issue_events_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/events{/number}","events_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/events","assignees_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/assignees{/user}","branches_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/branches{/branch}","tags_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/tags","blobs_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/refs{/sha}","trees_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/statuses/{sha}","languages_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/languages","stargazers_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/stargazers","contributors_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/contributors","subscribers_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/subscribers","subscription_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/subscription","commits_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/commits{/sha}","git_commits_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/commits{/sha}","comments_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/comments{/number}","issue_comment_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/comments{/number}","contents_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/contents/{+path}","compare_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/merges","archive_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/downloads","issues_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues{/number}","pulls_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls{/number}","milestones_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/milestones{/number}","notifications_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/labels{/name}","releases_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/releases{/id}","deployments_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/deployments","created_at":"2017-12-21T06:05:49Z","updated_at":"2018-06-18T08:56:04Z","pushed_at":"2018-06-27T21:12:15Z","git_url":"git://github.com/weseek/mongodb-awesome-backup.git","ssh_url":"git@github.com:weseek/mongodb-awesome-backup.git","clone_url":"https://github.com/weseek/mongodb-awesome-backup.git","svn_url":"https://github.com/weseek/mongodb-awesome-backup","homepage":null,"size":68,"stargazers_count":4,"watchers_count":4,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"base":{"label":"weseek:master","ref":"master","sha":"9390e4360d00e6e6cc797d48b8888685bdddd42c","user":{"login":"weseek","id":6468105,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjgxMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/6468105?v=4","gravatar_id":"","url":"https://api.github.com/users/weseek","html_url":"https://github.com/weseek","followers_url":"https://api.github.com/users/weseek/followers","following_url":"https://api.github.com/users/weseek/following{/other_user}","gists_url":"https://api.github.com/users/weseek/gists{/gist_id}","starred_url":"https://api.github.com/users/weseek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weseek/subscriptions","organizations_url":"https://api.github.com/users/weseek/orgs","repos_url":"https://api.github.com/users/weseek/repos","events_url":"https://api.github.com/users/weseek/events{/privacy}","received_events_url":"https://api.github.com/users/weseek/received_events","type":"Organization","site_admin":false},"repo":{"id":114969039,"node_id":"MDEwOlJlcG9zaXRvcnkxMTQ5NjkwMzk=","name":"mongodb-awesome-backup","full_name":"weseek/mongodb-awesome-backup","owner":{"login":"weseek","id":6468105,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY0NjgxMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/6468105?v=4","gravatar_id":"","url":"https://api.github.com/users/weseek","html_url":"https://github.com/weseek","followers_url":"https://api.github.com/users/weseek/followers","following_url":"https://api.github.com/users/weseek/following{/other_user}","gists_url":"https://api.github.com/users/weseek/gists{/gist_id}","starred_url":"https://api.github.com/users/weseek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weseek/subscriptions","organizations_url":"https://api.github.com/users/weseek/orgs","repos_url":"https://api.github.com/users/weseek/repos","events_url":"https://api.github.com/users/weseek/events{/privacy}","received_events_url":"https://api.github.com/users/weseek/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/weseek/mongodb-awesome-backup","description":"Backup scripts of MongoDB Databases to Amazon S3","fork":false,"url":"https://api.github.com/repos/weseek/mongodb-awesome-backup","forks_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/forks","keys_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/teams","hooks_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/hooks","issue_events_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/events{/number}","events_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/events","assignees_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/assignees{/user}","branches_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/branches{/branch}","tags_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/tags","blobs_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/refs{/sha}","trees_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/statuses/{sha}","languages_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/languages","stargazers_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/stargazers","contributors_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/contributors","subscribers_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/subscribers","subscription_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/subscription","commits_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/commits{/sha}","git_commits_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/git/commits{/sha}","comments_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/comments{/number}","issue_comment_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/comments{/number}","contents_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/contents/{+path}","compare_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/merges","archive_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/downloads","issues_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues{/number}","pulls_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls{/number}","milestones_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/milestones{/number}","notifications_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/labels{/name}","releases_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/releases{/id}","deployments_url":"https://api.github.com/repos/weseek/mongodb-awesome-backup/deployments","created_at":"2017-12-21T06:05:49Z","updated_at":"2018-06-18T08:56:04Z","pushed_at":"2018-06-27T21:12:15Z","git_url":"git://github.com/weseek/mongodb-awesome-backup.git","ssh_url":"git@github.com:weseek/mongodb-awesome-backup.git","clone_url":"https://github.com/weseek/mongodb-awesome-backup.git","svn_url":"https://github.com/weseek/mongodb-awesome-backup","homepage":null,"size":68,"stargazers_count":4,"watchers_count":4,"language":"Shell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":2,"open_issues":1,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6"},"html":{"href":"https://github.com/weseek/mongodb-awesome-backup/pull/6"},"issue":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/6"},"comments":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/weseek/mongodb-awesome-backup/statuses/8496ddfec2e4697e43fef1b90c93fa32d03fb643"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"skomma"}}