Skip to content

fix failure to resolve templates in tests easyconfig parameter#4994

Merged
boegel merged 1 commit intoeasybuilders:developfrom
Flamefire:template-failure-fix
Sep 10, 2025
Merged

fix failure to resolve templates in tests easyconfig parameter#4994
boegel merged 1 commit intoeasybuilders:developfrom
Flamefire:template-failure-fix

Conversation

@Flamefire
Copy link
Copy Markdown
Contributor

The check whether to run the test(cases) step accesses an easyconfig parameter which might include template %(installdir)s which isn't available at this point.
Just check the raw value as we only care about whether it is set.

Fixes #4990

I'm wondering if we should include backtraces because with that it is easy to find the error (replaced EasyBuildError by RuntimeError):

  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/main.py", line 161, in build_and_install_software
    (ec_res['success'], app_log, err_msg, err_code) = build_and_install_one(ec, init_env)
  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/framework/easyblock.py", line 5057, in build_and_install_one
    run_test_cases = not build_option('skip_test_cases') and app.cfg['tests']
  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py", line 142, in new_ec_method
    return ec_method(self, key, *args, **kwargs)
  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py", line 1885, in __getitem__
    value = self.resolve_template(value)
  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py", line 1869, in resolve_template
    return resolve_template(value, self.template_values, expect_resolved=self.expect_resolved_template_values)
  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py", line 2228, in resolve_template
    value = [resolve_template(val, tmpl_dict, expect_resolved) for val in value]
  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py", line 2228, in <listcomp>
    value = [resolve_template(val, tmpl_dict, expect_resolved) for val in value]
  File "/home/s3248973/.local/EasyBuildDev/easybuild-framework/easybuild/framework/easyconfig/easyconfig.py", line 2206, in resolve_template
    raise RuntimeError(msg)

The check whether to run the test(cases) step accesses an easyconfig
parameter which might include template `%(installdir)s` which isn't
available at this point.
Just check the raw value as we only care about whether it is set.

Fixes easybuilders#4990
@boegel boegel added the bug fix label Sep 10, 2025
@boegel boegel added this to the next release (5.1.2) milestone Sep 10, 2025
Copy link
Copy Markdown
Member

@boegel boegel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@boegel
Copy link
Copy Markdown
Member

boegel commented Sep 10, 2025

I'm wondering if we should include backtraces because with that it is easy to find the error

I definitely wouldn't always do that, since most end users of EasyBuild would be "scared" by huge backtraces always being included, but maybe we can add an EasyBuild configuration option to opt-in to getting backtraces?

In any case, to be followed up in a separate issue/PR, this is trivial enough to squeeze in for EasyBuild v5.1.2...

@boegel boegel enabled auto-merge September 10, 2025 09:37
@boegel boegel merged commit 73f25e3 into easybuilders:develop Sep 10, 2025
46 of 47 checks passed
@Flamefire Flamefire deleted the template-failure-fix branch September 10, 2025 12:15
@boegel boegel changed the title Fix failure to resolve template in tests fix failure to resolve templates in tests easyconfig parameter Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

use of %(installdir)s template results in "Failed to resolve all templates"

2 participants