summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRotaru Sergey <badwings@yandex.ru>2020-06-14 11:57:26 +0300
committerRotaru Sergey <badwings@yandex.ru>2020-06-14 12:28:10 +0300
commit4e15ad0536992e99935c16862f0c5b64006062c5 (patch)
tree4362e72fa1886b37d01b6c013149043dd3e185db /tests
parent6c55bc78212536a9fe59f35b4c199ebe2c305844 (diff)
downloadpython-jenkins-job-builder-4e15ad0536992e99935c16862f0c5b64006062c5.tar.gz
python-jenkins-job-builder-4e15ad0536992e99935c16862f0c5b64006062c5.tar.xz
python-jenkins-job-builder-4e15ad0536992e99935c16862f0c5b64006062c5.zip
Implement disable discover_pr_origin
In my opinion the best choise for default value of discover_pr_origion is not specified(None value) like it is done for bitbucket scm. Currently there is no way to disable this option for github scm. Added false value as one of valid value for this option, like is done for discover-pr-fork-strategy. In fact any of yaml specification false implementation should work. Change-Id: Ibc26d6b5c39b5455160ba5c84be99575b79fc102
Diffstat (limited to 'tests')
-rw-r--r--tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.xml59
-rw-r--r--tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.yaml7
2 files changed, 66 insertions, 0 deletions
diff --git a/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.xml b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.xml
new file mode 100644
index 00000000..d700a816
--- /dev/null
+++ b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.xml
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject plugin="workflow-multibranch">
+ <properties/>
+ <views>
+ <hudson.model.AllView>
+ <name>All</name>
+ <filterExecutors>false</filterExecutors>
+ <filterQueue>false</filterQueue>
+ <properties class="hudson.model.View$PropertyList"/>
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../../.."/>
+ </hudson.model.AllView>
+ </views>
+ <viewsTabBar class="hudson.views.DefaultViewsTabBar"/>
+ <folderViews class="jenkins.branch.MultiBranchProjectViewHolder" plugin="branch-api">
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
+ </folderViews>
+ <healthMetrics>
+ <com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric plugin="cloudbees-folder">
+ <nonRecursive>false</nonRecursive>
+ </com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric>
+ </healthMetrics>
+ <icon class="jenkins.branch.MetadataActionFolderIcon" plugin="branch-api">
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
+ </icon>
+ <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder">
+ <pruneDeadBranches>true</pruneDeadBranches>
+ <daysToKeep>-1</daysToKeep>
+ <numToKeep>-1</numToKeep>
+ </orphanedItemStrategy>
+ <triggers/>
+ <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api">
+ <data>
+ <jenkins.branch.BranchSource>
+ <source class="org.jenkinsci.plugins.github_branch_source.GitHubSCMSource" plugin="github-branch-source">
+ <id>gh-johndoe-foo</id>
+ <repoOwner>johndoe</repoOwner>
+ <repository>foo</repository>
+ <traits>
+ <org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
+ <strategyId>1</strategyId>
+ </org.jenkinsci.plugins.github__branch__source.BranchDiscoveryTrait>
+ <org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait>
+ <strategyId>1</strategyId>
+ <trust class="org.jenkinsci.plugins.github_branch_source.ForkPullRequestDiscoveryTrait$TrustContributors"/>
+ </org.jenkinsci.plugins.github__branch__source.ForkPullRequestDiscoveryTrait>
+ <jenkins.plugins.git.traits.WipeWorkspaceTrait>
+ <extension class="hudson.plugins.git.extensions.impl.WipeWorkspace"/>
+ </jenkins.plugins.git.traits.WipeWorkspaceTrait>
+ </traits>
+ </source>
+ </jenkins.branch.BranchSource>
+ </data>
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
+ </sources>
+ <factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
+ <scriptPath>Jenkinsfile</scriptPath>
+ </factory>
+</org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>
diff --git a/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.yaml b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.yaml
new file mode 100644
index 00000000..7852137e
--- /dev/null
+++ b/tests/multibranch/fixtures/scm_github_no_origin_pr_discovery.yaml
@@ -0,0 +1,7 @@
+name: 'demo-multibranch-github-no-fork-prs'
+project-type: multibranch
+scm:
+ - github:
+ repo: 'foo'
+ repo-owner: 'johndoe'
+ discover-pr-origin: no