{"action":"created","comment":{"url":"https://api.github.com/repos/mapsme/omim/pulls/comments/67310668","id":67310668,"diff_hunk":"@@ -2,136 +2,130 @@\n \n import logging\n import multiprocessing\n+from multiprocessing import Pool\n from optparse import OptionParser\n from os import path\n-from Queue import Queue\n-from random import shuffle\n import shutil\n import subprocess\n import tempfile\n-from threading import Lock\n-from threading import Thread\n from time import time\n-import traceback\n-\n \n from run_desktop_tests import tests_on_disk\n \n __author__ = 't.danshin'\n \n \n+MAIN_LOGGER_NAME = \"main_logger\"\n+START_FINISH_LOGGER_NAME = \"start_finnish_logger\"\n TEMPFOLDER_TESTS = [\"search_integration_tests\", \"storage_integration_tests\"]\n \n \n-class IntegrationRunner:\n-    def __init__(self):\n-        self.process_cli()\n+def setup_logger(logger_name, log_file, level=logging.INFO):\n+    l = logging.getLogger(logger_name)\n+    formatter = logging.Formatter('%(msg)s')\n+    file_handler = logging.FileHandler(log_file, mode='w')\n+    file_handler.setFormatter(formatter)\n+    stream_handler = logging.StreamHandler()\n+    stream_handler.setFormatter(formatter)\n \n-        self.proc_count = multiprocessing.cpu_count()\n-        logging.info(\"Number of processors is: {nproc}\".format(nproc=self.proc_count))\n+    l.setLevel(level)\n+    l.addHandler(file_handler)\n+    l.addHandler(stream_handler)\n \n-        self.file_lock = Lock()\n-        self.start_finish_lock = Lock()\n-        self.tests = Queue()\n-        self.key_postfix = \"\"\n-        if self.user_resource_path:\n-            self.key_postfix += ' --user_resource_path=\"{0}\"'.format(self.user_resource_path)\n-        if self.data_path:\n-            self.key_postfix += ' --data_path=\"{0}\"'.format(self.data_path)\n \n+def execute_file(test, keys):\n+    spell = [\"{test} {keys}\".format(test=test, keys=keys)]\n+    logging.debug(\">> {spell}\".format(spell=spell))\n \n-    def run_tests(self):\n-        intermediate_tests = []\n-        for exec_file in self.runlist:\n-            intermediate_tests.extend(map(lambda x: (exec_file, x), self.get_tests_from_exec_file(exec_file, \"--list_tests\")[0]))\n+    process = subprocess.Popen(spell,\n+                               stdout=subprocess.PIPE,\n+                               stderr=subprocess.PIPE,\n+                               shell=True\n+                               )\n \n-        shuffle(intermediate_tests)\n-        for test in intermediate_tests:\n-            self.tests.put(test)\n+    out, err = process.communicate()\n+    result = process.returncode\n \n-        with open(self.output, \"w\") as self.file, open(\"start-finish.log\", \"w\") as self.start_finish_log:\n-            self.run_parallel_tests()\n+    return filter(None, out.split(\"\\n\")), err, result\n \n \n-    def run_parallel_tests(self):\n-        threads = []\n+def exec_test(a_tuple):","path":"tools/integration_tests_runner.py","position":81,"original_position":81,"commit_id":"403f4e992cc2f19cc5406f315fcf267efb56ede4","original_commit_id":"403f4e992cc2f19cc5406f315fcf267efb56ede4","user":{"login":"ygorshenin","id":454567,"avatar_url":"https://avatars.githubusercontent.com/u/454567?v=3","gravatar_id":"","url":"https://api.github.com/users/ygorshenin","html_url":"https://github.com/ygorshenin","followers_url":"https://api.github.com/users/ygorshenin/followers","following_url":"https://api.github.com/users/ygorshenin/following{/other_user}","gists_url":"https://api.github.com/users/ygorshenin/gists{/gist_id}","starred_url":"https://api.github.com/users/ygorshenin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ygorshenin/subscriptions","organizations_url":"https://api.github.com/users/ygorshenin/orgs","repos_url":"https://api.github.com/users/ygorshenin/repos","events_url":"https://api.github.com/users/ygorshenin/events{/privacy}","received_events_url":"https://api.github.com/users/ygorshenin/received_events","type":"User","site_admin":false},"body":"Comment to the function, please?","created_at":"2016-06-16T09:04:10Z","updated_at":"2016-06-16T09:04:10Z","html_url":"https://github.com/mapsme/omim/pull/3575#discussion_r67310668","pull_request_url":"https://api.github.com/repos/mapsme/omim/pulls/3575","_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments/67310668"},"html":{"href":"https://github.com/mapsme/omim/pull/3575#discussion_r67310668"},"pull_request":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3575"}}},"pull_request":{"url":"https://api.github.com/repos/mapsme/omim/pulls/3575","id":73926234,"html_url":"https://github.com/mapsme/omim/pull/3575","diff_url":"https://github.com/mapsme/omim/pull/3575.diff","patch_url":"https://github.com/mapsme/omim/pull/3575.patch","issue_url":"https://api.github.com/repos/mapsme/omim/issues/3575","number":3575,"state":"open","locked":false,"title":"Td new python integration","user":{"login":"therearesomewhocallmetim","id":14867234,"avatar_url":"https://avatars.githubusercontent.com/u/14867234?v=3","gravatar_id":"","url":"https://api.github.com/users/therearesomewhocallmetim","html_url":"https://github.com/therearesomewhocallmetim","followers_url":"https://api.github.com/users/therearesomewhocallmetim/followers","following_url":"https://api.github.com/users/therearesomewhocallmetim/following{/other_user}","gists_url":"https://api.github.com/users/therearesomewhocallmetim/gists{/gist_id}","starred_url":"https://api.github.com/users/therearesomewhocallmetim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therearesomewhocallmetim/subscriptions","organizations_url":"https://api.github.com/users/therearesomewhocallmetim/orgs","repos_url":"https://api.github.com/users/therearesomewhocallmetim/repos","events_url":"https://api.github.com/users/therearesomewhocallmetim/events{/privacy}","received_events_url":"https://api.github.com/users/therearesomewhocallmetim/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-15T14:53:20Z","updated_at":"2016-06-16T09:04:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7eee939d156716ec6469853ab9a10876df809ab3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapsme/omim/pulls/3575/commits","review_comments_url":"https://api.github.com/repos/mapsme/omim/pulls/3575/comments","review_comment_url":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapsme/omim/issues/3575/comments","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/403f4e992cc2f19cc5406f315fcf267efb56ede4","head":{"label":"therearesomewhocallmetim:td_new_python_integration","ref":"td_new_python_integration","sha":"403f4e992cc2f19cc5406f315fcf267efb56ede4","user":{"login":"therearesomewhocallmetim","id":14867234,"avatar_url":"https://avatars.githubusercontent.com/u/14867234?v=3","gravatar_id":"","url":"https://api.github.com/users/therearesomewhocallmetim","html_url":"https://github.com/therearesomewhocallmetim","followers_url":"https://api.github.com/users/therearesomewhocallmetim/followers","following_url":"https://api.github.com/users/therearesomewhocallmetim/following{/other_user}","gists_url":"https://api.github.com/users/therearesomewhocallmetim/gists{/gist_id}","starred_url":"https://api.github.com/users/therearesomewhocallmetim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therearesomewhocallmetim/subscriptions","organizations_url":"https://api.github.com/users/therearesomewhocallmetim/orgs","repos_url":"https://api.github.com/users/therearesomewhocallmetim/repos","events_url":"https://api.github.com/users/therearesomewhocallmetim/events{/privacy}","received_events_url":"https://api.github.com/users/therearesomewhocallmetim/received_events","type":"User","site_admin":false},"repo":{"id":43429309,"name":"omim","full_name":"therearesomewhocallmetim/omim","owner":{"login":"therearesomewhocallmetim","id":14867234,"avatar_url":"https://avatars.githubusercontent.com/u/14867234?v=3","gravatar_id":"","url":"https://api.github.com/users/therearesomewhocallmetim","html_url":"https://github.com/therearesomewhocallmetim","followers_url":"https://api.github.com/users/therearesomewhocallmetim/followers","following_url":"https://api.github.com/users/therearesomewhocallmetim/following{/other_user}","gists_url":"https://api.github.com/users/therearesomewhocallmetim/gists{/gist_id}","starred_url":"https://api.github.com/users/therearesomewhocallmetim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/therearesomewhocallmetim/subscriptions","organizations_url":"https://api.github.com/users/therearesomewhocallmetim/orgs","repos_url":"https://api.github.com/users/therearesomewhocallmetim/repos","events_url":"https://api.github.com/users/therearesomewhocallmetim/events{/privacy}","received_events_url":"https://api.github.com/users/therearesomewhocallmetim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/therearesomewhocallmetim/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":true,"url":"https://api.github.com/repos/therearesomewhocallmetim/omim","forks_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/forks","keys_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/teams","hooks_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/hooks","issue_events_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/issues/events{/number}","events_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/events","assignees_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/assignees{/user}","branches_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/branches{/branch}","tags_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/tags","blobs_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/languages","stargazers_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/stargazers","contributors_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/contributors","subscribers_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/subscribers","subscription_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/subscription","commits_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/contents/{+path}","compare_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/merges","archive_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/downloads","issues_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/issues{/number}","pulls_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/labels{/name}","releases_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/releases{/id}","deployments_url":"https://api.github.com/repos/therearesomewhocallmetim/omim/deployments","created_at":"2015-09-30T11:33:11Z","updated_at":"2015-09-30T11:35:20Z","pushed_at":"2016-06-15T16:16:59Z","git_url":"git://github.com/therearesomewhocallmetim/omim.git","ssh_url":"git@github.com:therearesomewhocallmetim/omim.git","clone_url":"https://github.com/therearesomewhocallmetim/omim.git","svn_url":"https://github.com/therearesomewhocallmetim/omim","homepage":null,"size":2463936,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mapsme:release-62","ref":"release-62","sha":"b3a3bd1daba01be285341384ec662247775eeb9c","user":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"repo":{"id":42798033,"name":"omim","full_name":"mapsme/omim","owner":{"login":"mapsme","id":14185141,"avatar_url":"https://avatars.githubusercontent.com/u/14185141?v=3","gravatar_id":"","url":"https://api.github.com/users/mapsme","html_url":"https://github.com/mapsme","followers_url":"https://api.github.com/users/mapsme/followers","following_url":"https://api.github.com/users/mapsme/following{/other_user}","gists_url":"https://api.github.com/users/mapsme/gists{/gist_id}","starred_url":"https://api.github.com/users/mapsme/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapsme/subscriptions","organizations_url":"https://api.github.com/users/mapsme/orgs","repos_url":"https://api.github.com/users/mapsme/repos","events_url":"https://api.github.com/users/mapsme/events{/privacy}","received_events_url":"https://api.github.com/users/mapsme/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapsme/omim","description":"MAPS.ME - Offline OpenStreetMap maps for iOS/Android/Mac/Linux/Windows","fork":false,"url":"https://api.github.com/repos/mapsme/omim","forks_url":"https://api.github.com/repos/mapsme/omim/forks","keys_url":"https://api.github.com/repos/mapsme/omim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapsme/omim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapsme/omim/teams","hooks_url":"https://api.github.com/repos/mapsme/omim/hooks","issue_events_url":"https://api.github.com/repos/mapsme/omim/issues/events{/number}","events_url":"https://api.github.com/repos/mapsme/omim/events","assignees_url":"https://api.github.com/repos/mapsme/omim/assignees{/user}","branches_url":"https://api.github.com/repos/mapsme/omim/branches{/branch}","tags_url":"https://api.github.com/repos/mapsme/omim/tags","blobs_url":"https://api.github.com/repos/mapsme/omim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapsme/omim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapsme/omim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapsme/omim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapsme/omim/statuses/{sha}","languages_url":"https://api.github.com/repos/mapsme/omim/languages","stargazers_url":"https://api.github.com/repos/mapsme/omim/stargazers","contributors_url":"https://api.github.com/repos/mapsme/omim/contributors","subscribers_url":"https://api.github.com/repos/mapsme/omim/subscribers","subscription_url":"https://api.github.com/repos/mapsme/omim/subscription","commits_url":"https://api.github.com/repos/mapsme/omim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapsme/omim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapsme/omim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapsme/omim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapsme/omim/contents/{+path}","compare_url":"https://api.github.com/repos/mapsme/omim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapsme/omim/merges","archive_url":"https://api.github.com/repos/mapsme/omim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapsme/omim/downloads","issues_url":"https://api.github.com/repos/mapsme/omim/issues{/number}","pulls_url":"https://api.github.com/repos/mapsme/omim/pulls{/number}","milestones_url":"https://api.github.com/repos/mapsme/omim/milestones{/number}","notifications_url":"https://api.github.com/repos/mapsme/omim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapsme/omim/labels{/name}","releases_url":"https://api.github.com/repos/mapsme/omim/releases{/id}","deployments_url":"https://api.github.com/repos/mapsme/omim/deployments","created_at":"2015-09-20T02:57:13Z","updated_at":"2016-06-15T22:01:39Z","pushed_at":"2016-06-16T08:57:54Z","git_url":"git://github.com/mapsme/omim.git","ssh_url":"git@github.com:mapsme/omim.git","clone_url":"https://github.com/mapsme/omim.git","svn_url":"https://github.com/mapsme/omim","homepage":null,"size":2580081,"stargazers_count":1811,"watchers_count":1811,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":291,"mirror_url":null,"open_issues_count":214,"forks":291,"open_issues":214,"watchers":1811,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3575"},"html":{"href":"https://github.com/mapsme/omim/pull/3575"},"issue":{"href":"https://api.github.com/repos/mapsme/omim/issues/3575"},"comments":{"href":"https://api.github.com/repos/mapsme/omim/issues/3575/comments"},"review_comments":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3575/comments"},"review_comment":{"href":"https://api.github.com/repos/mapsme/omim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapsme/omim/pulls/3575/commits"},"statuses":{"href":"https://api.github.com/repos/mapsme/omim/statuses/403f4e992cc2f19cc5406f315fcf267efb56ede4"}}}}
{"actor":{"display_login":"ygorshenin"}}