From 9463fee76488c41dcce995999dd98c190000ded6 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 16 Jun 2018 15:09:34 +1200 Subject: 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. --- test/release/test_cibuild.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'test/release/test_cibuild.py') 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() -- cgit v1.2.3