@@ -1182,6 +1182,7 @@ def test_request_integration_branch_creation(self):
1182
1182
required_leader_approvals: 0
1183
1183
required_peer_approvals: 1
1184
1184
always_create_integration_branches: false
1185
+ always_create_integration_pull_requests: false
1185
1186
admins:
1186
1187
- {admin}
1187
1188
""" # noqa
@@ -1285,65 +1286,41 @@ def test_creation_integration_branch_by_approve(self):
1285
1286
admins:
1286
1287
- {admin}
1287
1288
""" # noqa
1288
- options = self .bypass_all_but (['bypass_build_status' , 'bypass_author_approval' ])
1289
- pr = self .create_pr ('feature/TEST-0069' , 'development/4.3' )
1290
-
1291
- with self .assertRaises (exns .ApprovalRequired ):
1292
- self .handle (pr .id , options = options , backtrace = True )
1293
-
1294
- self .assertEqual (len (list (pr .get_comments ())), 3 )
1295
-
1296
- self .assertIn (
1297
- 'Integration data created' , list (pr .get_comments ())[- 2 ].text )
1298
-
1299
- self .assertIn (
1300
- 'Waiting for approval' , self .get_last_pr_comment (pr ))
1301
- self .assertIn (
1302
- 'The following approvals are needed' , self .get_last_pr_comment (pr ))
1303
-
1304
- pr .approve ()
1305
-
1306
- with self .assertRaises (exns .BuildNotStarted ):
1307
- self .handle (
1308
- pr .id , settings = settings , options = options , backtrace = True )
1309
-
1310
- options = self .bypass_all
1311
- with self .assertRaises (exns .SuccessMessage ):
1312
- self .handle (
1313
- pr .id , settings = settings , options = options , backtrace = True )
1314
-
1315
- self .assertIn (
1316
- 'I have successfully merged the changeset' , self .get_last_pr_comment (pr ))
1317
-
1318
- options = self .bypass_all_but (['bypass_build_status' , 'bypass_author_approval' ])
1319
- pr = self .create_pr ('feature/TEST-0070' , 'development/4.3' )
1289
+ pr_1 = self .create_pr ('feature/TEST-0069' , 'development/4.3' )
1290
+ pr_2 = self .create_pr ('feature/TEST-0070' , 'development/4.3' )
1291
+ prs = [pr_1 , pr_2 ]
1320
1292
1321
- with self .assertRaises (exns .ApprovalRequired ):
1322
- self .handle (pr .id , options = options , backtrace = True )
1293
+ for pr in prs :
1294
+ options = self .bypass_all_but (['bypass_build_status' , 'bypass_author_approval' ])
1295
+ with self .assertRaises (exns .ApprovalRequired ):
1296
+ self .handle (pr .id , options = options , backtrace = True )
1323
1297
1324
- self .assertEqual (len (list (pr .get_comments ())), 3 )
1298
+ self .assertEqual (len (list (pr .get_comments ())), 3 )
1325
1299
1326
- self .assertIn (
1300
+ self .assertIn (
1327
1301
'Integration data created' , list (pr .get_comments ())[- 2 ].text )
1328
1302
1329
- self .assertIn (
1330
- 'Waiting for approval' , self .get_last_pr_comment (pr ))
1331
- self .assertIn (
1332
- 'The following approvals are needed' , self .get_last_pr_comment (pr ))
1303
+ self .assertIn (
1304
+ 'Waiting for approval' , self .get_last_pr_comment (pr ))
1305
+ self .assertIn (
1306
+ 'The following approvals are needed' , self .get_last_pr_comment (pr ))
1333
1307
1334
- pr .add_comment ('/approve' )
1308
+ if pr .src_branch == "feature/TEST-0069" :
1309
+ pr .approve ()
1310
+ elif pr .src_branch == "feature/TEST-0070" :
1311
+ pr .add_comment ('/approve' )
1335
1312
1336
- with self .assertRaises (exns .BuildNotStarted ):
1337
- self .handle (
1338
- pr .id , settings = settings , options = options , backtrace = True )
1313
+ with self .assertRaises (exns .BuildNotStarted ):
1314
+ self .handle (
1315
+ pr .id , settings = settings , options = options , backtrace = True )
1339
1316
1340
- options = self .bypass_all
1341
- with self .assertRaises (exns .SuccessMessage ):
1342
- self .handle (
1343
- pr .id , settings = settings , options = options , backtrace = True )
1344
-
1345
- self .assertIn (
1346
- 'I have successfully merged the changeset' , self .get_last_pr_comment (pr ))
1317
+ options = self .bypass_all
1318
+ with self .assertRaises (exns .SuccessMessage ):
1319
+ self .handle (
1320
+ pr .id , settings = settings , options = options , backtrace = True )
1321
+
1322
+ self .assertIn (
1323
+ 'I have successfully merged the changeset' , self .get_last_pr_comment (pr ))
1347
1324
1348
1325
def test_integration_branch_creation_latest_branch (self ):
1349
1326
"""Test there is no comment to request integration branches creation.
0 commit comments