aboutsummaryrefslogtreecommitdiffstats
path: root/test/release
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-06-16 15:09:34 +1200
committerAldo Cortesi <aldo@nullcube.com>2018-06-16 15:09:34 +1200
commit9463fee76488c41dcce995999dd98c190000ded6 (patch)
tree9c18fc716e4e88993c7d6134ca1565ac9e2a2e55 /test/release
parent94a22b87954af42d552d2d94a845e764df0d4587 (diff)
downloadmitmproxy-9463fee76488c41dcce995999dd98c190000ded6.tar.gz
mitmproxy-9463fee76488c41dcce995999dd98c190000ded6.tar.bz2
mitmproxy-9463fee76488c41dcce995999dd98c190000ded6.zip
cibuild: permit non-dev versions on maintenance branches
Cater for the corner case where commits are incorporated on a maintenance branch. We should be able to test these without adding a dev suffix to the tool versions.
Diffstat (limited to 'test/release')
-rw-r--r--test/release/test_cibuild.py32
1 files changed, 30 insertions, 2 deletions
diff --git a/test/release/test_cibuild.py b/test/release/test_cibuild.py
index 96280e35..cfa24e63 100644
--- a/test/release/test_cibuild.py
+++ b/test/release/test_cibuild.py
@@ -64,6 +64,7 @@ def test_buildenviron_pr():
)
assert be.is_pull_request
assert not be.is_prod_release
+ assert not be.is_maintenance_branch
def test_buildenviron_commit():
@@ -83,6 +84,7 @@ def test_buildenviron_commit():
assert not be.should_upload_pypi
assert be.should_upload_docker
assert not be.is_prod_release
+ assert not be.is_maintenance_branch
def test_buildenviron_releasetag():
@@ -107,6 +109,7 @@ def test_buildenviron_releasetag():
assert be.should_upload_pypi
assert be.should_upload_docker
assert be.is_prod_release
+ assert not be.is_maintenance_branch
def test_buildenviron_namedtag():
@@ -131,9 +134,10 @@ def test_buildenviron_namedtag():
assert not be.should_upload_pypi
assert not be.should_upload_docker
assert not be.is_prod_release
+ assert not be.is_maintenance_branch
-def test_buildenviron_branch():
+def test_buildenviron_dev_branch():
# Simulates a commit on a development branch on the main repo
be = cibuild.BuildEnviron(
system="Linux",
@@ -153,6 +157,30 @@ def test_buildenviron_branch():
assert be.upload_dir == "branches/mybranch"
assert not be.should_upload_pypi
assert not be.should_upload_docker
+ assert not be.is_maintenance_branch
+
+
+def test_buildenviron_maintenance_branch():
+ # Simulates a commit on a release maintenance branch on the main repo
+ be = cibuild.BuildEnviron(
+ system="Linux",
+ root_dir="/foo",
+ travis_tag="",
+ travis_branch="v0.x",
+ should_build_wheel=True,
+ should_build_docker=True,
+ should_build_pyinstaller=True,
+ has_twine_creds=True,
+ docker_username="foo",
+ docker_password="bar",
+ )
+ assert be.tag == ""
+ assert be.branch == "v0.x"
+ assert be.version == "v0.x"
+ assert be.upload_dir == "branches/v0.x"
+ assert not be.should_upload_pypi
+ assert not be.should_upload_docker
+ assert be.is_maintenance_branch
def test_buildenviron_osx(tmpdir):
@@ -209,7 +237,7 @@ def test_buildenviron_check_version(version, tag, ok, tmpdir):
be = cibuild.BuildEnviron(
root_dir=tmpdir,
travis_tag=tag,
- travis_branch=tag
+ travis_branch=tag or "branch",
)
if ok:
be.check_version()