@@ -1441,69 +1441,70 @@ def test_github_copy_ec_from_pr(self):
1441
1441
# Make sure the test target directory doesn't exist
1442
1442
remove_dir (test_target_dir )
1443
1443
1444
- all_files_pr8007 = [
1445
- 'Arrow-0.7.1-intel-2017b-Python-3.6.3.eb' ,
1446
- 'bat-0.3.3-fix-pyspark.patch' ,
1447
- 'bat-0.3.3-intel-2017b-Python-3.6.3.eb' ,
1444
+ all_files_pr22365 = [
1445
+ 'Environ-3.1-foss-2024a.eb' ,
1446
+ 'QuantumESPRESSO-7.4-foss-2024a-Environ-3.1.eb' ,
1447
+ 'QuantumESPRESSO-7.4-foss-2024a.eb' ,
1448
+ 'QuantumESPRESSO-7.4-parallel-symmetrization.patch' ,
1448
1449
]
1449
1450
1450
1451
# test use of --copy-ec with --from-pr to the current working directory
1451
1452
cwd = change_dir (test_working_dir )
1452
- args = ['--copy-ec' , '--from-pr' , '8007 ' ]
1453
+ args = ['--copy-ec' , '--from-pr' , '22365 ' ]
1453
1454
stdout = self .mocked_main (args )
1454
1455
1455
- regex = re .compile (r"3 file\(s\) copied to .*/%s" % os .path .basename (test_working_dir ))
1456
+ regex = re .compile (r"4 file\(s\) copied to .*/%s" % os .path .basename (test_working_dir ))
1456
1457
self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
1457
1458
1458
1459
# check that the files exist
1459
- for pr_file in all_files_pr8007 :
1460
+ for pr_file in all_files_pr22365 :
1460
1461
self .assertExists (os .path .join (test_working_dir , pr_file ))
1461
1462
remove_file (os .path .join (test_working_dir , pr_file ))
1462
1463
1463
1464
# copying all files touched by PR to a non-existing target directory (which is created automatically)
1464
1465
self .assertNotExists (test_target_dir )
1465
- args = ['--copy-ec' , '--from-pr' , '8007 ' , test_target_dir ]
1466
+ args = ['--copy-ec' , '--from-pr' , '22365 ' , test_target_dir ]
1466
1467
stdout = self .mocked_main (args )
1467
1468
1468
- regex = re .compile (r"3 file\(s\) copied to .*/%s" % os .path .basename (test_target_dir ))
1469
+ regex = re .compile (r"4 file\(s\) copied to .*/%s" % os .path .basename (test_target_dir ))
1469
1470
self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
1470
1471
1471
- for pr_file in all_files_pr8007 :
1472
+ for pr_file in all_files_pr22365 :
1472
1473
self .assertExists (os .path .join (test_target_dir , pr_file ))
1473
1474
remove_dir (test_target_dir )
1474
1475
1475
1476
# test where we select a single easyconfig file from a PR
1476
1477
mkdir (test_target_dir )
1477
- ec_filename = 'bat-0.3.3-intel-2017b-Python-3.6.3 .eb'
1478
- args = ['--copy-ec' , '--from-pr' , '8007 ' , ec_filename , test_target_dir ]
1478
+ ec_filename = 'Environ-3.1-foss-2024a .eb'
1479
+ args = ['--copy-ec' , '--from-pr' , '22365 ' , ec_filename , test_target_dir ]
1479
1480
stdout = self .mocked_main (args )
1480
1481
1481
1482
regex = re .compile (r"%s copied to .*/%s" % (ec_filename , os .path .basename (test_target_dir )))
1482
1483
self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
1483
1484
1484
1485
self .assertEqual (os .listdir (test_target_dir ), [ec_filename ])
1485
- self .assertIn ("name = 'bat '" , read_file (os .path .join (test_target_dir , ec_filename )))
1486
+ self .assertIn ("name = 'Environ '" , read_file (os .path .join (test_target_dir , ec_filename )))
1486
1487
remove_dir (test_target_dir )
1487
1488
1488
1489
# test copying of a single easyconfig file from a PR to a non-existing path
1489
- bat_ec = os .path .join (self .test_prefix , 'bat .eb' )
1490
- args [- 1 ] = bat_ec
1490
+ environ_ec = os .path .join (self .test_prefix , 'Environ .eb' )
1491
+ args [- 1 ] = environ_ec
1491
1492
stdout = self .mocked_main (args )
1492
1493
1493
- regex = re .compile (r"%s copied to .*/bat .eb" % ec_filename )
1494
+ regex = re .compile (r"%s copied to .*/Environ .eb" % ec_filename )
1494
1495
self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
1495
1496
1496
- self .assertExists (bat_ec )
1497
- self .assertIn ("name = 'bat '" , read_file (bat_ec ))
1497
+ self .assertExists (environ_ec )
1498
+ self .assertIn ("name = 'Environ '" , read_file (environ_ec ))
1498
1499
1499
1500
change_dir (cwd )
1500
1501
remove_dir (test_working_dir )
1501
1502
mkdir (test_working_dir )
1502
1503
change_dir (test_working_dir )
1503
1504
1504
1505
# test copying of a patch file from a PR via --copy-ec to current directory
1505
- patch_fn = 'bat-0.3.3-fix-pyspark .patch'
1506
- args = ['--copy-ec' , '--from-pr' , '8007 ' , patch_fn , '.' ]
1506
+ patch_fn = 'QuantumESPRESSO-7.4-parallel-symmetrization .patch'
1507
+ args = ['--copy-ec' , '--from-pr' , '22365 ' , patch_fn , '.' ]
1507
1508
stdout = self .mocked_main (args )
1508
1509
1509
1510
self .assertEqual (os .listdir (test_working_dir ), [patch_fn ])
@@ -1514,18 +1515,18 @@ def test_github_copy_ec_from_pr(self):
1514
1515
1515
1516
# test the same thing but where we don't provide a target location
1516
1517
change_dir (test_working_dir )
1517
- args = ['--copy-ec' , '--from-pr' , '8007 ' , ec_filename ]
1518
+ args = ['--copy-ec' , '--from-pr' , '22365 ' , ec_filename ]
1518
1519
stdout = self .mocked_main (args )
1519
1520
1520
1521
regex = re .compile (r"%s copied to .*/%s" % (ec_filename , os .path .basename (test_working_dir )))
1521
1522
self .assertTrue (regex .search (stdout ), "Pattern '%s' should be found in: %s" % (regex .pattern , stdout ))
1522
1523
1523
1524
self .assertEqual (os .listdir (test_working_dir ), [ec_filename ])
1524
- self .assertIn ("name = 'bat '" , read_file (os .path .join (test_working_dir , ec_filename )))
1525
+ self .assertIn ("name = 'Environ '" , read_file (os .path .join (test_working_dir , ec_filename )))
1525
1526
1526
1527
# also test copying of patch file to current directory (without specifying target location)
1527
1528
change_dir (test_working_dir )
1528
- args = ['--copy-ec' , '--from-pr' , '8007 ' , patch_fn ]
1529
+ args = ['--copy-ec' , '--from-pr' , '22365 ' , patch_fn ]
1529
1530
stdout = self .mocked_main (args )
1530
1531
1531
1532
regex = re .compile (r"%s copied to .*/%s" % (patch_fn , os .path .basename (test_working_dir )))
@@ -1539,13 +1540,13 @@ def test_github_copy_ec_from_pr(self):
1539
1540
1540
1541
# test with only one ec in the PR (final argument is taken as a filename)
1541
1542
test_ec = os .path .join (self .test_prefix , 'test.eb' )
1542
- args = ['--copy-ec' , '--from-pr' , '11521 ' , test_ec ]
1543
- ec_pr11521 = "ExifTool-12.00-GCCcore-9.3.0 .eb"
1543
+ args = ['--copy-ec' , '--from-pr' , '20545 ' , test_ec ]
1544
+ ec_pr20545 = "HEEDS-2310 .eb"
1544
1545
stdout = self .mocked_main (args )
1545
- regex = re .compile (r'.*/%s copied to %s' % (ec_pr11521 , test_ec ))
1546
+ regex = re .compile (r'.*/%s copied to %s' % (ec_pr20545 , test_ec ))
1546
1547
self .assertTrue (regex .search (stdout ), "Pattern '%s' found in: %s" % (regex .pattern , stdout ))
1547
1548
self .assertExists (test_ec )
1548
- self .assertIn ("name = 'ExifTool '" , read_file (test_ec ))
1549
+ self .assertIn ("name = 'HEEDS '" , read_file (test_ec ))
1549
1550
remove_file (test_ec )
1550
1551
1551
1552
def test_copy_ec_from_commit (self ):
0 commit comments