Skip to content

Commit

Permalink
start breaking stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
tcarmet committed Jul 31, 2024
1 parent d78f49e commit d86bfad
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions bert_e/server/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def display():
for version, _ in queued_commits:
versions.add(version)

# TODO: check the display of the queue
versions = sorted(versions, reverse=True)

for pr_id, queued_commits in queue_data.items():
Expand Down
9 changes: 9 additions & 0 deletions bert_e/tests/test_bert_e.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def initialize_git_repo(repo, username, usermail):
create_branch(repo, 'development/' + major_minor,
'stabilization/' + full_version, file_=True,
do_push=False)
create_branch(repo, f'development/{major}', f'development/{major_minor}',
file_=True, do_push=False)
if major != 6 and major != 10:
repo.cmd('git tag %s.%s.%s', major, minor, micro - 1)

Expand Down Expand Up @@ -4800,6 +4802,13 @@ def test_set_bot_status(self):
pr.src_commit, key="bert-e") == "queued"
self.handle(pr.id, settings=settings, options=self.bypass_all)

def test_dev_major_only(self):
"""Test Bert-E's capability to handle a gitwaterflow with a development/x branch."""
# create a development/4 branch
pr = self.create_pr('bugfix/TEST-01', 'development/4.3')
self.handle(pr.id, options=self.bypass_all)
pr = self.create_pr('bugfix/TEST-02', 'stabilization/4.3.18')
self.handle(pr.id, options=self.bypass_all)

class TestQueueing(RepositoryTests):
"""Tests which validate all things related to the merge queue.
Expand Down
4 changes: 2 additions & 2 deletions bert_e/tests/unit/test_sorted.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_sorted_with_branches():
StabilizationBranch: None,
HotfixBranch: None,
}
branches[1, -1] = {
branches[1, None] = {
DevelopmentBranch: None,
StabilizationBranch: None,
HotfixBranch: None,
Expand All @@ -28,4 +28,4 @@ def test_sorted_with_branches():
}

sorted_branches = OrderedDict(sorted(branches.items(), key=cmp_to_key(compare_branches)))
assert list(sorted_branches.keys()) == [(1, 0), (1, 1), (1, -1), (2, 0)]
assert list(sorted_branches.keys()) == [(1, 0), (1, 1), (1, None), (2, 0)]
1 change: 1 addition & 0 deletions bert_e/workflow/gitwaterflow/branches.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ def _set_target_versions(self, dst_branch):
elif dev_branch and dev_branch.has_minor is False:
latest_minor = self._find_latest_minor(major)
minor = latest_minor + 1 if latest_minor is not None else 0
# TODO: handle case with stab/x.y.z with no dev/x.y
self.target_versions.append(f"{major}.{minor}.{dev_branch.micro + 1}")


Expand Down

0 comments on commit d86bfad

Please sign in to comment.