diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2018-05-24 22:32:31 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2018-05-24 22:32:31 +1200 |
commit | e9b19dba8aa204ead6092fbb901dadb5be8df72a (patch) | |
tree | 04a703fb2859401af938e56ce6447ac7c7e08a1f /test | |
parent | c91b511bc7cca6a04237d30db1845ddc232aff64 (diff) | |
download | mitmproxy-e9b19dba8aa204ead6092fbb901dadb5be8df72a.tar.gz mitmproxy-e9b19dba8aa204ead6092fbb901dadb5be8df72a.tar.bz2 mitmproxy-e9b19dba8aa204ead6092fbb901dadb5be8df72a.zip |
cibuild: fix docker upload condition, expand tests
Diffstat (limited to 'test')
-rw-r--r-- | test/release/test_cibuild.py | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/test/release/test_cibuild.py b/test/release/test_cibuild.py index 2df5b4a0..2b469d1b 100644 --- a/test/release/test_cibuild.py +++ b/test/release/test_cibuild.py @@ -40,13 +40,20 @@ def test_buildenviron_common(): def test_buildenviron_pr(): + # Simulates a PR. We build everything, but don't have access to secret + # credential env variables. be = cibuild.BuildEnviron( travis_tag = "v0.0.1", travis_branch = "v0.x", travis_pull_request = "true", + + should_build_wheel = True, + should_build_pyinstaller = True, + should_build_docker = True, ) assert be.is_pull_request + # Mini test for appveyor be = cibuild.BuildEnviron( appveyor_pull_request_number = "xxxx", ) @@ -54,26 +61,39 @@ def test_buildenviron_pr(): def test_buildenviron_commit(): + # Simulates an ordinary commit on the master branch. be = cibuild.BuildEnviron( + travis_tag = "", travis_branch = "master", travis_pull_request = "false", + + should_build_wheel = True, + should_build_pyinstaller = True, + should_build_docker = True, + docker_username = "foo", + docker_password = "bar", ) assert be.docker_tag == "dev" assert be.should_upload_docker assert not be.should_upload_pypi + assert be.should_upload_docker def test_buildenviron_rleasetag(): + # Simulates a tagged release on a release branch. be = cibuild.BuildEnviron( system = "Linux", root_dir = "/foo", travis_tag = "v0.0.1", 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 == "v0.0.1" assert be.branch == "v0.x" @@ -81,20 +101,31 @@ def test_buildenviron_rleasetag(): assert be.upload_dir == "0.0.1" assert be.docker_tag == "0.0.1" assert be.should_upload_pypi + assert be.should_upload_docker def test_buildenviron_branch(): + # Simulates a development branch on the main repo be = cibuild.BuildEnviron( system = "Linux", root_dir = "/foo", travis_tag = "", - travis_branch = "v0.x", + travis_branch = "mybranch", + + 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 == "0.x" - assert be.upload_dir == "branches/0.x" + assert be.branch == "mybranch" + assert be.version == "mybranch" + assert be.upload_dir == "branches/mybranch" + assert not be.should_upload_pypi + assert not be.should_upload_docker def test_buildenviron_osx(tmpdir): |