{"action":"created","comment":{"url":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments/123263926","pull_request_review_id":45449793,"id":123263926,"diff_hunk":"@@ -361,24 +361,80 @@ The instances should have:\n \n .. [#f1] Avocado plugins can introduce additional test types.\n \n-Pre and post tests plugins\n-==========================\n+Pre and post plugins\n+====================\n+\n+Avocado provides interfaces with which custom plugins can register to\n+be called at various times.  For instance, it's possible to trigger\n+custom actions before and after the execution of a :class:`job\n+<avocado.core.job.Job>`, or before and after the execution of the\n+tests from a job :data:`test suite <avocado.core.job.Job.test_suite>`.\n+\n+Let's discuss each interface briefly.\n+\n+Before and after jobs\n+---------------------\n \n Avocado supports plug-ins which are (guaranteed to be) executed before the\n first test and after all tests finished. The interfaces are\n-:class:`avocado.core.plugin_interfaces.JobPre`, resp.\n-:class:`avocado.core.plugin_interfaces.JobPost`.\n-\n-Note the ``pre_tests`` might not be executed due to earlier failure which\n-prevents the tests from being executed.\n-\n-The same applies for ``post_tests``, but it is possible to have ``post_tests``\n-executed even when ``pre_tests`` were not. Additionally the ``post_tests``\n-are (obviously) not executed on ``SIGKILL``. On the other hand they are\n-executed on ``SIGTERM`` and ``KeyboardInterrupt`` while running\n-the tests, but once the ``post_tests`` are executed the ``KeyboardInterrupt``\n-or ``SystemExit`` interrupts their processing (to avoid hangs) and remaining\n-plug-ins will **NOT** be executed.\n+:class:`avocado.core.plugin_interfaces.JobPre` and\n+:class:`avocado.core.plugin_interfaces.JobPost`, respectively.\n+\n+The :meth:`pre <avocado.core.plugin_interfaces.JobPre.pre>` method of\n+each installed plugin of type ``job.prepost`` is called by the ``run``\n+command, that is, anytime an ``avocado run <valid_test_reference>``\n+command is executed.\n+\n+Then, immediately after that, the job's :meth:`run\n+<avocado.core.job.Job.run>` method is called, which attempts to run\n+all job phases, from test suite creation to test execution.\n+\n+No matter what happens up to this point, as long as the Avocado test\n+runner is still in execution (that is, has not been terminated by a\n+system condition that it can not control), it will attempt to run the","path":"docs/source/ReferenceGuide.rst","position":49,"original_position":49,"commit_id":"af2f95f08daf26af9c890d765d27220b9a37de5e","original_commit_id":"af2f95f08daf26af9c890d765d27220b9a37de5e","user":{"login":"clebergnu","id":447178,"avatar_url":"https://avatars2.githubusercontent.com/u/447178?v=3","gravatar_id":"","url":"https://api.github.com/users/clebergnu","html_url":"https://github.com/clebergnu","followers_url":"https://api.github.com/users/clebergnu/followers","following_url":"https://api.github.com/users/clebergnu/following{/other_user}","gists_url":"https://api.github.com/users/clebergnu/gists{/gist_id}","starred_url":"https://api.github.com/users/clebergnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clebergnu/subscriptions","organizations_url":"https://api.github.com/users/clebergnu/orgs","repos_url":"https://api.github.com/users/clebergnu/repos","events_url":"https://api.github.com/users/clebergnu/events{/privacy}","received_events_url":"https://api.github.com/users/clebergnu/received_events","type":"User","site_admin":false},"body":"Right, good point.","created_at":"2017-06-21T14:26:34Z","updated_at":"2017-06-21T14:26:34Z","html_url":"https://github.com/avocado-framework/avocado/pull/2083#discussion_r123263926","pull_request_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083","_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments/123263926"},"html":{"href":"https://github.com/avocado-framework/avocado/pull/2083#discussion_r123263926"},"pull_request":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083"}}},"pull_request":{"url":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083","id":126651470,"html_url":"https://github.com/avocado-framework/avocado/pull/2083","diff_url":"https://github.com/avocado-framework/avocado/pull/2083.diff","patch_url":"https://github.com/avocado-framework/avocado/pull/2083.patch","issue_url":"https://api.github.com/repos/avocado-framework/avocado/issues/2083","number":2083,"state":"open","locked":false,"title":"Docs: add section on pre/post job and pre/post tests","user":{"login":"clebergnu","id":447178,"avatar_url":"https://avatars2.githubusercontent.com/u/447178?v=3","gravatar_id":"","url":"https://api.github.com/users/clebergnu","html_url":"https://github.com/clebergnu","followers_url":"https://api.github.com/users/clebergnu/followers","following_url":"https://api.github.com/users/clebergnu/following{/other_user}","gists_url":"https://api.github.com/users/clebergnu/gists{/gist_id}","starred_url":"https://api.github.com/users/clebergnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clebergnu/subscriptions","organizations_url":"https://api.github.com/users/clebergnu/orgs","repos_url":"https://api.github.com/users/clebergnu/repos","events_url":"https://api.github.com/users/clebergnu/events{/privacy}","received_events_url":"https://api.github.com/users/clebergnu/received_events","type":"User","site_admin":false},"body":"We were lacking a clearer explanation on the pre/post job and pre/post\r\ntests interface.  When they're executed, and under which conditions\r\nthey'll be attempted.\r\n\r\nSigned-off-by: Cleber Rosa <crosa@redhat.com>","created_at":"2017-06-20T23:30:56Z","updated_at":"2017-06-21T14:26:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b18f82572ef7d3eb64044bec06db2795fdd0ecc","assignee":{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars0.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false},"assignees":[{"login":"ldoktor","id":1074021,"avatar_url":"https://avatars0.githubusercontent.com/u/1074021?v=3","gravatar_id":"","url":"https://api.github.com/users/ldoktor","html_url":"https://github.com/ldoktor","followers_url":"https://api.github.com/users/ldoktor/followers","following_url":"https://api.github.com/users/ldoktor/following{/other_user}","gists_url":"https://api.github.com/users/ldoktor/gists{/gist_id}","starred_url":"https://api.github.com/users/ldoktor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldoktor/subscriptions","organizations_url":"https://api.github.com/users/ldoktor/orgs","repos_url":"https://api.github.com/users/ldoktor/repos","events_url":"https://api.github.com/users/ldoktor/events{/privacy}","received_events_url":"https://api.github.com/users/ldoktor/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083/commits","review_comments_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083/comments","review_comment_url":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments{/number}","comments_url":"https://api.github.com/repos/avocado-framework/avocado/issues/2083/comments","statuses_url":"https://api.github.com/repos/avocado-framework/avocado/statuses/af2f95f08daf26af9c890d765d27220b9a37de5e","head":{"label":"clebergnu:docs_job_pre_post","ref":"docs_job_pre_post","sha":"af2f95f08daf26af9c890d765d27220b9a37de5e","user":{"login":"clebergnu","id":447178,"avatar_url":"https://avatars2.githubusercontent.com/u/447178?v=3","gravatar_id":"","url":"https://api.github.com/users/clebergnu","html_url":"https://github.com/clebergnu","followers_url":"https://api.github.com/users/clebergnu/followers","following_url":"https://api.github.com/users/clebergnu/following{/other_user}","gists_url":"https://api.github.com/users/clebergnu/gists{/gist_id}","starred_url":"https://api.github.com/users/clebergnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clebergnu/subscriptions","organizations_url":"https://api.github.com/users/clebergnu/orgs","repos_url":"https://api.github.com/users/clebergnu/repos","events_url":"https://api.github.com/users/clebergnu/events{/privacy}","received_events_url":"https://api.github.com/users/clebergnu/received_events","type":"User","site_admin":false},"repo":{"id":17944017,"name":"avocado","full_name":"clebergnu/avocado","owner":{"login":"clebergnu","id":447178,"avatar_url":"https://avatars2.githubusercontent.com/u/447178?v=3","gravatar_id":"","url":"https://api.github.com/users/clebergnu","html_url":"https://github.com/clebergnu","followers_url":"https://api.github.com/users/clebergnu/followers","following_url":"https://api.github.com/users/clebergnu/following{/other_user}","gists_url":"https://api.github.com/users/clebergnu/gists{/gist_id}","starred_url":"https://api.github.com/users/clebergnu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clebergnu/subscriptions","organizations_url":"https://api.github.com/users/clebergnu/orgs","repos_url":"https://api.github.com/users/clebergnu/repos","events_url":"https://api.github.com/users/clebergnu/events{/privacy}","received_events_url":"https://api.github.com/users/clebergnu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clebergnu/avocado","description":"Avocado Test Runner","fork":true,"url":"https://api.github.com/repos/clebergnu/avocado","forks_url":"https://api.github.com/repos/clebergnu/avocado/forks","keys_url":"https://api.github.com/repos/clebergnu/avocado/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clebergnu/avocado/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clebergnu/avocado/teams","hooks_url":"https://api.github.com/repos/clebergnu/avocado/hooks","issue_events_url":"https://api.github.com/repos/clebergnu/avocado/issues/events{/number}","events_url":"https://api.github.com/repos/clebergnu/avocado/events","assignees_url":"https://api.github.com/repos/clebergnu/avocado/assignees{/user}","branches_url":"https://api.github.com/repos/clebergnu/avocado/branches{/branch}","tags_url":"https://api.github.com/repos/clebergnu/avocado/tags","blobs_url":"https://api.github.com/repos/clebergnu/avocado/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clebergnu/avocado/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clebergnu/avocado/git/refs{/sha}","trees_url":"https://api.github.com/repos/clebergnu/avocado/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clebergnu/avocado/statuses/{sha}","languages_url":"https://api.github.com/repos/clebergnu/avocado/languages","stargazers_url":"https://api.github.com/repos/clebergnu/avocado/stargazers","contributors_url":"https://api.github.com/repos/clebergnu/avocado/contributors","subscribers_url":"https://api.github.com/repos/clebergnu/avocado/subscribers","subscription_url":"https://api.github.com/repos/clebergnu/avocado/subscription","commits_url":"https://api.github.com/repos/clebergnu/avocado/commits{/sha}","git_commits_url":"https://api.github.com/repos/clebergnu/avocado/git/commits{/sha}","comments_url":"https://api.github.com/repos/clebergnu/avocado/comments{/number}","issue_comment_url":"https://api.github.com/repos/clebergnu/avocado/issues/comments{/number}","contents_url":"https://api.github.com/repos/clebergnu/avocado/contents/{+path}","compare_url":"https://api.github.com/repos/clebergnu/avocado/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clebergnu/avocado/merges","archive_url":"https://api.github.com/repos/clebergnu/avocado/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clebergnu/avocado/downloads","issues_url":"https://api.github.com/repos/clebergnu/avocado/issues{/number}","pulls_url":"https://api.github.com/repos/clebergnu/avocado/pulls{/number}","milestones_url":"https://api.github.com/repos/clebergnu/avocado/milestones{/number}","notifications_url":"https://api.github.com/repos/clebergnu/avocado/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clebergnu/avocado/labels{/name}","releases_url":"https://api.github.com/repos/clebergnu/avocado/releases{/id}","deployments_url":"https://api.github.com/repos/clebergnu/avocado/deployments","created_at":"2014-03-20T13:42:05Z","updated_at":"2017-03-14T20:16:34Z","pushed_at":"2017-06-20T23:30:32Z","git_url":"git://github.com/clebergnu/avocado.git","ssh_url":"git@github.com:clebergnu/avocado.git","clone_url":"https://github.com/clebergnu/avocado.git","svn_url":"https://github.com/clebergnu/avocado","homepage":"","size":10789,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"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":"avocado-framework:master","ref":"master","sha":"a103022a7c82759da3c0115aff2013a2bcc39338","user":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars0.githubusercontent.com/u/7245719?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":17449498,"name":"avocado","full_name":"avocado-framework/avocado","owner":{"login":"avocado-framework","id":7245719,"avatar_url":"https://avatars0.githubusercontent.com/u/7245719?v=3","gravatar_id":"","url":"https://api.github.com/users/avocado-framework","html_url":"https://github.com/avocado-framework","followers_url":"https://api.github.com/users/avocado-framework/followers","following_url":"https://api.github.com/users/avocado-framework/following{/other_user}","gists_url":"https://api.github.com/users/avocado-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/avocado-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avocado-framework/subscriptions","organizations_url":"https://api.github.com/users/avocado-framework/orgs","repos_url":"https://api.github.com/users/avocado-framework/repos","events_url":"https://api.github.com/users/avocado-framework/events{/privacy}","received_events_url":"https://api.github.com/users/avocado-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/avocado-framework/avocado","description":"Avocado Test Framework","fork":false,"url":"https://api.github.com/repos/avocado-framework/avocado","forks_url":"https://api.github.com/repos/avocado-framework/avocado/forks","keys_url":"https://api.github.com/repos/avocado-framework/avocado/keys{/key_id}","collaborators_url":"https://api.github.com/repos/avocado-framework/avocado/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/avocado-framework/avocado/teams","hooks_url":"https://api.github.com/repos/avocado-framework/avocado/hooks","issue_events_url":"https://api.github.com/repos/avocado-framework/avocado/issues/events{/number}","events_url":"https://api.github.com/repos/avocado-framework/avocado/events","assignees_url":"https://api.github.com/repos/avocado-framework/avocado/assignees{/user}","branches_url":"https://api.github.com/repos/avocado-framework/avocado/branches{/branch}","tags_url":"https://api.github.com/repos/avocado-framework/avocado/tags","blobs_url":"https://api.github.com/repos/avocado-framework/avocado/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/avocado-framework/avocado/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/avocado-framework/avocado/git/refs{/sha}","trees_url":"https://api.github.com/repos/avocado-framework/avocado/git/trees{/sha}","statuses_url":"https://api.github.com/repos/avocado-framework/avocado/statuses/{sha}","languages_url":"https://api.github.com/repos/avocado-framework/avocado/languages","stargazers_url":"https://api.github.com/repos/avocado-framework/avocado/stargazers","contributors_url":"https://api.github.com/repos/avocado-framework/avocado/contributors","subscribers_url":"https://api.github.com/repos/avocado-framework/avocado/subscribers","subscription_url":"https://api.github.com/repos/avocado-framework/avocado/subscription","commits_url":"https://api.github.com/repos/avocado-framework/avocado/commits{/sha}","git_commits_url":"https://api.github.com/repos/avocado-framework/avocado/git/commits{/sha}","comments_url":"https://api.github.com/repos/avocado-framework/avocado/comments{/number}","issue_comment_url":"https://api.github.com/repos/avocado-framework/avocado/issues/comments{/number}","contents_url":"https://api.github.com/repos/avocado-framework/avocado/contents/{+path}","compare_url":"https://api.github.com/repos/avocado-framework/avocado/compare/{base}...{head}","merges_url":"https://api.github.com/repos/avocado-framework/avocado/merges","archive_url":"https://api.github.com/repos/avocado-framework/avocado/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/avocado-framework/avocado/downloads","issues_url":"https://api.github.com/repos/avocado-framework/avocado/issues{/number}","pulls_url":"https://api.github.com/repos/avocado-framework/avocado/pulls{/number}","milestones_url":"https://api.github.com/repos/avocado-framework/avocado/milestones{/number}","notifications_url":"https://api.github.com/repos/avocado-framework/avocado/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/avocado-framework/avocado/labels{/name}","releases_url":"https://api.github.com/repos/avocado-framework/avocado/releases{/id}","deployments_url":"https://api.github.com/repos/avocado-framework/avocado/deployments","created_at":"2014-03-05T17:52:27Z","updated_at":"2017-06-19T15:32:40Z","pushed_at":"2017-06-21T14:00:54Z","git_url":"git://github.com/avocado-framework/avocado.git","ssh_url":"git@github.com:avocado-framework/avocado.git","clone_url":"https://github.com/avocado-framework/avocado.git","svn_url":"https://github.com/avocado-framework/avocado","homepage":"http://avocado-framework.github.io/","size":10822,"stargazers_count":101,"watchers_count":101,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":125,"mirror_url":null,"open_issues_count":24,"forks":125,"open_issues":24,"watchers":101,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083"},"html":{"href":"https://github.com/avocado-framework/avocado/pull/2083"},"issue":{"href":"https://api.github.com/repos/avocado-framework/avocado/issues/2083"},"comments":{"href":"https://api.github.com/repos/avocado-framework/avocado/issues/2083/comments"},"review_comments":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083/comments"},"review_comment":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/avocado-framework/avocado/pulls/2083/commits"},"statuses":{"href":"https://api.github.com/repos/avocado-framework/avocado/statuses/af2f95f08daf26af9c890d765d27220b9a37de5e"}}}}
{"actor":{"display_login":"clebergnu"}}