def test_not_recreate_release(releaseable_repo): """ Ensure reflex does not create multiple release branches with the same version. """ with pytest.raises(InvalidUpgradePath): cli.create_release(releaseable_repo, 'develop', '1.0.0') assert 'origin/test-1.0.0' not in releaseable_repo.branches()
def test_deletes_release_branch_after_release(releaseable_repo): """ Ensure that a release branch is automatically cleaned up after closing a release. """ cli.create_release(releaseable_repo, 'develop', '1.1.0') assert 'origin/test-1.1.0' in releaseable_repo.branches() cli.complete_release(releaseable_repo, '1.1.0') assert 'origin/test-1.1.0' not in releaseable_repo.branches()
def test_not_create_earlier_release(releaseable_repo): """ Ensure reflex does not open a release branch using a version before the latest released version. """ with pytest.raises(InvalidUpgradePath): cli.create_release(releaseable_repo, 'develop', '0.9.0') assert 'origin/test-0.9.0' not in releaseable_repo.branches()
def test_create_new_release(releaseable_repo, capsys): """ Ensure release branch is created when creating a new release. """ cli.create_release(releaseable_repo, 'develop', '1.0.1') out, err = capsys.readouterr() assert not err assert '1.0.1' in out assert 'origin/test-1.0.1' in releaseable_repo.branches()
def test_will_not_open_existing_test_branch(releaseable_repo): """ Ensure reflex does not open an already opened release branch. """ releaseable_repo.git('checkout', '-b', 'test-1.1.0') releaseable_repo.git('push', 'origin', 'test-1.1.0') assert 'origin/test-1.1.0' in releaseable_repo.branches() with pytest.raises(DuplicateGitReference): cli.create_release(releaseable_repo, 'develop', '1.1.0')
def test_tag_is_created_for_release(releaseable_repo, capsys): """ Ensure that a final release tag is created when closing a release. """ cli.create_release(releaseable_repo, 'develop', '1.1.0') assert releaseable_repo.get_last_release('master') == 'release-1.0.0' cli.complete_release(releaseable_repo, '1.1.0') assert releaseable_repo.get_last_release('master') == 'release-1.1.0' out, err = capsys.readouterr() assert "Successfully closed" in out assert "release-1.1.0" in out assert not err
def test_existing_branches_warning(releaseable_repo, capsys): """ Ensure reflex warns users about unclosed release branches. """ releaseable_repo.git('checkout', '-b', 'test-1.1.0') releaseable_repo.git('push', 'origin', 'test-1.1.0') assert 'origin/test-1.1.0' in releaseable_repo.branches() cli.create_release(releaseable_repo, 'develop', '1.2.0') out, err = capsys.readouterr() assert '1.2.0' in out assert 'origin/test-1.1.0' in err
def test_merges_into_multiple_dev_branches(releaseable_repo): """ Ensure if multiple development branches are specified during closing a release that changes are merged down to each development branch. """ dev_release = releaseable_repo.get_last_tag('develop', 'release-*') assert dev_release == 'release-1.0.0' releaseable_repo.git('checkout', '-b', 'develop-2') releaseable_repo.git('commit', '--allow-empty', '-m', 'Testing commit') releaseable_repo.git('push', 'origin', 'develop-2') releaseable_repo.git('checkout', 'master') cli.create_release(releaseable_repo, 'develop', '1.1.0') releaseable_repo.development_branches = ['develop', 'develop-2'] cli.complete_release(releaseable_repo, '1.1.0') dev_release = releaseable_repo.get_last_tag('develop', 'release-*') dev_2_release = releaseable_repo.get_last_tag('develop-2', 'release-*') assert dev_release == 'release-1.1.0' assert dev_2_release == 'release-1.1.0'