{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/comments/70047762","id":70047762,"diff_hunk":"@@ -0,0 +1,125 @@\n+/*\n+ * The MIT License\n+ *\n+ * Copyright (c) 2016, CloudBees, Inc.\n+ *\n+ * Permission is hereby granted, free of charge, to any person obtaining a copy\n+ * of this software and associated documentation files (the \"Software\"), to deal\n+ * in the Software without restriction, including without limitation the rights\n+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+ * copies of the Software, and to permit persons to whom the Software is\n+ * furnished to do so, subject to the following conditions:\n+ *\n+ * The above copyright notice and this permission notice shall be included in\n+ * all copies or substantial portions of the Software.\n+ *\n+ * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n+ * THE SOFTWARE.\n+ */\n+\n+/** Do not forget to change this */\n+def version = '1.0'\n+\n+/**\n+ * Provides split branches for the Acceptance test harness.\n+ * Split size should be 7 + cucumber unless there are no test cases from previous runs to base the split on (then 1 + cucumber).\n+ * Assumes that {@link lib.functions#stashJenkinsWar} and {@link #stashAth()} has been run before this.\n+ *\n+ * @param functions lib/functions.groovy\n+ * @param nodeLabel the label to run the tests on, default = hi-speed\n+ * @param archiveJUnitReports if all the junit xml reports should be archived in a zip file for later, default = false\n+ * @param rerunFailingTestsCount number that enables rerun of failing tests. tests will be run until they pass or the number of reruns has been exhausted, default = 0 (rerun disabled)\n+ * @param parallelCount number of parallel branches to create. Default = 7\n+ * @return the \"steps\" to put inside a parallel step.\n+ */\n+Map getAthBranches(def functions, String nodeLabel = null, boolean archiveJUnitReports = false, int rerunFailingTestsCount = 0,\n+                   int parallelCount = 7) {\n+    if (nodeLabel == null) {\n+        nodeLabel = athLabel()\n+    }\n+\n+    def splits = splitTests([$class: 'CountDrivenParallelism', size: parallelCount])\n+\n+    String mvnFlags = \"-Dsurefire.rerunFailingTestsCount=${rerunFailingTestsCount}\"\n+\n+    def branches = [:]\n+\n+    for (int i = 0; i < splits.size(); i++) {\n+        def exclusions = new ArrayList(splits.get(i))\n+\n+        final String splitId = 'split-' + i\n+        branches[\"ath-split-${i}\"] = {\n+            this.singleAthBranch(functions, exclusions, mvnFlags + \" -DskipCucumberTests=true\", splitId, nodeLabel, archiveJUnitReports)\n+        }\n+    }\n+\n+    branches['ath-split-cucumber'] = {\n+        this.singleAthBranch(functions, null, mvnFlags + \" -Dcucumber.test=features\", 'split-cucumber', nodeLabel, archiveJUnitReports)\n+    }\n+    return branches;\n+}\n+\n+void singleAthBranch(def functions,\n+                     def exclusions,\n+                     String mvnProps,\n+                     String splitId,\n+                     String nodeLabel,\n+                     boolean archiveJUnitReports = false) {\n+    if (nodeLabel == null) {\n+        nodeLabel = athLabel()\n+    }\n+    \n+    functions.timestampedNode(nodeLabel) {","path":"lib/ath.groovy","position":77,"original_position":77,"commit_id":"f6296ee909defc7f029ce4f5ca8930dfd1a20178","original_commit_id":"f6296ee909defc7f029ce4f5ca8930dfd1a20178","user":{"login":"jtnord","id":494726,"avatar_url":"https://avatars.githubusercontent.com/u/494726?v=3","gravatar_id":"","url":"https://api.github.com/users/jtnord","html_url":"https://github.com/jtnord","followers_url":"https://api.github.com/users/jtnord/followers","following_url":"https://api.github.com/users/jtnord/following{/other_user}","gists_url":"https://api.github.com/users/jtnord/gists{/gist_id}","starred_url":"https://api.github.com/users/jtnord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtnord/subscriptions","organizations_url":"https://api.github.com/users/jtnord/orgs","repos_url":"https://api.github.com/users/jtnord/repos","events_url":"https://api.github.com/users/jtnord/events{/privacy}","received_events_url":"https://api.github.com/users/jtnord/received_events","type":"User","site_admin":false},"body":"this function can die.  Timestamper can now timestamp the whole build and not just nodes (as of 1.8) - so do this around the main flow.\r\n(not sure what happens if you have a timestamper for the whole build, and a timestamper for a node...)","created_at":"2016-07-08T09:25:00Z","updated_at":"2016-07-08T09:25:00Z","html_url":"https://github.com/jenkinsci/jenkins-project-pipeline-lib/pull/1#discussion_r70047762","pull_request_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/comments/70047762"},"html":{"href":"https://github.com/jenkinsci/jenkins-project-pipeline-lib/pull/1#discussion_r70047762"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1","id":76686474,"html_url":"https://github.com/jenkinsci/jenkins-project-pipeline-lib/pull/1","diff_url":"https://github.com/jenkinsci/jenkins-project-pipeline-lib/pull/1.diff","patch_url":"https://github.com/jenkinsci/jenkins-project-pipeline-lib/pull/1.patch","issue_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/issues/1","number":1,"state":"open","locked":false,"title":"First draft of common functions and ATH libs.","user":{"login":"abayer","id":120218,"avatar_url":"https://avatars.githubusercontent.com/u/120218?v=3","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"body":"These are based on internal libraries at CloudBees that we've been using for our builds, specifically those around the ATH. I'm putting this in a distinct repository so it can be versioned, tagged, checked out, etc by multiple jobs.\r\n\r\ncc @jenkinsci/code-reviewers and @reviewbybees, esp @jtnord","created_at":"2016-07-08T00:30:05Z","updated_at":"2016-07-08T09:25:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a5fdc8499b2e8f3e5ff33787b620a83dc244285d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/issues/1/comments","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/statuses/f6296ee909defc7f029ce4f5ca8930dfd1a20178","head":{"label":"abayer:initial-libs","ref":"initial-libs","sha":"f6296ee909defc7f029ce4f5ca8930dfd1a20178","user":{"login":"abayer","id":120218,"avatar_url":"https://avatars.githubusercontent.com/u/120218?v=3","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"repo":{"id":62846425,"name":"jenkins-project-pipeline-lib","full_name":"abayer/jenkins-project-pipeline-lib","owner":{"login":"abayer","id":120218,"avatar_url":"https://avatars.githubusercontent.com/u/120218?v=3","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/abayer/jenkins-project-pipeline-lib","description":"Pipeline libraries used for builds within the Jenkins project","fork":true,"url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib","forks_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/forks","keys_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/teams","hooks_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/hooks","issue_events_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/issues/events{/number}","events_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/events","assignees_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/assignees{/user}","branches_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/branches{/branch}","tags_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/tags","blobs_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/languages","stargazers_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/stargazers","contributors_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/contributors","subscribers_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/subscribers","subscription_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/subscription","commits_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/contents/{+path}","compare_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/merges","archive_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/downloads","issues_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/issues{/number}","pulls_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/labels{/name}","releases_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/releases{/id}","deployments_url":"https://api.github.com/repos/abayer/jenkins-project-pipeline-lib/deployments","created_at":"2016-07-08T00:25:34Z","updated_at":"2016-07-08T00:25:26Z","pushed_at":"2016-07-08T00:28:54Z","git_url":"git://github.com/abayer/jenkins-project-pipeline-lib.git","ssh_url":"git@github.com:abayer/jenkins-project-pipeline-lib.git","clone_url":"https://github.com/abayer/jenkins-project-pipeline-lib.git","svn_url":"https://github.com/abayer/jenkins-project-pipeline-lib","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"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":"jenkinsci:master","ref":"master","sha":"792f06602db73998d7d76590f98473624e6fa0d9","user":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":62846418,"name":"jenkins-project-pipeline-lib","full_name":"jenkinsci/jenkins-project-pipeline-lib","owner":{"login":"jenkinsci","id":107424,"avatar_url":"https://avatars.githubusercontent.com/u/107424?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkinsci/jenkins-project-pipeline-lib","description":"Pipeline libraries used for builds within the Jenkins project","fork":false,"url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib","forks_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/forks","keys_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/teams","hooks_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/events","assignees_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/tags","blobs_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/subscription","commits_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/merges","archive_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/downloads","issues_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/deployments","created_at":"2016-07-08T00:25:26Z","updated_at":"2016-07-08T00:25:26Z","pushed_at":"2016-07-08T00:30:06Z","git_url":"git://github.com/jenkinsci/jenkins-project-pipeline-lib.git","ssh_url":"git@github.com:jenkinsci/jenkins-project-pipeline-lib.git","clone_url":"https://github.com/jenkinsci/jenkins-project-pipeline-lib.git","svn_url":"https://github.com/jenkinsci/jenkins-project-pipeline-lib","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1"},"html":{"href":"https://github.com/jenkinsci/jenkins-project-pipeline-lib/pull/1"},"issue":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/issues/1"},"comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/jenkins-project-pipeline-lib/statuses/f6296ee909defc7f029ce4f5ca8930dfd1a20178"}}}}
{"actor":{"display_login":"jtnord"}}