{"action":"created","comment":{"url":"https://api.github.com/repos/hhru/frontik/pulls/comments/22930735","id":22930735,"diff_hunk":"@@ -1,8 +1,12 @@\n # coding=utf-8\n+import os.path\n+\n+PROJECT_ROOT = os.path.dirname(os.path.dirname(__file__))\n+TEMP_ROOT = os.path.join(PROJECT_ROOT, 'tests', 'temp')","path":"tests/__init__.py","position":5,"original_position":5,"commit_id":"50c77696a93b4036bdbac86fead1b8f6688b22f8","original_commit_id":"50c77696a93b4036bdbac86fead1b8f6688b22f8","user":{"login":"maizy","id":789623,"avatar_url":"https://avatars.githubusercontent.com/u/789623?v=3","gravatar_id":"","url":"https://api.github.com/users/maizy","html_url":"https://github.com/maizy","followers_url":"https://api.github.com/users/maizy/followers","following_url":"https://api.github.com/users/maizy/following{/other_user}","gists_url":"https://api.github.com/users/maizy/gists{/gist_id}","starred_url":"https://api.github.com/users/maizy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maizy/subscriptions","organizations_url":"https://api.github.com/users/maizy/orgs","repos_url":"https://api.github.com/users/maizy/repos","events_url":"https://api.github.com/users/maizy/events{/privacy}","received_events_url":"https://api.github.com/users/maizy/received_events","type":"User","site_admin":false},"body":"> тесты же из корня запускаются\r\n\r\nне всегда. я как раз так и потерял логи потом как запускал тесты в консоле и в другой pwd.","created_at":"2015-01-14T11:24:08Z","updated_at":"2015-01-14T11:24:08Z","html_url":"https://github.com/hhru/frontik/pull/177#discussion_r22930735","pull_request_url":"https://api.github.com/repos/hhru/frontik/pulls/177","_links":{"self":{"href":"https://api.github.com/repos/hhru/frontik/pulls/comments/22930735"},"html":{"href":"https://github.com/hhru/frontik/pull/177#discussion_r22930735"},"pull_request":{"href":"https://api.github.com/repos/hhru/frontik/pulls/177"}}},"pull_request":{"url":"https://api.github.com/repos/hhru/frontik/pulls/177","id":26675608,"html_url":"https://github.com/hhru/frontik/pull/177","diff_url":"https://github.com/hhru/frontik/pull/177.diff","patch_url":"https://github.com/hhru/frontik/pull/177.patch","issue_url":"https://api.github.com/repos/hhru/frontik/issues/177","number":177,"state":"open","locked":false,"title":"HH-48945 debugging auth by header","user":{"login":"maizy","id":789623,"avatar_url":"https://avatars.githubusercontent.com/u/789623?v=3","gravatar_id":"","url":"https://api.github.com/users/maizy","html_url":"https://github.com/maizy","followers_url":"https://api.github.com/users/maizy/followers","following_url":"https://api.github.com/users/maizy/following{/other_user}","gists_url":"https://api.github.com/users/maizy/gists{/gist_id}","starred_url":"https://api.github.com/users/maizy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maizy/subscriptions","organizations_url":"https://api.github.com/users/maizy/orgs","repos_url":"https://api.github.com/users/maizy/repos","events_url":"https://api.github.com/users/maizy/events{/privacy}","received_events_url":"https://api.github.com/users/maizy/received_events","type":"User","site_admin":false},"body":"Теперь отладка возможна отправкой заголовка `Frontik-Debug-Auth: login:pass`.\r\n\r\nТакже пофиксил:\r\n- при битом basic auth падала 500-ка (+ добавил тестов на это)\r\n\r\nТакже значительно пришлось поменять метод запуска test приложений:\r\n- учёт текущего python exec (поддержка venv и нестандартных python версий)\r\n- bind на `127.0.0.1`, вместо `localhost`. Иначе при наличии активированного в системе ipv6 стека, frontik стартует на `::1` при резолвинге `localhost`. Как победить это другим образом, например, резолвить форсированно ipv4 я не нашёл.\r\n- при запуске/остановки сервера логи и pid'ы сыпятся в спец папку /tests/temp (это очень помогло с отладкой проблем)\r\n\r\nВ тестах доработано:\r\n- теперь тесты будут работать в os x и в venv\r\n- использование в тестах абсолютных путей\r\n- отдельный TestCase тестирующий инфраструктуру тестирования, пригодится для отладки проблем на CI/CD системах\r\n\r\nВопросы на обсудить:\r\n- почему nopost не берётся из куки, нужно ли это пофиксить?\r\n- нужна ли настройка доступных методов авторизации? Мне кажется нет, почему описал в задаче HH-48945\r\n- запуск приложения для тестирования и bind `localhost`.\r\n- переименование пакета тестов на `frontik_tests`","created_at":"2014-12-30T07:05:42Z","updated_at":"2015-01-14T11:24:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8a1d1fb749570f3cb4a2735a233653847754d3bc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hhru/frontik/pulls/177/commits","review_comments_url":"https://api.github.com/repos/hhru/frontik/pulls/177/comments","review_comment_url":"https://api.github.com/repos/hhru/frontik/pulls/comments/{number}","comments_url":"https://api.github.com/repos/hhru/frontik/issues/177/comments","statuses_url":"https://api.github.com/repos/hhru/frontik/statuses/50c77696a93b4036bdbac86fead1b8f6688b22f8","head":{"label":"hhru:HH-48945","ref":"HH-48945","sha":"50c77696a93b4036bdbac86fead1b8f6688b22f8","user":{"login":"hhru","id":152753,"avatar_url":"https://avatars.githubusercontent.com/u/152753?v=3","gravatar_id":"","url":"https://api.github.com/users/hhru","html_url":"https://github.com/hhru","followers_url":"https://api.github.com/users/hhru/followers","following_url":"https://api.github.com/users/hhru/following{/other_user}","gists_url":"https://api.github.com/users/hhru/gists{/gist_id}","starred_url":"https://api.github.com/users/hhru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhru/subscriptions","organizations_url":"https://api.github.com/users/hhru/orgs","repos_url":"https://api.github.com/users/hhru/repos","events_url":"https://api.github.com/users/hhru/events{/privacy}","received_events_url":"https://api.github.com/users/hhru/received_events","type":"Organization","site_admin":false},"repo":{"id":825839,"name":"frontik","full_name":"hhru/frontik","owner":{"login":"hhru","id":152753,"avatar_url":"https://avatars.githubusercontent.com/u/152753?v=3","gravatar_id":"","url":"https://api.github.com/users/hhru","html_url":"https://github.com/hhru","followers_url":"https://api.github.com/users/hhru/followers","following_url":"https://api.github.com/users/hhru/following{/other_user}","gists_url":"https://api.github.com/users/hhru/gists{/gist_id}","starred_url":"https://api.github.com/users/hhru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhru/subscriptions","organizations_url":"https://api.github.com/users/hhru/orgs","repos_url":"https://api.github.com/users/hhru/repos","events_url":"https://api.github.com/users/hhru/events{/privacy}","received_events_url":"https://api.github.com/users/hhru/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hhru/frontik","description":"Maintainers: Сумин","fork":false,"url":"https://api.github.com/repos/hhru/frontik","forks_url":"https://api.github.com/repos/hhru/frontik/forks","keys_url":"https://api.github.com/repos/hhru/frontik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hhru/frontik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hhru/frontik/teams","hooks_url":"https://api.github.com/repos/hhru/frontik/hooks","issue_events_url":"https://api.github.com/repos/hhru/frontik/issues/events{/number}","events_url":"https://api.github.com/repos/hhru/frontik/events","assignees_url":"https://api.github.com/repos/hhru/frontik/assignees{/user}","branches_url":"https://api.github.com/repos/hhru/frontik/branches{/branch}","tags_url":"https://api.github.com/repos/hhru/frontik/tags","blobs_url":"https://api.github.com/repos/hhru/frontik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hhru/frontik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hhru/frontik/git/refs{/sha}","trees_url":"https://api.github.com/repos/hhru/frontik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hhru/frontik/statuses/{sha}","languages_url":"https://api.github.com/repos/hhru/frontik/languages","stargazers_url":"https://api.github.com/repos/hhru/frontik/stargazers","contributors_url":"https://api.github.com/repos/hhru/frontik/contributors","subscribers_url":"https://api.github.com/repos/hhru/frontik/subscribers","subscription_url":"https://api.github.com/repos/hhru/frontik/subscription","commits_url":"https://api.github.com/repos/hhru/frontik/commits{/sha}","git_commits_url":"https://api.github.com/repos/hhru/frontik/git/commits{/sha}","comments_url":"https://api.github.com/repos/hhru/frontik/comments{/number}","issue_comment_url":"https://api.github.com/repos/hhru/frontik/issues/comments/{number}","contents_url":"https://api.github.com/repos/hhru/frontik/contents/{+path}","compare_url":"https://api.github.com/repos/hhru/frontik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hhru/frontik/merges","archive_url":"https://api.github.com/repos/hhru/frontik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hhru/frontik/downloads","issues_url":"https://api.github.com/repos/hhru/frontik/issues{/number}","pulls_url":"https://api.github.com/repos/hhru/frontik/pulls{/number}","milestones_url":"https://api.github.com/repos/hhru/frontik/milestones{/number}","notifications_url":"https://api.github.com/repos/hhru/frontik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hhru/frontik/labels{/name}","releases_url":"https://api.github.com/repos/hhru/frontik/releases{/id}","created_at":"2010-08-09T05:13:13Z","updated_at":"2014-12-17T16:39:03Z","pushed_at":"2015-01-14T11:23:10Z","git_url":"git://github.com/hhru/frontik.git","ssh_url":"git@github.com:hhru/frontik.git","clone_url":"https://github.com/hhru/frontik.git","svn_url":"https://github.com/hhru/frontik","homepage":"","size":7736,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":27,"default_branch":"master"}},"base":{"label":"hhru:master","ref":"master","sha":"2afe3537f58c6bf750acc3720dad6169d5db85b0","user":{"login":"hhru","id":152753,"avatar_url":"https://avatars.githubusercontent.com/u/152753?v=3","gravatar_id":"","url":"https://api.github.com/users/hhru","html_url":"https://github.com/hhru","followers_url":"https://api.github.com/users/hhru/followers","following_url":"https://api.github.com/users/hhru/following{/other_user}","gists_url":"https://api.github.com/users/hhru/gists{/gist_id}","starred_url":"https://api.github.com/users/hhru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhru/subscriptions","organizations_url":"https://api.github.com/users/hhru/orgs","repos_url":"https://api.github.com/users/hhru/repos","events_url":"https://api.github.com/users/hhru/events{/privacy}","received_events_url":"https://api.github.com/users/hhru/received_events","type":"Organization","site_admin":false},"repo":{"id":825839,"name":"frontik","full_name":"hhru/frontik","owner":{"login":"hhru","id":152753,"avatar_url":"https://avatars.githubusercontent.com/u/152753?v=3","gravatar_id":"","url":"https://api.github.com/users/hhru","html_url":"https://github.com/hhru","followers_url":"https://api.github.com/users/hhru/followers","following_url":"https://api.github.com/users/hhru/following{/other_user}","gists_url":"https://api.github.com/users/hhru/gists{/gist_id}","starred_url":"https://api.github.com/users/hhru/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhru/subscriptions","organizations_url":"https://api.github.com/users/hhru/orgs","repos_url":"https://api.github.com/users/hhru/repos","events_url":"https://api.github.com/users/hhru/events{/privacy}","received_events_url":"https://api.github.com/users/hhru/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hhru/frontik","description":"Maintainers: Сумин","fork":false,"url":"https://api.github.com/repos/hhru/frontik","forks_url":"https://api.github.com/repos/hhru/frontik/forks","keys_url":"https://api.github.com/repos/hhru/frontik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hhru/frontik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hhru/frontik/teams","hooks_url":"https://api.github.com/repos/hhru/frontik/hooks","issue_events_url":"https://api.github.com/repos/hhru/frontik/issues/events{/number}","events_url":"https://api.github.com/repos/hhru/frontik/events","assignees_url":"https://api.github.com/repos/hhru/frontik/assignees{/user}","branches_url":"https://api.github.com/repos/hhru/frontik/branches{/branch}","tags_url":"https://api.github.com/repos/hhru/frontik/tags","blobs_url":"https://api.github.com/repos/hhru/frontik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hhru/frontik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hhru/frontik/git/refs{/sha}","trees_url":"https://api.github.com/repos/hhru/frontik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hhru/frontik/statuses/{sha}","languages_url":"https://api.github.com/repos/hhru/frontik/languages","stargazers_url":"https://api.github.com/repos/hhru/frontik/stargazers","contributors_url":"https://api.github.com/repos/hhru/frontik/contributors","subscribers_url":"https://api.github.com/repos/hhru/frontik/subscribers","subscription_url":"https://api.github.com/repos/hhru/frontik/subscription","commits_url":"https://api.github.com/repos/hhru/frontik/commits{/sha}","git_commits_url":"https://api.github.com/repos/hhru/frontik/git/commits{/sha}","comments_url":"https://api.github.com/repos/hhru/frontik/comments{/number}","issue_comment_url":"https://api.github.com/repos/hhru/frontik/issues/comments/{number}","contents_url":"https://api.github.com/repos/hhru/frontik/contents/{+path}","compare_url":"https://api.github.com/repos/hhru/frontik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hhru/frontik/merges","archive_url":"https://api.github.com/repos/hhru/frontik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hhru/frontik/downloads","issues_url":"https://api.github.com/repos/hhru/frontik/issues{/number}","pulls_url":"https://api.github.com/repos/hhru/frontik/pulls{/number}","milestones_url":"https://api.github.com/repos/hhru/frontik/milestones{/number}","notifications_url":"https://api.github.com/repos/hhru/frontik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hhru/frontik/labels{/name}","releases_url":"https://api.github.com/repos/hhru/frontik/releases{/id}","created_at":"2010-08-09T05:13:13Z","updated_at":"2014-12-17T16:39:03Z","pushed_at":"2015-01-14T11:23:10Z","git_url":"git://github.com/hhru/frontik.git","ssh_url":"git@github.com:hhru/frontik.git","clone_url":"https://github.com/hhru/frontik.git","svn_url":"https://github.com/hhru/frontik","homepage":"","size":7736,"stargazers_count":27,"watchers_count":27,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":5,"forks":6,"open_issues":5,"watchers":27,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hhru/frontik/pulls/177"},"html":{"href":"https://github.com/hhru/frontik/pull/177"},"issue":{"href":"https://api.github.com/repos/hhru/frontik/issues/177"},"comments":{"href":"https://api.github.com/repos/hhru/frontik/issues/177/comments"},"review_comments":{"href":"https://api.github.com/repos/hhru/frontik/pulls/177/comments"},"review_comment":{"href":"https://api.github.com/repos/hhru/frontik/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/hhru/frontik/pulls/177/commits"},"statuses":{"href":"https://api.github.com/repos/hhru/frontik/statuses/50c77696a93b4036bdbac86fead1b8f6688b22f8"}}}}