{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments/221443111","pull_request_review_id":160096878,"id":221443111,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMTQ0MzExMQ==","diff_hunk":"@@ -0,0 +1,142 @@\n+# (C) Datadog, Inc. 2018\n+# All rights reserved\n+# Licensed under a 3-clause BSD style license (see LICENSE)\n+from .constants import TESTABLE_FILE_EXTENSIONS, get_root\n+from .git import files_changed\n+from .utils import get_testable_checks\n+from ..subprocess import run_command\n+from ..utils import chdir, path_join\n+\n+STYLE_ENVS = {\n+    'flake8',\n+}\n+\n+\n+def get_tox_envs(checks, style=False, benchmark=False, every=False, changed_only=False, sort=False):\n+    testable_checks = get_testable_checks()\n+    changed_checks = get_changed_checks() if changed_only else None\n+\n+    if not checks:\n+        checks = sorted(\n+            testable_checks & (\n+                get_changed_checks() if changed_checks is None else changed_checks\n+            )\n+        )\n+\n+    checks_seen = set()\n+    for check in checks:\n+        check, _, envs_selected = check.partition(':')\n+\n+        if (\n+            check in checks_seen\n+            or check not in testable_checks\n+            or (changed_only and check not in changed_checks)\n+        ):\n+            continue\n+        else:\n+            checks_seen.add(check)\n+\n+        envs_selected = envs_selected.split(',') if envs_selected else []\n+        envs_available = get_available_tox_envs(check, sort=sort)\n+\n+        if style:\n+            envs_selected[:] = [\n+                e for e in envs_available\n+                if e in STYLE_ENVS\n+            ]\n+        elif benchmark:\n+            envs_selected[:] = [\n+                e for e in envs_available\n+                if 'bench' in e\n+            ]\n+        else:\n+            if every:\n+                envs_selected[:] = envs_available\n+            elif envs_selected:\n+                available = set(envs_selected) & set(envs_available)\n+                selected = []\n+\n+                # Retain order\n+                for e in envs_selected:","path":"datadog_checks_dev/datadog_checks/dev/tooling/test.py","position":57,"original_position":60,"commit_id":"27bf3760944baadfe820435bd571ca9ee4eb612d","original_commit_id":"2697ebf985a0732710073be79722ca5de6bb4b58","user":{"login":"zippolyte","id":19330189,"node_id":"MDQ6VXNlcjE5MzMwMTg5","avatar_url":"https://avatars0.githubusercontent.com/u/19330189?v=4","gravatar_id":"","url":"https://api.github.com/users/zippolyte","html_url":"https://github.com/zippolyte","followers_url":"https://api.github.com/users/zippolyte/followers","following_url":"https://api.github.com/users/zippolyte/following{/other_user}","gists_url":"https://api.github.com/users/zippolyte/gists{/gist_id}","starred_url":"https://api.github.com/users/zippolyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zippolyte/subscriptions","organizations_url":"https://api.github.com/users/zippolyte/orgs","repos_url":"https://api.github.com/users/zippolyte/repos","events_url":"https://api.github.com/users/zippolyte/events{/privacy}","received_events_url":"https://api.github.com/users/zippolyte/received_events","type":"User","site_admin":false},"body":"Fair enough !","created_at":"2018-09-30T00:10:42Z","updated_at":"2018-09-30T00:10:42Z","html_url":"https://github.com/DataDog/integrations-core/pull/2312#discussion_r221443111","pull_request_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments/221443111"},"html":{"href":"https://github.com/DataDog/integrations-core/pull/2312#discussion_r221443111"},"pull_request":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312"}},"in_reply_to_id":221344151},"pull_request":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312","id":218852654,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE4ODUyNjU0","html_url":"https://github.com/DataDog/integrations-core/pull/2312","diff_url":"https://github.com/DataDog/integrations-core/pull/2312.diff","patch_url":"https://github.com/DataDog/integrations-core/pull/2312.patch","issue_url":"https://api.github.com/repos/DataDog/integrations-core/issues/2312","number":2312,"state":"open","locked":false,"title":"Allow testing of specific environments","user":{"login":"ofek","id":9677399,"node_id":"MDQ6VXNlcjk2NzczOTk=","avatar_url":"https://avatars1.githubusercontent.com/u/9677399?v=4","gravatar_id":"","url":"https://api.github.com/users/ofek","html_url":"https://github.com/ofek","followers_url":"https://api.github.com/users/ofek/followers","following_url":"https://api.github.com/users/ofek/following{/other_user}","gists_url":"https://api.github.com/users/ofek/gists{/gist_id}","starred_url":"https://api.github.com/users/ofek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ofek/subscriptions","organizations_url":"https://api.github.com/users/ofek/orgs","repos_url":"https://api.github.com/users/ofek/repos","events_url":"https://api.github.com/users/ofek/events{/privacy}","received_events_url":"https://api.github.com/users/ofek/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n\r\nAlso adds:\r\n\r\n- Ability to show available environments\r\n- Flag to test only style","created_at":"2018-09-28T04:45:21Z","updated_at":"2018-09-30T00:10:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fdce0358aa7f8979d291744c5ff0ddea0f8c4b7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[{"name":"baklava","id":1824228,"node_id":"MDQ6VGVhbTE4MjQyMjg=","slug":"baklava","description":"community ","privacy":"closed","url":"https://api.github.com/teams/1824228","members_url":"https://api.github.com/teams/1824228/members{/member}","repositories_url":"https://api.github.com/teams/1824228/repos","permission":"pull"}],"labels":[{"id":937215339,"node_id":"MDU6TGFiZWw5MzcyMTUzMzk=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/changelog/Added","name":"changelog/Added","color":"f2983e","default":false},{"id":992015121,"node_id":"MDU6TGFiZWw5OTIwMTUxMjE=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/integration/datadog_checks_dev","name":"integration/datadog_checks_dev","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312/commits","review_comments_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312/comments","review_comment_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/issues/2312/comments","statuses_url":"https://api.github.com/repos/DataDog/integrations-core/statuses/27bf3760944baadfe820435bd571ca9ee4eb612d","head":{"label":"DataDog:ofek/env","ref":"ofek/env","sha":"27bf3760944baadfe820435bd571ca9ee4eb612d","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":47203045,"node_id":"MDEwOlJlcG9zaXRvcnk0NzIwMzA0NQ==","name":"integrations-core","full_name":"DataDog/integrations-core","private":false,"owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DataDog/integrations-core","description":"Core integrations of the Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/integrations-core","forks_url":"https://api.github.com/repos/DataDog/integrations-core/forks","keys_url":"https://api.github.com/repos/DataDog/integrations-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/integrations-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/integrations-core/teams","hooks_url":"https://api.github.com/repos/DataDog/integrations-core/hooks","issue_events_url":"https://api.github.com/repos/DataDog/integrations-core/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/integrations-core/events","assignees_url":"https://api.github.com/repos/DataDog/integrations-core/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/integrations-core/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/integrations-core/tags","blobs_url":"https://api.github.com/repos/DataDog/integrations-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/integrations-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/integrations-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/integrations-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/integrations-core/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/integrations-core/languages","stargazers_url":"https://api.github.com/repos/DataDog/integrations-core/stargazers","contributors_url":"https://api.github.com/repos/DataDog/integrations-core/contributors","subscribers_url":"https://api.github.com/repos/DataDog/integrations-core/subscribers","subscription_url":"https://api.github.com/repos/DataDog/integrations-core/subscription","commits_url":"https://api.github.com/repos/DataDog/integrations-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/integrations-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/integrations-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/integrations-core/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/integrations-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/integrations-core/merges","archive_url":"https://api.github.com/repos/DataDog/integrations-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/integrations-core/downloads","issues_url":"https://api.github.com/repos/DataDog/integrations-core/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/integrations-core/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/integrations-core/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/integrations-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/integrations-core/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/integrations-core/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/integrations-core/deployments","created_at":"2015-12-01T16:41:45Z","updated_at":"2018-09-29T17:40:57Z","pushed_at":"2018-09-29T17:42:31Z","git_url":"git://github.com/DataDog/integrations-core.git","ssh_url":"git@github.com:DataDog/integrations-core.git","clone_url":"https://github.com/DataDog/integrations-core.git","svn_url":"https://github.com/DataDog/integrations-core","homepage":"","size":29332,"stargazers_count":146,"watchers_count":146,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":326,"mirror_url":null,"archived":false,"open_issues_count":63,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":326,"open_issues":63,"watchers":146,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"6c7221f0da6b32d45d3b5e2e196ea2a3937d7bcb","user":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"repo":{"id":47203045,"node_id":"MDEwOlJlcG9zaXRvcnk0NzIwMzA0NQ==","name":"integrations-core","full_name":"DataDog/integrations-core","private":false,"owner":{"login":"DataDog","id":365230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NTIzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/365230?v=4","gravatar_id":"","url":"https://api.github.com/users/DataDog","html_url":"https://github.com/DataDog","followers_url":"https://api.github.com/users/DataDog/followers","following_url":"https://api.github.com/users/DataDog/following{/other_user}","gists_url":"https://api.github.com/users/DataDog/gists{/gist_id}","starred_url":"https://api.github.com/users/DataDog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataDog/subscriptions","organizations_url":"https://api.github.com/users/DataDog/orgs","repos_url":"https://api.github.com/users/DataDog/repos","events_url":"https://api.github.com/users/DataDog/events{/privacy}","received_events_url":"https://api.github.com/users/DataDog/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DataDog/integrations-core","description":"Core integrations of the Datadog Agent","fork":false,"url":"https://api.github.com/repos/DataDog/integrations-core","forks_url":"https://api.github.com/repos/DataDog/integrations-core/forks","keys_url":"https://api.github.com/repos/DataDog/integrations-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataDog/integrations-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataDog/integrations-core/teams","hooks_url":"https://api.github.com/repos/DataDog/integrations-core/hooks","issue_events_url":"https://api.github.com/repos/DataDog/integrations-core/issues/events{/number}","events_url":"https://api.github.com/repos/DataDog/integrations-core/events","assignees_url":"https://api.github.com/repos/DataDog/integrations-core/assignees{/user}","branches_url":"https://api.github.com/repos/DataDog/integrations-core/branches{/branch}","tags_url":"https://api.github.com/repos/DataDog/integrations-core/tags","blobs_url":"https://api.github.com/repos/DataDog/integrations-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataDog/integrations-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataDog/integrations-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataDog/integrations-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataDog/integrations-core/statuses/{sha}","languages_url":"https://api.github.com/repos/DataDog/integrations-core/languages","stargazers_url":"https://api.github.com/repos/DataDog/integrations-core/stargazers","contributors_url":"https://api.github.com/repos/DataDog/integrations-core/contributors","subscribers_url":"https://api.github.com/repos/DataDog/integrations-core/subscribers","subscription_url":"https://api.github.com/repos/DataDog/integrations-core/subscription","commits_url":"https://api.github.com/repos/DataDog/integrations-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataDog/integrations-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataDog/integrations-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataDog/integrations-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataDog/integrations-core/contents/{+path}","compare_url":"https://api.github.com/repos/DataDog/integrations-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataDog/integrations-core/merges","archive_url":"https://api.github.com/repos/DataDog/integrations-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataDog/integrations-core/downloads","issues_url":"https://api.github.com/repos/DataDog/integrations-core/issues{/number}","pulls_url":"https://api.github.com/repos/DataDog/integrations-core/pulls{/number}","milestones_url":"https://api.github.com/repos/DataDog/integrations-core/milestones{/number}","notifications_url":"https://api.github.com/repos/DataDog/integrations-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataDog/integrations-core/labels{/name}","releases_url":"https://api.github.com/repos/DataDog/integrations-core/releases{/id}","deployments_url":"https://api.github.com/repos/DataDog/integrations-core/deployments","created_at":"2015-12-01T16:41:45Z","updated_at":"2018-09-29T17:40:57Z","pushed_at":"2018-09-29T17:42:31Z","git_url":"git://github.com/DataDog/integrations-core.git","ssh_url":"git@github.com:DataDog/integrations-core.git","clone_url":"https://github.com/DataDog/integrations-core.git","svn_url":"https://github.com/DataDog/integrations-core","homepage":"","size":29332,"stargazers_count":146,"watchers_count":146,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":326,"mirror_url":null,"archived":false,"open_issues_count":63,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":326,"open_issues":63,"watchers":146,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312"},"html":{"href":"https://github.com/DataDog/integrations-core/pull/2312"},"issue":{"href":"https://api.github.com/repos/DataDog/integrations-core/issues/2312"},"comments":{"href":"https://api.github.com/repos/DataDog/integrations-core/issues/2312/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312/comments"},"review_comment":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/2312/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/integrations-core/statuses/27bf3760944baadfe820435bd571ca9ee4eb612d"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zippolyte"}}