{"action":"created","comment":{"url":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/comments/174959234","pull_request_review_id":104411708,"id":174959234,"diff_hunk":"@@ -0,0 +1,283 @@\n+require 'rake/clean'\n+require 'pp'\n+require 'yaml'\n+require 'securerandom'\n+require 'fileutils'\n+require 'beaker-hostgenerator'\n+require 'beaker/dsl/install_utils'\n+extend Beaker::DSL::InstallUtils\n+\n+REPO_CONFIGS_DIR = 'repo-configs'\n+CLEAN.include('*.tar', REPO_CONFIGS_DIR, 'tmp', '.beaker')\n+\n+# Default test target if none specified\n+DEFAULT_MASTER_TEST_TARGET = 'redhat7-64m'\n+DEFAULT_TEST_TARGETS = \"#{DEFAULT_MASTER_TEST_TARGET}a-windows2012r2-64a\"\n+\n+USAGE = <<-EOS\n+Usage: bundle exec rake <target> [arguments]\n+\n+where <target> is one of:\n+\n+  ci:test:git\n+  ci:test:aio\n+  ci:test:gem\n+  ci:test:quick\n+\n+See `bundle exec rake -D <target>` for information about each target. Each rake\n+task accepts the following environment variables:\n+\n+REQUIRED\n+--------\n+\n+SHA:\n+    The git SHA of either the puppet-agent package or component repo must be\n+    specified depending on the target. The `git` and `gem` use the component\n+    SHA, where as `aio` and `quick` use the puppet-agent package SHA.\n+\n+OPTIONAL\n+--------\n+\n+HOSTS:\n+    The hosts to run against. Must be specified as a path to a file or a\n+    beaker-hostgenerator string. Defaults to #{DEFAULT_TEST_TARGETS}.\n+\n+    HOSTS=mynodes.yaml\n+    HOSTS=redhat7-64ma\n+\n+TESTS:\n+    A comma-delimited list of files/directories containing tests to run.\n+    Defaults to running all tests, except for `ci:test:quick` which defaults\n+    to running a predefined set of tests.\n+\n+    TESTS=tests/cycle_detection.rb\n+    TESTS=tests/pluginsync,tests/language\n+\n+OPTIONS:\n+    Additional options to pass to beaker. Defaults to ''.\n+\n+    OPTIONS='--dry-run --no-color'\n+\n+BEAKER_HOSTS:\n+    Same as HOSTS.\n+\n+TEST_TARGET:\n+    A beaker-hostgenerator string of agent-only hosts to run against.\n+    The MASTER_TEST_TARGET host will be added this list. This option is\n+    only intended to be used in CI.\n+\n+MASTER_TEST_TARGET:\n+    Override the default master test target. Should only be used with\n+    TEST_TARGET, and is only intended to be used in CI. Defaults to\n+    #{DEFAULT_MASTER_TEST_TARGET}.\n+EOS\n+\n+namespace :ci do\n+  desc \"Print usage information\"\n+  task :help do\n+    puts USAGE\n+    exit 1\n+  end\n+\n+  task :check_env do\n+    if ENV['SHA'].nil?\n+      puts \"Error: A SHA must be specified\"\n+      puts \"\\n\"\n+      puts USAGE\n+      exit 1\n+    end\n+\n+    if ENV['TESTS'].nil?\n+      ENV['TESTS'] ||= ENV['TEST']\n+      ENV['TESTS'] ||= 'tests'\n+    end\n+  end\n+\n+  task :gen_hosts do\n+    hosts =\n+      if ENV['HOSTS']\n+        ENV['HOSTS']\n+      elsif ENV['BEAKER_HOSTS']\n+        ENV['BEAKER_HOSTS']\n+      elsif env_config = ENV['CONFIG']\n+        puts 'Warning: environment variable CONFIG deprecated. Please use HOSTS to match beaker options.'\n+        env_config\n+      else\n+        # By default we assume TEST_TARGET is an agent-only string\n+        if agent_target = ENV['TEST_TARGET']\n+          master_target = ENV['MASTER_TEST_TARGET'] || DEFAULT_MASTER_TEST_TARGET\n+          \"#{master_target}-#{agent_target}\"\n+        else\n+          DEFAULT_TEST_TARGETS\n+        end\n+      end\n+\n+    if File.exists?(hosts)\n+      ENV['HOSTS'] = hosts\n+    else\n+      hosts_file = \"tmp/#{hosts}-#{SecureRandom.uuid}.yaml\"\n+      cli = BeakerHostGenerator::CLI.new([hosts, '--disable-default-role', '--osinfo-version', '1'])\n+      FileUtils.mkdir_p('tmp') # -p ignores when dir already exists\n+      File.open(hosts_file, 'w') do |fh|\n+        fh.print(cli.execute)\n+      end\n+      ENV['HOSTS'] = hosts_file\n+    end\n+  end\n+\n+  namespace :test do\n+    desc <<-EOS\n+Run a limited but representative subset of acceptance tests against puppet-agent\n+(AIO) packages. This task is intended to reduce testing time on a per-commit\n+basis.\n+\n+  $ SHA=<full sha> bundle exec rake ci:test:quick\n+\n+SHA should be the full SHA for the puppet-agent package.\n+EOS\n+    task :quick => ['ci:check_env', 'ci:gen_hosts'] do\n+      ENV['TESTS'] = get_test_sample.join(\",\")\n+      Rake::Task[\"ci:test:aio\"].invoke\n+    end","path":"tasks/ci.rake","position":141,"original_position":141,"commit_id":"429a9aae230ada07879073128397744ed29595ff","original_commit_id":"429a9aae230ada07879073128397744ed29595ff","user":{"login":"joshcooper","id":737664,"avatar_url":"https://avatars1.githubusercontent.com/u/737664?v=4","gravatar_id":"","url":"https://api.github.com/users/joshcooper","html_url":"https://github.com/joshcooper","followers_url":"https://api.github.com/users/joshcooper/followers","following_url":"https://api.github.com/users/joshcooper/following{/other_user}","gists_url":"https://api.github.com/users/joshcooper/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcooper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcooper/subscriptions","organizations_url":"https://api.github.com/users/joshcooper/orgs","repos_url":"https://api.github.com/users/joshcooper/repos","events_url":"https://api.github.com/users/joshcooper/events{/privacy}","received_events_url":"https://api.github.com/users/joshcooper/received_events","type":"User","site_admin":false},"body":"The `ci:test:quick` task is specific to the puppet component, e.g. the `get_test_sample` method returns tests that only live in puppet. How about keeping this task (and related helper methods) in puppet's Rakefile?","created_at":"2018-03-15T23:09:27Z","updated_at":"2018-03-15T23:09:27Z","html_url":"https://github.com/puppetlabs/beaker-puppet/pull/26#discussion_r174959234","pull_request_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/comments/174959234"},"html":{"href":"https://github.com/puppetlabs/beaker-puppet/pull/26#discussion_r174959234"},"pull_request":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26","id":166873134,"html_url":"https://github.com/puppetlabs/beaker-puppet/pull/26","diff_url":"https://github.com/puppetlabs/beaker-puppet/pull/26.diff","patch_url":"https://github.com/puppetlabs/beaker-puppet/pull/26.patch","issue_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/issues/26","number":26,"state":"open","locked":false,"title":"(BKR-1342) Import ci rake tasks and install utils","user":{"login":"melissa","id":4473089,"avatar_url":"https://avatars1.githubusercontent.com/u/4473089?v=4","gravatar_id":"","url":"https://api.github.com/users/melissa","html_url":"https://github.com/melissa","followers_url":"https://api.github.com/users/melissa/followers","following_url":"https://api.github.com/users/melissa/following{/other_user}","gists_url":"https://api.github.com/users/melissa/gists{/gist_id}","starred_url":"https://api.github.com/users/melissa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melissa/subscriptions","organizations_url":"https://api.github.com/users/melissa/orgs","repos_url":"https://api.github.com/users/melissa/repos","events_url":"https://api.github.com/users/melissa/events{/privacy}","received_events_url":"https://api.github.com/users/melissa/received_events","type":"User","site_admin":false},"body":"This commit moves all ci acceptance rake tasks and install/setup\r\nutilities out of the puppet repo and into the beaker-puppet repo. This\r\nwill allow us to reuse all of this code across multiple components of\r\npuppet-agent. The goal is to reduce the number of places we need to\r\nduplicate code across different code bases. With this change, any future\r\nupdates or overhauls will be consistent across all our projects.","created_at":"2018-02-02T18:34:05Z","updated_at":"2018-03-15T23:09:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8d4f37d89eae15c7141c687456b64747907ac613","assignee":null,"assignees":[],"requested_reviewers":[{"login":"tvpartytonight","id":5789610,"avatar_url":"https://avatars0.githubusercontent.com/u/5789610?v=4","gravatar_id":"","url":"https://api.github.com/users/tvpartytonight","html_url":"https://github.com/tvpartytonight","followers_url":"https://api.github.com/users/tvpartytonight/followers","following_url":"https://api.github.com/users/tvpartytonight/following{/other_user}","gists_url":"https://api.github.com/users/tvpartytonight/gists{/gist_id}","starred_url":"https://api.github.com/users/tvpartytonight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tvpartytonight/subscriptions","organizations_url":"https://api.github.com/users/tvpartytonight/orgs","repos_url":"https://api.github.com/users/tvpartytonight/repos","events_url":"https://api.github.com/users/tvpartytonight/events{/privacy}","received_events_url":"https://api.github.com/users/tvpartytonight/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26/commits","review_comments_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26/comments","review_comment_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/issues/26/comments","statuses_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/statuses/429a9aae230ada07879073128397744ed29595ff","head":{"label":"melissa:ticket/master/BKR-1342-puppet-acceptance-utilities","ref":"ticket/master/BKR-1342-puppet-acceptance-utilities","sha":"429a9aae230ada07879073128397744ed29595ff","user":{"login":"melissa","id":4473089,"avatar_url":"https://avatars1.githubusercontent.com/u/4473089?v=4","gravatar_id":"","url":"https://api.github.com/users/melissa","html_url":"https://github.com/melissa","followers_url":"https://api.github.com/users/melissa/followers","following_url":"https://api.github.com/users/melissa/following{/other_user}","gists_url":"https://api.github.com/users/melissa/gists{/gist_id}","starred_url":"https://api.github.com/users/melissa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melissa/subscriptions","organizations_url":"https://api.github.com/users/melissa/orgs","repos_url":"https://api.github.com/users/melissa/repos","events_url":"https://api.github.com/users/melissa/events{/privacy}","received_events_url":"https://api.github.com/users/melissa/received_events","type":"User","site_admin":false},"repo":{"id":96820274,"name":"beaker-puppet","full_name":"melissa/beaker-puppet","owner":{"login":"melissa","id":4473089,"avatar_url":"https://avatars1.githubusercontent.com/u/4473089?v=4","gravatar_id":"","url":"https://api.github.com/users/melissa","html_url":"https://github.com/melissa","followers_url":"https://api.github.com/users/melissa/followers","following_url":"https://api.github.com/users/melissa/following{/other_user}","gists_url":"https://api.github.com/users/melissa/gists{/gist_id}","starred_url":"https://api.github.com/users/melissa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melissa/subscriptions","organizations_url":"https://api.github.com/users/melissa/orgs","repos_url":"https://api.github.com/users/melissa/repos","events_url":"https://api.github.com/users/melissa/events{/privacy}","received_events_url":"https://api.github.com/users/melissa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/melissa/beaker-puppet","description":"Beaker's puppet-specific helper library","fork":true,"url":"https://api.github.com/repos/melissa/beaker-puppet","forks_url":"https://api.github.com/repos/melissa/beaker-puppet/forks","keys_url":"https://api.github.com/repos/melissa/beaker-puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/melissa/beaker-puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/melissa/beaker-puppet/teams","hooks_url":"https://api.github.com/repos/melissa/beaker-puppet/hooks","issue_events_url":"https://api.github.com/repos/melissa/beaker-puppet/issues/events{/number}","events_url":"https://api.github.com/repos/melissa/beaker-puppet/events","assignees_url":"https://api.github.com/repos/melissa/beaker-puppet/assignees{/user}","branches_url":"https://api.github.com/repos/melissa/beaker-puppet/branches{/branch}","tags_url":"https://api.github.com/repos/melissa/beaker-puppet/tags","blobs_url":"https://api.github.com/repos/melissa/beaker-puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/melissa/beaker-puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/melissa/beaker-puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/melissa/beaker-puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/melissa/beaker-puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/melissa/beaker-puppet/languages","stargazers_url":"https://api.github.com/repos/melissa/beaker-puppet/stargazers","contributors_url":"https://api.github.com/repos/melissa/beaker-puppet/contributors","subscribers_url":"https://api.github.com/repos/melissa/beaker-puppet/subscribers","subscription_url":"https://api.github.com/repos/melissa/beaker-puppet/subscription","commits_url":"https://api.github.com/repos/melissa/beaker-puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/melissa/beaker-puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/melissa/beaker-puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/melissa/beaker-puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/melissa/beaker-puppet/contents/{+path}","compare_url":"https://api.github.com/repos/melissa/beaker-puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/melissa/beaker-puppet/merges","archive_url":"https://api.github.com/repos/melissa/beaker-puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/melissa/beaker-puppet/downloads","issues_url":"https://api.github.com/repos/melissa/beaker-puppet/issues{/number}","pulls_url":"https://api.github.com/repos/melissa/beaker-puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/melissa/beaker-puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/melissa/beaker-puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/melissa/beaker-puppet/labels{/name}","releases_url":"https://api.github.com/repos/melissa/beaker-puppet/releases{/id}","deployments_url":"https://api.github.com/repos/melissa/beaker-puppet/deployments","created_at":"2017-07-10T20:52:46Z","updated_at":"2017-07-10T20:52:48Z","pushed_at":"2018-03-12T21:50:33Z","git_url":"git://github.com/melissa/beaker-puppet.git","ssh_url":"git@github.com:melissa/beaker-puppet.git","clone_url":"https://github.com/melissa/beaker-puppet.git","svn_url":"https://github.com/melissa/beaker-puppet","homepage":null,"size":151,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"puppetlabs:master","ref":"master","sha":"3f7bb9a8c7050e457ca87124835aadd57d96264d","user":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"repo":{"id":85002659,"name":"beaker-puppet","full_name":"puppetlabs/beaker-puppet","owner":{"login":"puppetlabs","id":234268,"avatar_url":"https://avatars0.githubusercontent.com/u/234268?v=4","gravatar_id":"","url":"https://api.github.com/users/puppetlabs","html_url":"https://github.com/puppetlabs","followers_url":"https://api.github.com/users/puppetlabs/followers","following_url":"https://api.github.com/users/puppetlabs/following{/other_user}","gists_url":"https://api.github.com/users/puppetlabs/gists{/gist_id}","starred_url":"https://api.github.com/users/puppetlabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/puppetlabs/subscriptions","organizations_url":"https://api.github.com/users/puppetlabs/orgs","repos_url":"https://api.github.com/users/puppetlabs/repos","events_url":"https://api.github.com/users/puppetlabs/events{/privacy}","received_events_url":"https://api.github.com/users/puppetlabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/puppetlabs/beaker-puppet","description":"Beaker's puppet-specific helper library","fork":false,"url":"https://api.github.com/repos/puppetlabs/beaker-puppet","forks_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/forks","keys_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/teams","hooks_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/hooks","issue_events_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/issues/events{/number}","events_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/events","assignees_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/assignees{/user}","branches_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/branches{/branch}","tags_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/tags","blobs_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/git/refs{/sha}","trees_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/statuses/{sha}","languages_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/languages","stargazers_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/stargazers","contributors_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/contributors","subscribers_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/subscribers","subscription_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/subscription","commits_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/commits{/sha}","git_commits_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/git/commits{/sha}","comments_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/comments{/number}","issue_comment_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/issues/comments{/number}","contents_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/contents/{+path}","compare_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/merges","archive_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/downloads","issues_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/issues{/number}","pulls_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls{/number}","milestones_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/milestones{/number}","notifications_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/labels{/name}","releases_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/releases{/id}","deployments_url":"https://api.github.com/repos/puppetlabs/beaker-puppet/deployments","created_at":"2017-03-14T22:18:05Z","updated_at":"2018-02-07T01:41:50Z","pushed_at":"2018-03-12T21:50:35Z","git_url":"git://github.com/puppetlabs/beaker-puppet.git","ssh_url":"git@github.com:puppetlabs/beaker-puppet.git","clone_url":"https://github.com/puppetlabs/beaker-puppet.git","svn_url":"https://github.com/puppetlabs/beaker-puppet","homepage":null,"size":133,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":15,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26"},"html":{"href":"https://github.com/puppetlabs/beaker-puppet/pull/26"},"issue":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/issues/26"},"comments":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/puppetlabs/beaker-puppet/statuses/429a9aae230ada07879073128397744ed29595ff"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"joshcooper"}}