Skip to content

Commit 33b9ab4

Browse files
committed
update github token tests for EB5
1 parent 01b1bfd commit 33b9ab4

File tree

2 files changed

+44
-57
lines changed

2 files changed

+44
-57
lines changed

test/framework/github.py

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -438,40 +438,26 @@ def test_github_fetch_easyconfigs_from_pr(self):
438438
'pr_target_account': gh.GITHUB_EB_MAIN,
439439
})
440440

441-
# PR for rename of arrow to Arrow,
442-
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/8007/files
443-
all_ecs_pr8007 = [
444-
'Arrow-0.7.1-intel-2017b-Python-3.6.3.eb',
445-
'bat-0.3.3-fix-pyspark.patch',
446-
'bat-0.3.3-intel-2017b-Python-3.6.3.eb',
441+
# PR for XCrySDen,
442+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/22227/files
443+
all_ecs_pr22227 = [
444+
'bwidget-1.10.1-GCCcore-13.3.0.eb',
445+
'quarto-1.5.57-x64.eb',
446+
'Sabre-2013-09-28-GCC-13.3.0.eb',
447+
'Togl-2.0-GCCcore-13.3.0.eb',
448+
'XCrySDen-1.6.2-foss-2024a.eb',
447449
]
448-
# PR where also files are patched in test/
449-
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/6587/files
450-
all_ecs_pr6587 = [
451-
'WIEN2k-18.1-foss-2018a.eb',
452-
'WIEN2k-18.1-gimkl-2017a.eb',
453-
'WIEN2k-18.1-intel-2018a.eb',
454-
'libxc-4.2.3-foss-2018a.eb',
455-
'libxc-4.2.3-gimkl-2017a.eb',
456-
'libxc-4.2.3-intel-2018a.eb',
450+
# PR where only files are patched in test/
451+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/22061/files
452+
all_ecs_pr22061 = [
457453
]
458-
# PR where files are renamed
459-
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/7159/files
460-
all_ecs_pr7159 = [
461-
'DOLFIN-2018.1.0.post1-foss-2018a-Python-3.6.4.eb',
462-
'OpenFOAM-5.0-20180108-foss-2018a.eb',
463-
'OpenFOAM-5.0-20180108-intel-2018a.eb',
464-
'OpenFOAM-6-foss-2018b.eb',
465-
'OpenFOAM-6-intel-2018a.eb',
466-
'OpenFOAM-v1806-foss-2018b.eb',
467-
'PETSc-3.9.3-foss-2018a.eb',
468-
'SCOTCH-6.0.6-foss-2018a.eb',
469-
'SCOTCH-6.0.6-foss-2018b.eb',
470-
'SCOTCH-6.0.6-intel-2018a.eb',
471-
'Trilinos-12.12.1-foss-2018a-Python-3.6.4.eb'
454+
# PR where files are unarchived
455+
# see https://github.com/easybuilders/easybuild-easyconfigs/pull/19834/files
456+
all_ecs_pr19834 = [
457+
'Gblocks-0.91b.eb',
472458
]
473459

474-
for pr, all_ecs in [(8007, all_ecs_pr8007), (6587, all_ecs_pr6587), (7159, all_ecs_pr7159)]:
460+
for pr, all_ecs in [(22227, all_ecs_pr22227), (22061, all_ecs_pr22061), (19834, all_ecs_pr19834)]:
475461
try:
476462
tmpdir = os.path.join(self.test_prefix, 'pr%s' % pr)
477463
with self.mocked_stdout_stderr():

test/framework/options.py

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,69 +1441,70 @@ def test_github_copy_ec_from_pr(self):
14411441
# Make sure the test target directory doesn't exist
14421442
remove_dir(test_target_dir)
14431443

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',
14481449
]
14491450

14501451
# test use of --copy-ec with --from-pr to the current working directory
14511452
cwd = change_dir(test_working_dir)
1452-
args = ['--copy-ec', '--from-pr', '8007']
1453+
args = ['--copy-ec', '--from-pr', '22365']
14531454
stdout = self.mocked_main(args)
14541455

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))
14561457
self.assertTrue(regex.search(stdout), "Pattern '%s' should be found in: %s" % (regex.pattern, stdout))
14571458

14581459
# check that the files exist
1459-
for pr_file in all_files_pr8007:
1460+
for pr_file in all_files_pr22365:
14601461
self.assertExists(os.path.join(test_working_dir, pr_file))
14611462
remove_file(os.path.join(test_working_dir, pr_file))
14621463

14631464
# copying all files touched by PR to a non-existing target directory (which is created automatically)
14641465
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]
14661467
stdout = self.mocked_main(args)
14671468

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))
14691470
self.assertTrue(regex.search(stdout), "Pattern '%s' should be found in: %s" % (regex.pattern, stdout))
14701471

1471-
for pr_file in all_files_pr8007:
1472+
for pr_file in all_files_pr22365:
14721473
self.assertExists(os.path.join(test_target_dir, pr_file))
14731474
remove_dir(test_target_dir)
14741475

14751476
# test where we select a single easyconfig file from a PR
14761477
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]
14791480
stdout = self.mocked_main(args)
14801481

14811482
regex = re.compile(r"%s copied to .*/%s" % (ec_filename, os.path.basename(test_target_dir)))
14821483
self.assertTrue(regex.search(stdout), "Pattern '%s' should be found in: %s" % (regex.pattern, stdout))
14831484

14841485
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)))
14861487
remove_dir(test_target_dir)
14871488

14881489
# 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
14911492
stdout = self.mocked_main(args)
14921493

1493-
regex = re.compile(r"%s copied to .*/bat.eb" % ec_filename)
1494+
regex = re.compile(r"%s copied to .*/Environ.eb" % ec_filename)
14941495
self.assertTrue(regex.search(stdout), "Pattern '%s' should be found in: %s" % (regex.pattern, stdout))
14951496

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))
14981499

14991500
change_dir(cwd)
15001501
remove_dir(test_working_dir)
15011502
mkdir(test_working_dir)
15021503
change_dir(test_working_dir)
15031504

15041505
# 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, '.']
15071508
stdout = self.mocked_main(args)
15081509

15091510
self.assertEqual(os.listdir(test_working_dir), [patch_fn])
@@ -1514,18 +1515,18 @@ def test_github_copy_ec_from_pr(self):
15141515

15151516
# test the same thing but where we don't provide a target location
15161517
change_dir(test_working_dir)
1517-
args = ['--copy-ec', '--from-pr', '8007', ec_filename]
1518+
args = ['--copy-ec', '--from-pr', '22365', ec_filename]
15181519
stdout = self.mocked_main(args)
15191520

15201521
regex = re.compile(r"%s copied to .*/%s" % (ec_filename, os.path.basename(test_working_dir)))
15211522
self.assertTrue(regex.search(stdout), "Pattern '%s' should be found in: %s" % (regex.pattern, stdout))
15221523

15231524
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)))
15251526

15261527
# also test copying of patch file to current directory (without specifying target location)
15271528
change_dir(test_working_dir)
1528-
args = ['--copy-ec', '--from-pr', '8007', patch_fn]
1529+
args = ['--copy-ec', '--from-pr', '22365', patch_fn]
15291530
stdout = self.mocked_main(args)
15301531

15311532
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):
15391540

15401541
# test with only one ec in the PR (final argument is taken as a filename)
15411542
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"
15441545
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))
15461547
self.assertTrue(regex.search(stdout), "Pattern '%s' found in: %s" % (regex.pattern, stdout))
15471548
self.assertExists(test_ec)
1548-
self.assertIn("name = 'ExifTool'", read_file(test_ec))
1549+
self.assertIn("name = 'HEEDS'", read_file(test_ec))
15491550
remove_file(test_ec)
15501551

15511552
def test_copy_ec_from_commit(self):

0 commit comments

Comments
 (0)