Skip to content

[feat] Support custom indexed and external references#3630

Merged
vkarak merged 6 commits intoreframe-hpc:developfrom
vkarak:feat/multikeyref
Mar 23, 2026
Merged

[feat] Support custom indexed and external references#3630
vkarak merged 6 commits intoreframe-hpc:developfrom
vkarak:feat/multikeyref

Conversation

@vkarak
Copy link
Copy Markdown
Contributor

@vkarak vkarak commented Feb 24, 2026

This PR extends the test's reference syntax to support arbitrary indexing on test attributes as well as other configuration parameters, such as the current partition, environment, processor and/or device details. If no special indexing is requested, the reference dictionary behaves exactly as before.

Support for external reference files is also added, where the reference dict of a test can be in an external YAML file.

Check the docs for all the details of the new features.

Implementation details

The test's prefix is now passed as a metaclass parameter and is not set during the test's initialization. This was needed to support the default external reference prefix, which coincides with the test's prefix, so we needed the test's prefix to be available during class creation and when the reference is defined in the test class body.
Since the test prefix is known during the class creation it is more natural to move there. Also all prefix manipulations are handled in single place now.

Closes #3463

@codecov
Copy link
Copy Markdown

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 95.94595% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.70%. Comparing base (c9fa4c7) to head (4f236d4).
⚠️ Report is 7 commits behind head on develop.

Files with missing lines Patch % Lines
reframe/core/pipeline.py 96.01% 8 Missing ⚠️
reframe/frontend/testgenerators.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3630      +/-   ##
===========================================
+ Coverage    91.64%   91.70%   +0.06%     
===========================================
  Files           62       62              
  Lines        13530    13713     +183     
===========================================
+ Hits         12399    12576     +177     
- Misses        1131     1137       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vkarak vkarak requested a review from gppezzi March 11, 2026 14:40
Copy link
Copy Markdown
Contributor

@victorusu victorusu left a comment

Choose a reason for hiding this comment

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

lgtm

@github-project-automation github-project-automation bot moved this from Todo to In Progress in ReFrame Backlog Mar 15, 2026
@vkarak
Copy link
Copy Markdown
Contributor Author

vkarak commented Mar 20, 2026

Giving it a final testing round on our actual tests, I discovered a bug. If a reference with external references is set in the test class body, it crashes. This was not caught by the unit tests because, they were setting the reference after the test instantiation. I changed the unit tests to reproduce the error, and now working on fixing it.

@vkarak vkarak force-pushed the feat/multikeyref branch from 5149b44 to 327e59f Compare March 20, 2026 23:31
@vkarak vkarak force-pushed the feat/multikeyref branch from 327e59f to eaa61f4 Compare March 23, 2026 15:56
@vkarak
Copy link
Copy Markdown
Contributor Author

vkarak commented Mar 23, 2026

Still not merging; I discovered a bug in the prefix calculation when the make_test() is used. I'm adding a unit test to reproduce it.

@vkarak vkarak merged commit 1eee4f9 into reframe-hpc:develop Mar 23, 2026
32 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in ReFrame Backlog Mar 23, 2026
@vkarak vkarak deleted the feat/multikeyref branch March 23, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Allow references to be indexed arbitrarily

2 participants