Skip to content

Commit

Permalink
Add CI check for deprecated EC parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Oct 9, 2024
1 parent cafe0d5 commit 93ed7fe
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion test/easyconfigs/easyconfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
from easybuild.framework.easyconfig.format.format import DEPENDENCY_PARAMETERS
from easybuild.framework.easyconfig.easyconfig import get_easyblock_class, letter_dir_for
from easybuild.framework.easyconfig.easyconfig import resolve_template
from easybuild.framework.easyconfig.parser import EasyConfigParser, fetch_parameters_from_easyconfig
from easybuild.framework.easyconfig.parser import (
EasyConfigParser, fetch_parameters_from_easyconfig,
DEPRECATED_EASYCONFIG_PARAMETERS,
)
from easybuild.framework.easyconfig.tools import check_sha256_checksums, dep_graph, get_paths_for, process_easyconfig
from easybuild.tools import config, LooseVersion
from easybuild.tools.build_log import EasyBuildError
Expand Down Expand Up @@ -1084,6 +1087,25 @@ def test_easyconfig_name_clashes(self):
if duplicates:
self.fail("EasyConfigs with case-insensitive name clash: %s" % duplicates)

@skip_if_not_pr_to_non_main_branch()
def test_pr_deprecated_ec_params(self):
"""Check that no deprecated EasyConfig parameters are used."""
deprecated_params = {old_param: new_param
for old_param, (new_param, _) in DEPRECATED_EASYCONFIG_PARAMETERS.items()}
deprecated_params['parallel'] = 'maxparallel'
failing_checks = []
for ec in self.changed_ecs:
pure_ec = ec.parser.get_config_dict()
# Special handling:
for param in pure_ec:
new_param = deprecated_params.get(param)
if new_param:
ec_fn = os.path.basename(ec.path)
failing_checks.append(f"Deprecated parameter '{param}' used in {ec_fn}. "
f"Use '{new_param}' instead.")
if failing_checks:
self.fail("\n".join(failing_checks))

@skip_if_not_pr_to_non_main_branch()
def test_pr_sha256_checksums(self):
"""Make sure changed easyconfigs have SHA256 checksums in place."""
Expand Down

0 comments on commit 93ed7fe

Please sign in to comment.