Compare commits
No commits in common. "e5d1203435d7e0ed90520a1ea1bb0ec23f55fea7" and "288247be8eed7ffa50318a140b5749ca912c887c" have entirely different histories.
e5d1203435
...
288247be8e
3 changed files with 1 additions and 44 deletions
|
@ -85,10 +85,6 @@ class BuildFile(Validateable):
|
||||||
|
|
||||||
def set_version(self, new_version: Version):
|
def set_version(self, new_version: Version):
|
||||||
# TODO: How can we create regex-pattern constants to use them at both places?
|
# TODO: How can we create regex-pattern constants to use them at both places?
|
||||||
|
|
||||||
if new_version.is_snapshot():
|
|
||||||
new_version.snapshot_suffix = self.get_default_suffix()
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
match self.build_file_type():
|
match self.build_file_type():
|
||||||
case BuildFileType.JS:
|
case BuildFileType.JS:
|
||||||
|
|
|
@ -156,9 +156,6 @@ class GitApiMock:
|
||||||
def push(self):
|
def push(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def push_follow_tags(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def checkout(self, branch: str):
|
def checkout(self, branch: str):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,7 @@ from pybuilder.core import Project
|
||||||
|
|
||||||
from src.main.python.ddadevops.release_mixin import ReleaseMixin
|
from src.main.python.ddadevops.release_mixin import ReleaseMixin
|
||||||
from src.main.python.ddadevops.domain import Devops, Release
|
from src.main.python.ddadevops.domain import Devops, Release
|
||||||
from src.main.python.ddadevops.application import ReleaseService
|
from .domain.helper import devops_config
|
||||||
from src.main.python.ddadevops.infrastructure import BuildFileRepository
|
|
||||||
from .domain.helper import devops_config, GitApiMock, ArtifactDeploymentApiMock
|
|
||||||
from .resource_helper import copy_resource
|
from .resource_helper import copy_resource
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,37 +30,3 @@ def test_release_mixin(tmp_path):
|
||||||
|
|
||||||
sut.initialize_build_dir()
|
sut.initialize_build_dir()
|
||||||
assert sut.build_path() == f"{str_tmp_path}/target/name/release-test"
|
assert sut.build_path() == f"{str_tmp_path}/target/name/release-test"
|
||||||
|
|
||||||
def test_release_mixin_different_version_suffixes(tmp_path):
|
|
||||||
str_tmp_path = str(tmp_path)
|
|
||||||
copy_resource(Path("config.py"), tmp_path)
|
|
||||||
copy_resource(Path("config.gradle"), tmp_path)
|
|
||||||
|
|
||||||
project = Project(str_tmp_path, name="name")
|
|
||||||
|
|
||||||
os.environ["RELEASE_ARTIFACT_TOKEN"] = "ratoken"
|
|
||||||
|
|
||||||
sut = ReleaseMixin(
|
|
||||||
project,
|
|
||||||
devops_config(
|
|
||||||
{
|
|
||||||
"project_root_path": str_tmp_path,
|
|
||||||
"mixin_types": ["RELEASE"],
|
|
||||||
"build_types": [],
|
|
||||||
"module": "release-test",
|
|
||||||
"release_current_branch": "main",
|
|
||||||
"release_main_branch": "main",
|
|
||||||
"release_primary_build_file": "config.py",
|
|
||||||
"release_secondary_build_files": ["config.gradle"],
|
|
||||||
}
|
|
||||||
),
|
|
||||||
)
|
|
||||||
sut.release_service = ReleaseService(GitApiMock(), ArtifactDeploymentApiMock(), BuildFileRepository(project.basedir))
|
|
||||||
|
|
||||||
sut.initialize_build_dir()
|
|
||||||
sut.update_release_type("PATCH")
|
|
||||||
sut.prepare_release()
|
|
||||||
sut.tag_bump_and_push_release()
|
|
||||||
|
|
||||||
assert sut.release_service.build_file_repository.get(Path("config.py")).get_version().to_string() == "3.1.5-dev"
|
|
||||||
assert sut.release_service.build_file_repository.get(Path("config.gradle")).get_version().to_string() == "3.1.5-SNAPSHOT"
|
|
Loading…
Reference in a new issue