Skip to content

Commit 3211951

Browse files
Add three digit to the base tests
1 parent 49e8311 commit 3211951

1 file changed

Lines changed: 77 additions & 40 deletions

File tree

bert_e/tests/test_bert_e.py

Lines changed: 77 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,9 @@ def initialize_git_repo(repo, username, usermail):
104104
repo.cmd('git add a')
105105
repo.cmd('git commit -m "Initial commit"')
106106
repo.cmd('git remote add origin ' + repo._url)
107-
for major, minor, micro in [(4, 3, 18), (5, 1, 4), (10, 0, 0)]:
107+
for major, minor, micro in [(4, 3, 18), (5, 1, 4), (10, 0, 1)]:
108108
major_minor = "%s.%s" % (major, minor)
109+
major_minor_micro = "%s.%s.%s" % (major, minor, micro)
109110
create_branch(repo, 'release/' + major_minor, do_push=False)
110111
if major != 10:
111112
create_branch(repo, 'hotfix/%s.%s.%s' %
@@ -119,11 +120,15 @@ def initialize_git_repo(repo, username, usermail):
119120
do_push=False)
120121
else:
121122
create_branch(repo, 'hotfix/10.0.0', do_push=False)
123+
create_branch(repo, f'development/{major}.{minor}.{micro}',
124+
file_=True, do_push=False)
122125
create_branch(repo, 'development/' + major_minor,
126+
f'development/{major_minor_micro}',
123127
file_=True, do_push=False)
124128
create_branch(repo, f'development/{major}',
125129
f'development/{major_minor}',
126130
file_=True, do_push=False)
131+
127132
if major != 6 and major != 10:
128133
repo.cmd('git tag %s.%s.%s', major, minor, micro - 1)
129134

@@ -4941,6 +4946,10 @@ def empty_solution(self):
49414946
gwfb.QueueBranch: self.queue_branch('q/4'),
49424947
gwfb.QueueIntegrationBranch: []
49434948
}),
4949+
((5, 1, 4), {
4950+
gwfb.QueueBranch: self.queue_branch('q/5.1.4'),
4951+
gwfb.QueueIntegrationBranch: []
4952+
}),
49444953
((5, 1), {
49454954
gwfb.QueueBranch: self.queue_branch('q/5.1'),
49464955
gwfb.QueueIntegrationBranch: []
@@ -4949,6 +4958,10 @@ def empty_solution(self):
49494958
gwfb.QueueBranch: self.queue_branch('q/5'),
49504959
gwfb.QueueIntegrationBranch: []
49514960
}),
4961+
((10, 0, 1), {
4962+
gwfb.QueueBranch: self.queue_branch('q/10.0.1'),
4963+
gwfb.QueueIntegrationBranch: []
4964+
}),
49524965
((10, 0), {
49534966
gwfb.QueueBranch: self.queue_branch('q/10.0'),
49544967
gwfb.QueueIntegrationBranch: []
@@ -4966,48 +4979,63 @@ def standard_solution(self):
49664979
((4, 3), {
49674980
gwfb.QueueBranch: self.queue_branch('q/4.3'),
49684981
gwfb.QueueIntegrationBranch: [
4969-
self.qint_branch('q/w/13/4.3/improvement/bar2'),
4982+
self.qint_branch('q/w/16/4.3/improvement/bar2'),
49704983
self.qint_branch('q/w/1/4.3/improvement/bar')
49714984
]
49724985
}),
49734986
((4, None), {
49744987
gwfb.QueueBranch: self.queue_branch('q/4'),
49754988
gwfb.QueueIntegrationBranch: [
4976-
self.qint_branch('q/w/13/4/improvement/bar2'),
4989+
self.qint_branch('q/w/16/4/improvement/bar2'),
49774990
self.qint_branch('q/w/1/4/improvement/bar')
49784991
]
49794992
}),
4993+
((5, 1, 4), {
4994+
gwfb.QueueBranch: self.queue_branch('q/5.1.4'),
4995+
gwfb.QueueIntegrationBranch: [
4996+
self.qint_branch('q/w/16/5.1.4/improvement/bar2'),
4997+
self.qint_branch('q/w/1/5.1.4/improvement/bar')
4998+
]
4999+
}),
49805000
((5, 1), {
49815001
gwfb.QueueBranch: self.queue_branch('q/5.1'),
49825002
gwfb.QueueIntegrationBranch: [
4983-
self.qint_branch('q/w/13/5.1/improvement/bar2'),
4984-
self.qint_branch('q/w/9/5.1/bugfix/bar'),
5003+
self.qint_branch('q/w/16/5.1/improvement/bar2'),
5004+
self.qint_branch('q/w/11/5.1/bugfix/bar'),
49855005
self.qint_branch('q/w/1/5.1/improvement/bar')
49865006
]
49875007
}),
49885008
((5, None), {
49895009
gwfb.QueueBranch: self.queue_branch('q/5'),
49905010
gwfb.QueueIntegrationBranch: [
4991-
self.qint_branch('q/w/13/5/improvement/bar2'),
4992-
self.qint_branch('q/w/9/5/bugfix/bar'),
5011+
self.qint_branch('q/w/16/5/improvement/bar2'),
5012+
self.qint_branch('q/w/11/5/bugfix/bar'),
49935013
self.qint_branch('q/w/1/5/improvement/bar')
49945014
]
49955015
}),
5016+
((10, 0, 1), {
5017+
gwfb.QueueBranch: self.queue_branch('q/10.0.1'),
5018+
gwfb.QueueIntegrationBranch: [
5019+
self.qint_branch('q/w/16/10.0.1/improvement/bar2'),
5020+
self.qint_branch('q/w/11/10.0.1/bugfix/bar'),
5021+
self.qint_branch('q/w/1/10.0.1/improvement/bar')
5022+
]
5023+
}),
49965024
((10, 0), {
49975025
gwfb.QueueBranch: self.queue_branch('q/10.0'),
49985026
gwfb.QueueIntegrationBranch: [
4999-
self.qint_branch('q/w/13/10.0/improvement/bar2'),
5000-
self.qint_branch('q/w/9/10.0/bugfix/bar'),
5001-
self.qint_branch('q/w/7/10.0/feature/foo'),
5027+
self.qint_branch('q/w/16/10.0/improvement/bar2'),
5028+
self.qint_branch('q/w/11/10.0/bugfix/bar'),
5029+
self.qint_branch('q/w/9/10.0/feature/foo'),
50025030
self.qint_branch('q/w/1/10.0/improvement/bar')
50035031
]
50045032
}),
50055033
((10, None), {
50065034
gwfb.QueueBranch: self.queue_branch('q/10'),
50075035
gwfb.QueueIntegrationBranch: [
5008-
self.qint_branch('q/w/13/10/improvement/bar2'),
5009-
self.qint_branch('q/w/9/10/bugfix/bar'),
5010-
self.qint_branch('q/w/7/10/feature/foo'),
5036+
self.qint_branch('q/w/16/10/improvement/bar2'),
5037+
self.qint_branch('q/w/11/10/bugfix/bar'),
5038+
self.qint_branch('q/w/9/10/feature/foo'),
50115039
self.qint_branch('q/w/1/10/improvement/bar')
50125040
]
50135041
}),
@@ -5019,8 +5047,8 @@ def test_queueing_standard_problem(self):
50195047
qc.finalize()
50205048
qc.validate()
50215049
self.assertEqual(qc._queues, self.standard_solution)
5022-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5023-
self.assertEqual(qc.mergeable_prs, [1, 7, 9, 13])
5050+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
5051+
self.assertEqual(qc.mergeable_prs, [1, 9, 11, 16])
50245052
self.assertEqual(qc.mergeable_queues, self.standard_solution)
50255053

50265054
def test_queueing_standard_problem_reverse(self):
@@ -5029,8 +5057,8 @@ def test_queueing_standard_problem_reverse(self):
50295057
qc.finalize()
50305058
qc.validate()
50315059
self.assertEqual(qc._queues, self.standard_solution)
5032-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5033-
self.assertEqual(qc.mergeable_prs, [1, 7, 9, 13])
5060+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
5061+
self.assertEqual(qc.mergeable_prs, [1, 9, 11, 16])
50345062
self.assertEqual(qc.mergeable_queues, self.standard_solution)
50355063

50365064
def test_queueing_standard_problem_without_octopus(self):
@@ -5044,8 +5072,8 @@ def test_queueing_standard_problem_without_octopus(self):
50445072
qc.finalize()
50455073
qc.validate()
50465074
self.assertEqual(qc._queues, self.standard_solution)
5047-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5048-
self.assertEqual(qc.mergeable_prs, [1, 7, 9, 13])
5075+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
5076+
self.assertEqual(qc.mergeable_prs, [1, 9, 11, 16])
50495077
self.assertEqual(qc.mergeable_queues, self.standard_solution)
50505078
finally:
50515079
gwfi.octopus_merge = git_utils.octopus_merge
@@ -5057,17 +5085,19 @@ def test_queueing_last_pr_build_not_started(self):
50575085
solution = deepcopy(self.standard_solution)
50585086
solution[(4, 3)][gwfb.QueueIntegrationBranch].pop(0)
50595087
solution[(4, None)][gwfb.QueueIntegrationBranch].pop(0)
5088+
solution[(5, 1, 4)][gwfb.QueueIntegrationBranch].pop(0)
50605089
solution[(5, 1)][gwfb.QueueIntegrationBranch].pop(0)
50615090
solution[(5, None)][gwfb.QueueIntegrationBranch].pop(0)
5091+
solution[(10, 0, 1)][gwfb.QueueIntegrationBranch].pop(0)
50625092
solution[(10, 0)][gwfb.QueueIntegrationBranch].pop(0)
50635093
solution[(10, None)][gwfb.QueueIntegrationBranch].pop(0)
50645094
qbranches = self.submit_problem(problem)
50655095
qc = self.feed_queue_collection(qbranches)
50665096
qc.finalize()
50675097
qc.validate()
50685098
self.assertEqual(qc._queues, self.standard_solution)
5069-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5070-
self.assertEqual(qc.mergeable_prs, [1, 7, 9])
5099+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
5100+
self.assertEqual(qc.mergeable_prs, [1, 9, 11])
50715101
self.assertEqual(qc.mergeable_queues, solution)
50725102

50735103
def test_queueing_last_pr_build_failed(self):
@@ -5076,17 +5106,19 @@ def test_queueing_last_pr_build_failed(self):
50765106
solution = deepcopy(self.standard_solution)
50775107
solution[(4, 3)][gwfb.QueueIntegrationBranch].pop(0)
50785108
solution[(4, None)][gwfb.QueueIntegrationBranch].pop(0)
5109+
solution[(5, 1, 4)][gwfb.QueueIntegrationBranch].pop(0)
50795110
solution[(5, 1)][gwfb.QueueIntegrationBranch].pop(0)
50805111
solution[(5, None)][gwfb.QueueIntegrationBranch].pop(0)
5112+
solution[(10, 0, 1)][gwfb.QueueIntegrationBranch].pop(0)
50815113
solution[(10, 0)][gwfb.QueueIntegrationBranch].pop(0)
50825114
solution[(10, None)][gwfb.QueueIntegrationBranch].pop(0)
50835115
qbranches = self.submit_problem(problem)
50845116
qc = self.feed_queue_collection(qbranches)
50855117
qc.finalize()
50865118
qc.validate()
50875119
self.assertEqual(qc._queues, self.standard_solution)
5088-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5089-
self.assertEqual(qc.mergeable_prs, [1, 7, 9])
5120+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
5121+
self.assertEqual(qc.mergeable_prs, [1, 9, 11])
50905122
self.assertEqual(qc.mergeable_queues, solution)
50915123

50925124
def test_queueing_last_pr_other_key(self):
@@ -5095,17 +5127,19 @@ def test_queueing_last_pr_other_key(self):
50955127
solution = deepcopy(self.standard_solution)
50965128
solution[(4, 3)][gwfb.QueueIntegrationBranch].pop(0)
50975129
solution[(4, None)][gwfb.QueueIntegrationBranch].pop(0)
5130+
solution[(5, 1, 4)][gwfb.QueueIntegrationBranch].pop(0)
50985131
solution[(5, 1)][gwfb.QueueIntegrationBranch].pop(0)
50995132
solution[(5, None)][gwfb.QueueIntegrationBranch].pop(0)
5133+
solution[(10, 0, 1)][gwfb.QueueIntegrationBranch].pop(0)
51005134
solution[(10, 0)][gwfb.QueueIntegrationBranch].pop(0)
51015135
solution[(10, None)][gwfb.QueueIntegrationBranch].pop(0)
51025136
qbranches = self.submit_problem(problem)
51035137
qc = self.feed_queue_collection(qbranches)
51045138
qc.finalize()
51055139
qc.validate()
51065140
self.assertEqual(qc._queues, self.standard_solution)
5107-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5108-
self.assertEqual(qc.mergeable_prs, [1, 7, 9])
5141+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
5142+
self.assertEqual(qc.mergeable_prs, [1, 9, 11])
51095143
self.assertEqual(qc.mergeable_queues, solution)
51105144

51115145
def test_queueing_fail_masked_by_success(self):
@@ -5118,8 +5152,8 @@ def test_queueing_fail_masked_by_success(self):
51185152
qc.finalize()
51195153
qc.validate()
51205154
self.assertEqual(qc._queues, self.standard_solution)
5121-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5122-
self.assertEqual(qc.mergeable_prs, [1, 7, 9, 13])
5155+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
5156+
self.assertEqual(qc.mergeable_prs, [1, 9, 11, 16])
51235157
self.assertEqual(qc.mergeable_queues, self.standard_solution)
51245158

51255159
def test_queueing_all_failed(self):
@@ -5132,7 +5166,7 @@ def test_queueing_all_failed(self):
51325166
qc.finalize()
51335167
qc.validate()
51345168
self.assertEqual(qc._queues, self.standard_solution)
5135-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5169+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
51365170
self.assertEqual(qc.mergeable_prs, [])
51375171
self.assertEqual(qc.mergeable_queues, self.empty_solution)
51385172

@@ -5146,7 +5180,7 @@ def test_queueing_all_inprogress(self):
51465180
qc.finalize()
51475181
qc.validate()
51485182
self.assertEqual(qc._queues, self.standard_solution)
5149-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5183+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
51505184
self.assertEqual(qc.mergeable_prs, [])
51515185
self.assertEqual(qc.mergeable_queues, self.empty_solution)
51525186

@@ -5160,7 +5194,7 @@ def test_queueing_mixed_fails(self):
51605194
qc.finalize()
51615195
qc.validate()
51625196
self.assertEqual(qc._queues, self.standard_solution)
5163-
self.assertEqual(qc.queued_prs, [1, 7, 9, 13])
5197+
self.assertEqual(qc.queued_prs, [1, 9, 11, 16])
51645198
self.assertEqual(qc.mergeable_prs, [])
51655199
self.assertEqual(qc.mergeable_queues, self.empty_solution)
51665200

@@ -5273,7 +5307,7 @@ def test_validation_masterq_diverged(self):
52735307

52745308
def test_validation_vertical_inclusion(self):
52755309
qbranches = self.submit_problem(self.standard_problem)
5276-
add_file_to_branch(self.gitrepo, 'q/w/13/5.1/improvement/bar2',
5310+
add_file_to_branch(self.gitrepo, 'q/w/16/5.1/improvement/bar2',
52775311
'file_pushed_without_bert-e.txt', do_push=True)
52785312
qc = self.feed_queue_collection(qbranches)
52795313
qc.finalize()
@@ -5352,6 +5386,7 @@ def test_system_nominal_case(self):
53525386
'w/10.0/bugfix/TEST-00001',
53535387
'w/10/bugfix/TEST-00001'
53545388
]
5389+
53555390
for branch in expected_branches:
53565391
self.assertTrue(self.gitrepo.remote_branch_exists(branch))
53575392

@@ -6029,9 +6064,10 @@ def test_status_with_queue(self):
60296064

60306065
status = self.berte.status.get('merge queue', OrderedDict())
60316066
self.assertIn(1, status)
6032-
self.assertEqual(len(status[1]), 6)
6067+
self.assertEqual(len(status[1]), 8)
60336068
versions = tuple(version for version, _ in status[1])
6034-
self.assertEqual(versions, ('10', '10.0', '5', '5.1', '4', '4.3'))
6069+
self.assertEqual(versions, ('10', '10.0', '10.0.1', '5',
6070+
'5.1', '5.1.4', '4', '4.3'))
60356071
for _, sha1 in status[1]:
60366072
self.set_build_status(sha1=sha1, state='SUCCESSFUL')
60376073
self.process_sha1_job(sha1_q_10_0, 'Merged')
@@ -6077,7 +6113,8 @@ def test_status_with_queue_without_octopus(self):
60776113
versions = tuple(version for version, _ in status[1])
60786114
for _, sha1 in status[1]:
60796115
self.set_build_status(sha1=sha1, state='SUCCESSFUL')
6080-
self.assertEqual(versions, ('10', '10.0', '5', '5.1', '4', '4.3'))
6116+
self.assertEqual(versions, ('10', '10.0', '10.0.1',
6117+
'5', '5.1', '5.1.4', '4', '4.3'))
60816118
self.process_sha1_job(sha1_q_10_0, 'Merged')
60826119

60836120
merged_pr = self.berte.status.get('merged PRs', [])
@@ -6309,7 +6346,7 @@ def test_job_create_branch_dev_start(self):
63096346
self.gitrepo._get_remote_branches(force=True)
63106347
self.assertEqual(
63116348
self.gitrepo._remote_branches['development/2.9'],
6312-
self.gitrepo._remote_branches['development/4.3']
6349+
self.gitrepo._remote_branches['development/4.3.18']
63136350
)
63146351

63156352
self.gitrepo.cmd('git fetch')
@@ -6444,7 +6481,7 @@ def test_job_create_branch_dev_end(self):
64446481
'q/w/3/10.0/feature/TEST-03',
64456482
'q/w/3/10/feature/TEST-03',
64466483
'q/w/3/11.3/feature/TEST-03',
6447-
'q/w/22/11.3/feature/TEST-9997',
6484+
'q/w/28/11.3/feature/TEST-9997',
64486485
]
64496486
self.gitrepo._get_remote_branches(force=True)
64506487
for branch in expected_branches:
@@ -6531,10 +6568,10 @@ def test_job_delete_branch(self):
65316568
('q/w/3/5/feature/TEST-03', self.assertTrue),
65326569
('q/w/3/10.0/feature/TEST-03', self.assertTrue),
65336570
('q/w/3/10/feature/TEST-03', self.assertTrue),
6534-
('q/w/13/5.1/feature/TEST-9998', self.assertTrue),
6535-
('q/w/13/5/feature/TEST-9998', self.assertTrue),
6536-
('q/w/13/10.0/feature/TEST-9998', self.assertTrue),
6537-
('q/w/13/10/feature/TEST-9998', self.assertTrue),
6571+
('q/w/16/5.1/feature/TEST-9998', self.assertTrue),
6572+
('q/w/16/5/feature/TEST-9998', self.assertTrue),
6573+
('q/w/16/10.0/feature/TEST-9998', self.assertTrue),
6574+
('q/w/16/10/feature/TEST-9998', self.assertTrue),
65386575
]
65396576
self.gitrepo._get_remote_branches(force=True)
65406577
for branch, func in expected_branches:

0 commit comments

Comments
 (0)