{"action":"created","comment":{"url":"https://api.github.com/repos/ARMmbed/htrun/pulls/comments/66218260","id":66218260,"diff_hunk":"@@ -74,7 +74,39 @@ def __init__(self, options):\n \n         DefaultTestSelectorBase.__init__(self, options)\n \n+    def is_host_test_obj_compatible(self, obj_instance):\n+        \"\"\"! Check if host test object loaded is actually host test class\n+             derived from 'mbed_host_tests.BaseHostTest()'\n+             Additionaly if host test class implements custom ctor it should\n+             call BaseHostTest().__Init__()\n+        @param obj_instance Instance of host test derived class\n+        @return True if obj_instance is derived from mbed_host_tests.BaseHostTest()\n+                and BaseHostTest.__init__() was called, else return False\n+        \"\"\"\n+        result = False\n+        if obj_instance:\n+            result = True\n+            self.logger.prn_inf(\"host test class: '%s'\"% obj_instance.__class__)\n+\n+            # Check if host test (obj_instance) is derived from mbed_host_tests.BaseHostTest()\n+            if not isinstance(obj_instance, BaseHostTest):\n+                # In theory we should always get host test objects inheriting from BaseHostTest()\n+                # because loader will only load those.\n+                self.logger.prn_err(\"host test must inherit from mbed_host_tests.BaseHostTest() class\")","path":"mbed_host_tests/host_tests_runner/host_test_default.py","position":38,"original_position":38,"commit_id":"86d9df199f23cc7ed91008ac2597080b850ad245","original_commit_id":"86d9df199f23cc7ed91008ac2597080b850ad245","user":{"login":"bridadan","id":3123977,"avatar_url":"https://avatars.githubusercontent.com/u/3123977?v=3","gravatar_id":"","url":"https://api.github.com/users/bridadan","html_url":"https://github.com/bridadan","followers_url":"https://api.github.com/users/bridadan/followers","following_url":"https://api.github.com/users/bridadan/following{/other_user}","gists_url":"https://api.github.com/users/bridadan/gists{/gist_id}","starred_url":"https://api.github.com/users/bridadan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bridadan/subscriptions","organizations_url":"https://api.github.com/users/bridadan/orgs","repos_url":"https://api.github.com/users/bridadan/repos","events_url":"https://api.github.com/users/bridadan/events{/privacy}","received_events_url":"https://api.github.com/users/bridadan/received_events","type":"User","site_admin":false},"body":"Oops missed that, my bad!","created_at":"2016-06-08T09:03:24Z","updated_at":"2016-06-08T09:03:24Z","html_url":"https://github.com/ARMmbed/htrun/pull/83#discussion_r66218260","pull_request_url":"https://api.github.com/repos/ARMmbed/htrun/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/htrun/pulls/comments/66218260"},"html":{"href":"https://github.com/ARMmbed/htrun/pull/83#discussion_r66218260"},"pull_request":{"href":"https://api.github.com/repos/ARMmbed/htrun/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/ARMmbed/htrun/pulls/83","id":66858101,"html_url":"https://github.com/ARMmbed/htrun/pull/83","diff_url":"https://github.com/ARMmbed/htrun/pull/83.diff","patch_url":"https://github.com/ARMmbed/htrun/pull/83.patch","issue_url":"https://api.github.com/repos/ARMmbed/htrun/issues/83","number":83,"state":"closed","locked":false,"title":"Add warning regarding missing BaseHostTest ctor call in custom host test","user":{"login":"PrzemekWirkus","id":6360720,"avatar_url":"https://avatars.githubusercontent.com/u/6360720?v=3","gravatar_id":"","url":"https://api.github.com/users/PrzemekWirkus","html_url":"https://github.com/PrzemekWirkus","followers_url":"https://api.github.com/users/PrzemekWirkus/followers","following_url":"https://api.github.com/users/PrzemekWirkus/following{/other_user}","gists_url":"https://api.github.com/users/PrzemekWirkus/gists{/gist_id}","starred_url":"https://api.github.com/users/PrzemekWirkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrzemekWirkus/subscriptions","organizations_url":"https://api.github.com/users/PrzemekWirkus/orgs","repos_url":"https://api.github.com/users/PrzemekWirkus/repos","events_url":"https://api.github.com/users/PrzemekWirkus/events{/privacy}","received_events_url":"https://api.github.com/users/PrzemekWirkus/received_events","type":"User","site_admin":false},"body":"This PR is response for https://github.com/ARMmbed/htrun/issues/80.\r\n\r\nChanges:\r\n* Add check if custom host test (in most cases loaded from ```<module>/test/host_tests```) inherits from ```mbed_host_tests.BaseHostTest()``` and calls required ```BaseHostTest.__init__(self)``` ctor.\r\n\r\nThis change applies to all developers writing host tests where they create custom ctor for their host test.\r\nExample:\r\n```python\r\nfrom mbed_host_tests import BaseHostTest\r\n\r\nclass MyCustomHostTest(BaseHostTest):\r\n\r\n    # Custom host test script constructor!\r\n    # We have to call BaseHostTest.__init__(self)\r\n    def __init__(self):\r\n        BaseHostTest.__init__(self)    # OK\r\n        pass\r\n\r\n    # host test implementation\r\n```\r\nor\r\n```python\r\nfrom mbed_host_tests import BaseHostTest\r\n\r\nclass MyCustomHostTest(BaseHostTest):\r\n    # No __init__(self)\r\n    # BaseHostTest.__init__(self) will be called automatically\r\n\r\n    # host test implementation\r\n```\r\n\r\nIn case users have custom host test with ```__init__(self) defined and no call to ```BaseHostTest.__init__(self)``` ```htrun``` will yield error and message as seen below:\r\n```\r\n[1460987409.99][HTST][ERR] ==== host test script 'test_auto' error ====\r\n[1460987409.99][HTST][ERR] * host test doesn't inherit from mbed_host_tests.BaseHostTest() class or\r\n[1460987409.99][HTST][ERR] * BaseHostTest.__init__(self) not called in host test script constructor\r\n[1460987409.99][HTST][ERR] ==== host test script error ====\r\n```\r\nPlease note that ```htrun``` will also return ```ERROR``` for given test suite.\r\nExample:\r\n```\r\n...\r\n[1460987409.99][HTST][ERR] ==== host test script 'test_auto' error ====\r\n[1460987409.99][HTST][ERR] * host test doesn't inherit from mbed_host_tests.BaseHostTest() class or\r\n[1460987409.99][HTST][ERR] * BaseHostTest.__init__(self) not called in host test script constructor\r\n[1460987409.99][HTST][ERR] ==== host test script error ====\r\n[1460987409.99][HTST][INF] test suite run finished after 0.04 sec...\r\n[1460987410.00][HTST][INF] CONN exited with code: 0\r\n[1460987410.00][HTST][INF] Some events in queue\r\n[1460987410.00][HTST][INF] stopped consuming events\r\n[1460987410.00][HTST][INF] host test result() call skipped, received: error\r\n[1460987410.00][HTST][WRN] missing __exit event from DUT\r\n[1460987410.00][HTST][INF] calling blocking teardown()\r\n[1460987410.00][HTST][INF] teardown() finished\r\n[1460987410.00][HTST][INF] {{result;error}}\r\nmbedgt: checking for GCOV data...\r\nmbedgt: mbed-host-test-runner: stopped\r\nmbedgt: mbed-host-test-runner: returned 'ERROR'\r\nmbedgt: test case summary event not found\r\n        no test case report present, assuming test suite to be a single test case!\r\n        test suite: mbed-drivers-test-generic_tests\r\n        test case: generic_tests\r\nmbedgt: test on hardware with target id: 0240000033514e45002c500585d4001ee981000097969900\r\nmbedgt: test suite 'mbed-drivers-test-generic_tests' ................................................. ERROR in 10.64 sec\r\n        test case: 'generic_tests' ................................................................... ERROR in 10.64 sec\r\n...\r\n\r\n```\r\n","created_at":"2016-04-18T14:00:33Z","updated_at":"2016-06-08T09:03:24Z","closed_at":"2016-06-07T19:06:08Z","merged_at":"2016-06-07T19:06:08Z","merge_commit_sha":"4b4594282d3116f74261cb4b0197a93a255f1494","assignee":{"login":"PrzemekWirkus","id":6360720,"avatar_url":"https://avatars.githubusercontent.com/u/6360720?v=3","gravatar_id":"","url":"https://api.github.com/users/PrzemekWirkus","html_url":"https://github.com/PrzemekWirkus","followers_url":"https://api.github.com/users/PrzemekWirkus/followers","following_url":"https://api.github.com/users/PrzemekWirkus/following{/other_user}","gists_url":"https://api.github.com/users/PrzemekWirkus/gists{/gist_id}","starred_url":"https://api.github.com/users/PrzemekWirkus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PrzemekWirkus/subscriptions","organizations_url":"https://api.github.com/users/PrzemekWirkus/orgs","repos_url":"https://api.github.com/users/PrzemekWirkus/repos","events_url":"https://api.github.com/users/PrzemekWirkus/events{/privacy}","received_events_url":"https://api.github.com/users/PrzemekWirkus/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ARMmbed/htrun/pulls/83/commits","review_comments_url":"https://api.github.com/repos/ARMmbed/htrun/pulls/83/comments","review_comment_url":"https://api.github.com/repos/ARMmbed/htrun/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ARMmbed/htrun/issues/83/comments","statuses_url":"https://api.github.com/repos/ARMmbed/htrun/statuses/86d9df199f23cc7ed91008ac2597080b850ad245","head":{"label":"ARMmbed:issue_80","ref":"issue_80","sha":"86d9df199f23cc7ed91008ac2597080b850ad245","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":30917094,"name":"htrun","full_name":"ARMmbed/htrun","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/htrun","description":"Flash, reset and  perform host supervised tests on mbed platforms.","fork":false,"url":"https://api.github.com/repos/ARMmbed/htrun","forks_url":"https://api.github.com/repos/ARMmbed/htrun/forks","keys_url":"https://api.github.com/repos/ARMmbed/htrun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/htrun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/htrun/teams","hooks_url":"https://api.github.com/repos/ARMmbed/htrun/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/htrun/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/htrun/events","assignees_url":"https://api.github.com/repos/ARMmbed/htrun/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/htrun/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/htrun/tags","blobs_url":"https://api.github.com/repos/ARMmbed/htrun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/htrun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/htrun/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/htrun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/htrun/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/htrun/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/htrun/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/htrun/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/htrun/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/htrun/subscription","commits_url":"https://api.github.com/repos/ARMmbed/htrun/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/htrun/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/htrun/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/htrun/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/htrun/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/htrun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/htrun/merges","archive_url":"https://api.github.com/repos/ARMmbed/htrun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/htrun/downloads","issues_url":"https://api.github.com/repos/ARMmbed/htrun/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/htrun/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/htrun/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/htrun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/htrun/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/htrun/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/htrun/deployments","created_at":"2015-02-17T12:59:42Z","updated_at":"2016-05-09T09:31:44Z","pushed_at":"2016-06-07T19:10:35Z","git_url":"git://github.com/ARMmbed/htrun.git","ssh_url":"git@github.com:ARMmbed/htrun.git","clone_url":"https://github.com/ARMmbed/htrun.git","svn_url":"https://github.com/ARMmbed/htrun","homepage":"","size":472,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":6,"forks":12,"open_issues":6,"watchers":1,"default_branch":"master"}},"base":{"label":"ARMmbed:master","ref":"master","sha":"d72382a6215ce4c59d2d8991b61336340fb893c6","user":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"repo":{"id":30917094,"name":"htrun","full_name":"ARMmbed/htrun","owner":{"login":"ARMmbed","id":8916057,"avatar_url":"https://avatars.githubusercontent.com/u/8916057?v=3","gravatar_id":"","url":"https://api.github.com/users/ARMmbed","html_url":"https://github.com/ARMmbed","followers_url":"https://api.github.com/users/ARMmbed/followers","following_url":"https://api.github.com/users/ARMmbed/following{/other_user}","gists_url":"https://api.github.com/users/ARMmbed/gists{/gist_id}","starred_url":"https://api.github.com/users/ARMmbed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ARMmbed/subscriptions","organizations_url":"https://api.github.com/users/ARMmbed/orgs","repos_url":"https://api.github.com/users/ARMmbed/repos","events_url":"https://api.github.com/users/ARMmbed/events{/privacy}","received_events_url":"https://api.github.com/users/ARMmbed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ARMmbed/htrun","description":"Flash, reset and  perform host supervised tests on mbed platforms.","fork":false,"url":"https://api.github.com/repos/ARMmbed/htrun","forks_url":"https://api.github.com/repos/ARMmbed/htrun/forks","keys_url":"https://api.github.com/repos/ARMmbed/htrun/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ARMmbed/htrun/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ARMmbed/htrun/teams","hooks_url":"https://api.github.com/repos/ARMmbed/htrun/hooks","issue_events_url":"https://api.github.com/repos/ARMmbed/htrun/issues/events{/number}","events_url":"https://api.github.com/repos/ARMmbed/htrun/events","assignees_url":"https://api.github.com/repos/ARMmbed/htrun/assignees{/user}","branches_url":"https://api.github.com/repos/ARMmbed/htrun/branches{/branch}","tags_url":"https://api.github.com/repos/ARMmbed/htrun/tags","blobs_url":"https://api.github.com/repos/ARMmbed/htrun/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ARMmbed/htrun/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ARMmbed/htrun/git/refs{/sha}","trees_url":"https://api.github.com/repos/ARMmbed/htrun/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ARMmbed/htrun/statuses/{sha}","languages_url":"https://api.github.com/repos/ARMmbed/htrun/languages","stargazers_url":"https://api.github.com/repos/ARMmbed/htrun/stargazers","contributors_url":"https://api.github.com/repos/ARMmbed/htrun/contributors","subscribers_url":"https://api.github.com/repos/ARMmbed/htrun/subscribers","subscription_url":"https://api.github.com/repos/ARMmbed/htrun/subscription","commits_url":"https://api.github.com/repos/ARMmbed/htrun/commits{/sha}","git_commits_url":"https://api.github.com/repos/ARMmbed/htrun/git/commits{/sha}","comments_url":"https://api.github.com/repos/ARMmbed/htrun/comments{/number}","issue_comment_url":"https://api.github.com/repos/ARMmbed/htrun/issues/comments{/number}","contents_url":"https://api.github.com/repos/ARMmbed/htrun/contents/{+path}","compare_url":"https://api.github.com/repos/ARMmbed/htrun/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ARMmbed/htrun/merges","archive_url":"https://api.github.com/repos/ARMmbed/htrun/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ARMmbed/htrun/downloads","issues_url":"https://api.github.com/repos/ARMmbed/htrun/issues{/number}","pulls_url":"https://api.github.com/repos/ARMmbed/htrun/pulls{/number}","milestones_url":"https://api.github.com/repos/ARMmbed/htrun/milestones{/number}","notifications_url":"https://api.github.com/repos/ARMmbed/htrun/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ARMmbed/htrun/labels{/name}","releases_url":"https://api.github.com/repos/ARMmbed/htrun/releases{/id}","deployments_url":"https://api.github.com/repos/ARMmbed/htrun/deployments","created_at":"2015-02-17T12:59:42Z","updated_at":"2016-05-09T09:31:44Z","pushed_at":"2016-06-07T19:10:35Z","git_url":"git://github.com/ARMmbed/htrun.git","ssh_url":"git@github.com:ARMmbed/htrun.git","clone_url":"https://github.com/ARMmbed/htrun.git","svn_url":"https://github.com/ARMmbed/htrun","homepage":"","size":472,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":6,"forks":12,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ARMmbed/htrun/pulls/83"},"html":{"href":"https://github.com/ARMmbed/htrun/pull/83"},"issue":{"href":"https://api.github.com/repos/ARMmbed/htrun/issues/83"},"comments":{"href":"https://api.github.com/repos/ARMmbed/htrun/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/ARMmbed/htrun/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/ARMmbed/htrun/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ARMmbed/htrun/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/ARMmbed/htrun/statuses/86d9df199f23cc7ed91008ac2597080b850ad245"}}}}
{"actor":{"display_login":"bridadan"}}