Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions tests/test_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,29 @@ def test_slow_docs_build():
)


def test_slow_docs_build_series_branch():
github_requests, jenkins_requests = _trigger_build(
repo="core",
prs={"documentation": 42, "core": 43},
comment="@cf-bottom build yeah?",
base_branch="3.27.x",
)
# Docs jobs drop the .x suffix, BASE_BRANCH keeps it
jenkins_requests.post.assert_called_once_with(
"https://ci.cfengine.com/job/build-and-deploy-docs-3.27/buildWithParameters/api/json",
data={
"CORE_REV": "43",
"DOCS_REV": "42",
"BASE_BRANCH": "3.27.x",
"BUILD_DESC": "Test PR Title @test-trusted-author (core#43 documentation#42 3.27.x)",
"DOCS_BRANCH": "pr",
"CONFIGURATIONS_FILTER": "",
},
headers={"Jenkins-Crumb": "test-jenkins-crumb"},
auth=ANY,
)


from unittest.mock import MagicMock, patch, ANY
from tom.bot import Bot
from tom.jenkins import Jenkins
Expand Down
8 changes: 5 additions & 3 deletions tom/jenkins.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ def trigger(
if repo in ["core", "enterprise", "nova", "masterfiles"]
)
job = "pr-pipeline"
# Docs jobs are named after docs branches, e.g. 3.27 (not 3.27.x)
docs_branch = branch[:-2] if branch.endswith(".x") else branch
if docs:
if need_slow_build:
job = "build-and-deploy-docs-{}".format(branch)
job = "build-and-deploy-docs-{}".format(docs_branch)
no_tests = True # but allow for override if specified
else:
job = "fast-build-and-deploy-docs-{}".format(branch)
job = "fast-build-and-deploy-docs-{}".format(docs_branch)
else:
if "documentation" in prs.keys():
job = "build-and-deploy-docs-{}".format(branch)
job = "build-and-deploy-docs-{}".format(docs_branch)
no_tests = False
# clear configurations filter out so all default packages are generated and tested
params["CONFIGURATIONS_FILTER"] = ""
Expand Down
Loading