{"action":"created","comment":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments/199337517","pull_request_review_id":133441889,"id":199337517,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5OTMzNzUxNw==","diff_hunk":"@@ -0,0 +1,56 @@\n+# (C) Datadog, Inc. 2018\n+# All rights reserved\n+# Licensed under a 3-clause BSD style license (see LICENSE)\n+\n+from mock import patch\n+\n+from datadog_checks.nagios import Nagios\n+from .common import CHECK_NAME, CUSTOM_TAGS\n+\n+# Random test values\n+METRIC_NAME = 'nagios.metric_name'\n+METRIC_VALUE = 42\n+METRIC_TAGS = CUSTOM_TAGS\n+METRIC_TIMESTAMP = 1337404007\n+\n+\n+class TestGaugeWrapper:\n+\n+    def test_gauge_without_timestamp(self):\n+        \"\"\"\n+        Test the 'gauge' wrapper to see if it strips the 'timestamp' arg for gauge functions that do not accept it\n+        \"\"\"\n+\n+        def timestamp_excluded_gauge(self, name, value, tags=None):\n+            \"\"\"\n+            A gauge function that does not accept the 'timestamp' argument","path":"nagios/test/test_unit.py","position":26,"original_position":26,"commit_id":"d8dbd12e29e62dd7d05f1ddabe5fc9e6d5924ef9","original_commit_id":"d8dbd12e29e62dd7d05f1ddabe5fc9e6d5924ef9","user":{"login":"rishabh","id":7551150,"node_id":"MDQ6VXNlcjc1NTExNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7551150?v=4","gravatar_id":"","url":"https://api.github.com/users/rishabh","html_url":"https://github.com/rishabh","followers_url":"https://api.github.com/users/rishabh/followers","following_url":"https://api.github.com/users/rishabh/following{/other_user}","gists_url":"https://api.github.com/users/rishabh/gists{/gist_id}","starred_url":"https://api.github.com/users/rishabh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rishabh/subscriptions","organizations_url":"https://api.github.com/users/rishabh/orgs","repos_url":"https://api.github.com/users/rishabh/repos","events_url":"https://api.github.com/users/rishabh/events{/privacy}","received_events_url":"https://api.github.com/users/rishabh/received_events","type":"User","site_admin":false},"body":"I'm not sure if there's a better way to test this, I previously allowed this function to receive `**kwargs`, but it got messy when it came time to assert. This way, however, there'll be an exception that gets raised if this is called with a `timestamp`.","created_at":"2018-07-01T03:56:02Z","updated_at":"2018-07-01T03:56:02Z","html_url":"https://github.com/DataDog/integrations-core/pull/1822#discussion_r199337517","pull_request_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/1822","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/comments/199337517"},"html":{"href":"https://github.com/DataDog/integrations-core/pull/1822#discussion_r199337517"},"pull_request":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/1822"}}},"pull_request":{"url":"https://api.github.com/repos/DataDog/integrations-core/pulls/1822","id":197852683,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3ODUyNjgz","html_url":"https://github.com/DataDog/integrations-core/pull/1822","diff_url":"https://github.com/DataDog/integrations-core/pull/1822.diff","patch_url":"https://github.com/DataDog/integrations-core/pull/1822.patch","issue_url":"https://api.github.com/repos/DataDog/integrations-core/issues/1822","number":1822,"state":"open","locked":false,"title":"Add Agent 6 compatibility by not sending timestamps for gauge metrics (Agent 6 only)","user":{"login":"rishabh","id":7551150,"node_id":"MDQ6VXNlcjc1NTExNTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7551150?v=4","gravatar_id":"","url":"https://api.github.com/users/rishabh","html_url":"https://github.com/rishabh","followers_url":"https://api.github.com/users/rishabh/followers","following_url":"https://api.github.com/users/rishabh/following{/other_user}","gists_url":"https://api.github.com/users/rishabh/gists{/gist_id}","starred_url":"https://api.github.com/users/rishabh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rishabh/subscriptions","organizations_url":"https://api.github.com/users/rishabh/orgs","repos_url":"https://api.github.com/users/rishabh/repos","events_url":"https://api.github.com/users/rishabh/events{/privacy}","received_events_url":"https://api.github.com/users/rishabh/received_events","type":"User","site_admin":false},"body":"### What does this PR do?\r\n\r\nThis PR adds a wrapper function for `gauge(...)` because Agent 6 does not allow sending custom timestamps with gauge metrics.\r\n\r\n### Motivation\r\n\r\nThis allows users to use Nagios on Agent 6. This PR also ports Nagios to pytest.\r\n\r\n### Review checklist\r\n\r\n- [x] PR has a [meaningful title](https://github.com/DataDog/integrations-core/blob/master/CONTRIBUTING.md#pull-request-title) or PR has the `no-changelog` label attached\r\n- [x] Feature or bugfix has tests\r\n- [x] Git history is clean\r\n- [x] If PR impacts documentation, docs team has been notified or an issue has been opened on the [documentation repo](https://github.com/DataDog/documentation/issues/new)\r\n\r\n### Additional Notes\r\n\r\n","created_at":"2018-06-27T21:02:21Z","updated_at":"2018-07-01T03:56:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"789c6a8a4ea57ad93eb7ffb4400e723954ab3e42","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":937216600,"node_id":"MDU6TGFiZWw5MzcyMTY2MDA=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/changelog/Fixed","name":"changelog/Fixed","color":"f2983e","default":false},{"id":936574455,"node_id":"MDU6TGFiZWw5MzY1NzQ0NTU=","url":"https://api.github.com/repos/DataDog/integrations-core/labels/integration/nagios","name":"integration/nagios","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/1822/commits","review_comments_url":"https://api.github.com/repos/DataDog/integrations-core/pulls/1822/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/1822/comments","statuses_url":"https://api.github.com/repos/DataDog/integrations-core/statuses/d8dbd12e29e62dd7d05f1ddabe5fc9e6d5924ef9","head":{"label":"DataDog:rish/nagios-error","ref":"rish/nagios-error","sha":"d8dbd12e29e62dd7d05f1ddabe5fc9e6d5924ef9","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","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},"private":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-06-30T23:13:15Z","pushed_at":"2018-07-01T03:53:23Z","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":null,"size":11979,"stargazers_count":125,"watchers_count":125,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":266,"mirror_url":null,"archived":false,"open_issues_count":55,"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":266,"open_issues":55,"watchers":125,"default_branch":"master"}},"base":{"label":"DataDog:master","ref":"master","sha":"d1fdf9c5a07a3d3a800214ac31d64b5f9df94d83","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","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},"private":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-06-30T23:13:15Z","pushed_at":"2018-07-01T03:53:23Z","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":null,"size":11979,"stargazers_count":125,"watchers_count":125,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":266,"mirror_url":null,"archived":false,"open_issues_count":55,"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":266,"open_issues":55,"watchers":125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/1822"},"html":{"href":"https://github.com/DataDog/integrations-core/pull/1822"},"issue":{"href":"https://api.github.com/repos/DataDog/integrations-core/issues/1822"},"comments":{"href":"https://api.github.com/repos/DataDog/integrations-core/issues/1822/comments"},"review_comments":{"href":"https://api.github.com/repos/DataDog/integrations-core/pulls/1822/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/1822/commits"},"statuses":{"href":"https://api.github.com/repos/DataDog/integrations-core/statuses/d8dbd12e29e62dd7d05f1ddabe5fc9e6d5924ef9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"rishabh"}}