{"action":"created","comment":{"url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments/208323537","pull_request_review_id":144107938,"id":208323537,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwODMyMzUzNw==","diff_hunk":"@@ -0,0 +1,178 @@\n+#!/usr/bin/env python\n+\n+# Copyright 2018 Google Inc. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+# http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+\"\"\"Gapic generator smoke tests.\n+\n+It generates GAPIC client libraries for a Google APIs in googleapis\n+repo. The test will fail if any generation fails.\n+\"\"\"\n+\n+import argparse\n+import logging\n+import os\n+import subprocess\n+import sys\n+\n+logger = logging.getLogger('smoketest')\n+logger.setLevel(logging.INFO)\n+\n+test_languages = {\n+    \"java\" : lambda api_name, api_version, log : runJavaTests(api_name, api_version, log),\n+    #TODO: all other languages\n+}\n+\n+test_apis = {\n+    \"pubsub\" : (\"v1\", \"google/pubsub/artman_pubsub.yaml\"),\n+    \"logging\" : (\"v2\", \"google/logging/artman_logging.yaml\"),\n+    \"speech\" : (\"v1\", \"google/cloud/speech/artman_speech_v1.yaml\"),\n+}\n+\n+def runJavaTests(api_name, api_version, log):\n+    gapic_dir = \"gapic-google-cloud-%s-%s\" % (api_name, api_version)\n+    # Run gradle test in the main java directory and also in the gapic directory.\n+    cmds = (\"%s/gradlew build test\" % os.getcwd()).split()\n+    exit_code = subprocess.call(cmds, stdout=log, stderr=log)\n+    if exit_code:\n+        return exit_code\n+\n+    cmds = (\"%s/gradlew -p %s build test\" % (os.getcwd(), gapic_dir)).split()\n+    return subprocess.call(cmds, stdout=log, stderr=log)\n+\n+def run_smoke_test(api_name, language, root_dir, log, user_config):\n+    log_file = _setup_logger(log)\n+    failure = []\n+    success = []\n+    warning = []\n+    (api_version, artman_yaml_path) = test_apis[api_name]\n+    target = language + \"_gapic\"\n+\n+    # Generate client library for an API and language.\n+    if _generate_artifact(artman_yaml_path,\n+                          target,\n+                          root_dir,\n+                          log_file,\n+                          user_config):\n+        msg = 'Failed to generate %s of %s.' % (\n+            target, artman_yaml_path)\n+        failure.append(msg)\n+        logger.info(msg)\n+    else:\n+        msg = 'Succeded to generate %s of %s.' % (\n+            target, artman_yaml_path)\n+        success.append(msg)\n+        logger.info(msg)\n+\n+        # Test the generated client library.\n+        logger.info(\"Starting testing of %s %s client library.\" %(language, api_name))\n+        cwd = os.getcwd()\n+        os.chdir(\"artman-genfiles/%s\" % language)\n+\n+        if _test_artifact(test_languages[language], api_name, api_version, log_file):\n+            msg = 'Failed to pass tests for %s library.' % (\n+                language)\n+            failure.append(msg)\n+        else:\n+            msg = 'Succeeded to pass tests for %s library.' % (\n+                language)\n+            success.append(msg)\n+        os.chdir(cwd)\n+        logger.info(msg)\n+    logger.info('================ Smoketest summary ================')\n+    logger.info('Successes:')\n+    for msg in success:\n+        logger.info(msg)\n+    logger.info('Warnings:')\n+    if warning:\n+        for msg in warning:\n+            logger.info(msg)\n+    else:\n+        logger.info(\"none.\")\n+    logger.info('Failures:')\n+    if failure:\n+        for msg in failure:\n+            logger.error(msg)\n+        sys.exit('Smoke test failed.')\n+    else:\n+        logger.info(\"none.\")\n+\n+\n+def _generate_artifact(artman_config, artifact_name, root_dir, log_file, user_config_file):\n+    with open(log_file, 'a') as log:\n+        grpc_pipeline_args = [\n+            'artman',\n+            '--local',\n+            '--verbose',\n+        ]\n+        if user_config_file:\n+            grpc_pipeline_args = grpc_pipeline_args + [\n+                '--user-config', user_config_file,]\n+        grpc_pipeline_args = grpc_pipeline_args + [\n+            '--config', os.path.join(root_dir, artman_config),\n+            '--root-dir', root_dir,\n+            'generate', artifact_name\n+        ]\n+        logger.info(\"Start artifact generation for %s of %s: %s\" %","path":"gapic_smoketest.py","position":127,"original_position":127,"commit_id":"85ee2d3e40ceb16f7227f397c1ca9fbad5d93979","original_commit_id":"85ee2d3e40ceb16f7227f397c1ca9fbad5d93979","user":{"login":"landrito","id":8572251,"node_id":"MDQ6VXNlcjg1NzIyNTE=","avatar_url":"https://avatars0.githubusercontent.com/u/8572251?v=4","gravatar_id":"","url":"https://api.github.com/users/landrito","html_url":"https://github.com/landrito","followers_url":"https://api.github.com/users/landrito/followers","following_url":"https://api.github.com/users/landrito/following{/other_user}","gists_url":"https://api.github.com/users/landrito/gists{/gist_id}","starred_url":"https://api.github.com/users/landrito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landrito/subscriptions","organizations_url":"https://api.github.com/users/landrito/orgs","repos_url":"https://api.github.com/users/landrito/repos","events_url":"https://api.github.com/users/landrito/events{/privacy}","received_events_url":"https://api.github.com/users/landrito/received_events","type":"User","site_admin":false},"body":"nit: s/Start artifact generation for/Generate artifact","created_at":"2018-08-07T17:45:56Z","updated_at":"2018-08-07T17:49:52Z","html_url":"https://github.com/googleapis/gapic-generator/pull/2175#discussion_r208323537","pull_request_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments/208323537"},"html":{"href":"https://github.com/googleapis/gapic-generator/pull/2175#discussion_r208323537"},"pull_request":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175"}}},"pull_request":{"url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175","id":205197022,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1MTk3MDIy","html_url":"https://github.com/googleapis/gapic-generator/pull/2175","diff_url":"https://github.com/googleapis/gapic-generator/pull/2175.diff","patch_url":"https://github.com/googleapis/gapic-generator/pull/2175.patch","issue_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/2175","number":2175,"state":"open","locked":false,"title":"Test generated java Pubsub, Logging, and Speech clients","user":{"login":"andreamlin","id":4016818,"node_id":"MDQ6VXNlcjQwMTY4MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/4016818?v=4","gravatar_id":"","url":"https://api.github.com/users/andreamlin","html_url":"https://github.com/andreamlin","followers_url":"https://api.github.com/users/andreamlin/followers","following_url":"https://api.github.com/users/andreamlin/following{/other_user}","gists_url":"https://api.github.com/users/andreamlin/gists{/gist_id}","starred_url":"https://api.github.com/users/andreamlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreamlin/subscriptions","organizations_url":"https://api.github.com/users/andreamlin/orgs","repos_url":"https://api.github.com/users/andreamlin/repos","events_url":"https://api.github.com/users/andreamlin/events{/privacy}","received_events_url":"https://api.github.com/users/andreamlin/received_events","type":"User","site_admin":false},"body":"Run generated unit tests for java clients for Pubsub, Logging, and Speech.\r\n\r\nUsing artman to handle generation of descriptor file and call local version of toolkit.\r\n\r\nVerified in https://circleci.com/gh/googleapis/gapic-generator/136#artifacts/containers/0 that artman uses the PR's version of toolkit, not the docker image's version of toolkit. That build rightly failed during client generation because the entire contents of .../java/main.snip was replaced with \"hola\" (see [build log](https://136-56533838-gh.circle-artifacts.com/0/tmp/reports/smoketest.log)).","created_at":"2018-07-31T18:08:03Z","updated_at":"2018-08-07T17:49:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e456acec79fb833e55f41aa55a4cf513c3e31345","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175/commits","review_comments_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175/comments","review_comment_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/2175/comments","statuses_url":"https://api.github.com/repos/googleapis/gapic-generator/statuses/85ee2d3e40ceb16f7227f397c1ca9fbad5d93979","head":{"label":"andreamlin:circle_ci_smoketest","ref":"circle_ci_smoketest","sha":"85ee2d3e40ceb16f7227f397c1ca9fbad5d93979","user":{"login":"andreamlin","id":4016818,"node_id":"MDQ6VXNlcjQwMTY4MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/4016818?v=4","gravatar_id":"","url":"https://api.github.com/users/andreamlin","html_url":"https://github.com/andreamlin","followers_url":"https://api.github.com/users/andreamlin/followers","following_url":"https://api.github.com/users/andreamlin/following{/other_user}","gists_url":"https://api.github.com/users/andreamlin/gists{/gist_id}","starred_url":"https://api.github.com/users/andreamlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreamlin/subscriptions","organizations_url":"https://api.github.com/users/andreamlin/orgs","repos_url":"https://api.github.com/users/andreamlin/repos","events_url":"https://api.github.com/users/andreamlin/events{/privacy}","received_events_url":"https://api.github.com/users/andreamlin/received_events","type":"User","site_admin":false},"repo":{"id":90909131,"node_id":"MDEwOlJlcG9zaXRvcnk5MDkwOTEzMQ==","name":"toolkit","full_name":"andreamlin/toolkit","owner":{"login":"andreamlin","id":4016818,"node_id":"MDQ6VXNlcjQwMTY4MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/4016818?v=4","gravatar_id":"","url":"https://api.github.com/users/andreamlin","html_url":"https://github.com/andreamlin","followers_url":"https://api.github.com/users/andreamlin/followers","following_url":"https://api.github.com/users/andreamlin/following{/other_user}","gists_url":"https://api.github.com/users/andreamlin/gists{/gist_id}","starred_url":"https://api.github.com/users/andreamlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreamlin/subscriptions","organizations_url":"https://api.github.com/users/andreamlin/orgs","repos_url":"https://api.github.com/users/andreamlin/repos","events_url":"https://api.github.com/users/andreamlin/events{/privacy}","received_events_url":"https://api.github.com/users/andreamlin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/andreamlin/toolkit","description":null,"fork":true,"url":"https://api.github.com/repos/andreamlin/toolkit","forks_url":"https://api.github.com/repos/andreamlin/toolkit/forks","keys_url":"https://api.github.com/repos/andreamlin/toolkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andreamlin/toolkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andreamlin/toolkit/teams","hooks_url":"https://api.github.com/repos/andreamlin/toolkit/hooks","issue_events_url":"https://api.github.com/repos/andreamlin/toolkit/issues/events{/number}","events_url":"https://api.github.com/repos/andreamlin/toolkit/events","assignees_url":"https://api.github.com/repos/andreamlin/toolkit/assignees{/user}","branches_url":"https://api.github.com/repos/andreamlin/toolkit/branches{/branch}","tags_url":"https://api.github.com/repos/andreamlin/toolkit/tags","blobs_url":"https://api.github.com/repos/andreamlin/toolkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andreamlin/toolkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andreamlin/toolkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/andreamlin/toolkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andreamlin/toolkit/statuses/{sha}","languages_url":"https://api.github.com/repos/andreamlin/toolkit/languages","stargazers_url":"https://api.github.com/repos/andreamlin/toolkit/stargazers","contributors_url":"https://api.github.com/repos/andreamlin/toolkit/contributors","subscribers_url":"https://api.github.com/repos/andreamlin/toolkit/subscribers","subscription_url":"https://api.github.com/repos/andreamlin/toolkit/subscription","commits_url":"https://api.github.com/repos/andreamlin/toolkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/andreamlin/toolkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/andreamlin/toolkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/andreamlin/toolkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/andreamlin/toolkit/contents/{+path}","compare_url":"https://api.github.com/repos/andreamlin/toolkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andreamlin/toolkit/merges","archive_url":"https://api.github.com/repos/andreamlin/toolkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andreamlin/toolkit/downloads","issues_url":"https://api.github.com/repos/andreamlin/toolkit/issues{/number}","pulls_url":"https://api.github.com/repos/andreamlin/toolkit/pulls{/number}","milestones_url":"https://api.github.com/repos/andreamlin/toolkit/milestones{/number}","notifications_url":"https://api.github.com/repos/andreamlin/toolkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andreamlin/toolkit/labels{/name}","releases_url":"https://api.github.com/repos/andreamlin/toolkit/releases{/id}","deployments_url":"https://api.github.com/repos/andreamlin/toolkit/deployments","created_at":"2017-05-10T21:16:54Z","updated_at":"2018-08-04T00:19:12Z","pushed_at":"2018-08-07T16:17:17Z","git_url":"git://github.com/andreamlin/toolkit.git","ssh_url":"git@github.com:andreamlin/toolkit.git","clone_url":"https://github.com/andreamlin/toolkit.git","svn_url":"https://github.com/andreamlin/toolkit","homepage":null,"size":22509,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"googleapis:master","ref":"master","sha":"a7114fbfebf39d7bbfeedd05cf7853149894cf01","user":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"repo":{"id":56533838,"node_id":"MDEwOlJlcG9zaXRvcnk1NjUzMzgzOA==","name":"gapic-generator","full_name":"googleapis/gapic-generator","owner":{"login":"googleapis","id":16785467,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Nzg1NDY3","avatar_url":"https://avatars3.githubusercontent.com/u/16785467?v=4","gravatar_id":"","url":"https://api.github.com/users/googleapis","html_url":"https://github.com/googleapis","followers_url":"https://api.github.com/users/googleapis/followers","following_url":"https://api.github.com/users/googleapis/following{/other_user}","gists_url":"https://api.github.com/users/googleapis/gists{/gist_id}","starred_url":"https://api.github.com/users/googleapis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/googleapis/subscriptions","organizations_url":"https://api.github.com/users/googleapis/orgs","repos_url":"https://api.github.com/users/googleapis/repos","events_url":"https://api.github.com/users/googleapis/events{/privacy}","received_events_url":"https://api.github.com/users/googleapis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/googleapis/gapic-generator","description":"Tools for generating API client libraries from API Service Configuration descriptions.","fork":false,"url":"https://api.github.com/repos/googleapis/gapic-generator","forks_url":"https://api.github.com/repos/googleapis/gapic-generator/forks","keys_url":"https://api.github.com/repos/googleapis/gapic-generator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/googleapis/gapic-generator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/googleapis/gapic-generator/teams","hooks_url":"https://api.github.com/repos/googleapis/gapic-generator/hooks","issue_events_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/events{/number}","events_url":"https://api.github.com/repos/googleapis/gapic-generator/events","assignees_url":"https://api.github.com/repos/googleapis/gapic-generator/assignees{/user}","branches_url":"https://api.github.com/repos/googleapis/gapic-generator/branches{/branch}","tags_url":"https://api.github.com/repos/googleapis/gapic-generator/tags","blobs_url":"https://api.github.com/repos/googleapis/gapic-generator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/googleapis/gapic-generator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/googleapis/gapic-generator/git/refs{/sha}","trees_url":"https://api.github.com/repos/googleapis/gapic-generator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/googleapis/gapic-generator/statuses/{sha}","languages_url":"https://api.github.com/repos/googleapis/gapic-generator/languages","stargazers_url":"https://api.github.com/repos/googleapis/gapic-generator/stargazers","contributors_url":"https://api.github.com/repos/googleapis/gapic-generator/contributors","subscribers_url":"https://api.github.com/repos/googleapis/gapic-generator/subscribers","subscription_url":"https://api.github.com/repos/googleapis/gapic-generator/subscription","commits_url":"https://api.github.com/repos/googleapis/gapic-generator/commits{/sha}","git_commits_url":"https://api.github.com/repos/googleapis/gapic-generator/git/commits{/sha}","comments_url":"https://api.github.com/repos/googleapis/gapic-generator/comments{/number}","issue_comment_url":"https://api.github.com/repos/googleapis/gapic-generator/issues/comments{/number}","contents_url":"https://api.github.com/repos/googleapis/gapic-generator/contents/{+path}","compare_url":"https://api.github.com/repos/googleapis/gapic-generator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/googleapis/gapic-generator/merges","archive_url":"https://api.github.com/repos/googleapis/gapic-generator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/googleapis/gapic-generator/downloads","issues_url":"https://api.github.com/repos/googleapis/gapic-generator/issues{/number}","pulls_url":"https://api.github.com/repos/googleapis/gapic-generator/pulls{/number}","milestones_url":"https://api.github.com/repos/googleapis/gapic-generator/milestones{/number}","notifications_url":"https://api.github.com/repos/googleapis/gapic-generator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/googleapis/gapic-generator/labels{/name}","releases_url":"https://api.github.com/repos/googleapis/gapic-generator/releases{/id}","deployments_url":"https://api.github.com/repos/googleapis/gapic-generator/deployments","created_at":"2016-04-18T18:58:04Z","updated_at":"2018-08-07T01:03:39Z","pushed_at":"2018-08-07T16:17:19Z","git_url":"git://github.com/googleapis/gapic-generator.git","ssh_url":"git@github.com:googleapis/gapic-generator.git","clone_url":"https://github.com/googleapis/gapic-generator.git","svn_url":"https://github.com/googleapis/gapic-generator","homepage":"","size":22569,"stargazers_count":49,"watchers_count":49,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":60,"mirror_url":null,"archived":false,"open_issues_count":166,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":60,"open_issues":166,"watchers":49,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175"},"html":{"href":"https://github.com/googleapis/gapic-generator/pull/2175"},"issue":{"href":"https://api.github.com/repos/googleapis/gapic-generator/issues/2175"},"comments":{"href":"https://api.github.com/repos/googleapis/gapic-generator/issues/2175/comments"},"review_comments":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175/comments"},"review_comment":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/googleapis/gapic-generator/pulls/2175/commits"},"statuses":{"href":"https://api.github.com/repos/googleapis/gapic-generator/statuses/85ee2d3e40ceb16f7227f397c1ca9fbad5d93979"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"landrito"}}