Skip to content

Conversation

@vkarak
Copy link
Contributor

@vkarak vkarak commented Mar 11, 2023

This PR fixes the same problem for all other TimerField variables.

To allow setting these fields properly from the command line, we get rid of the TimerField and replace it with the augmented type Duration, which is similar in concept with the Bool type. This type allows conversion from floats, int and strings and applies essentially the logic of the former TimerField. Since for this field we want to allow conversions also when it's set from inside the test, e.g., time_limit = '10s', we add a new argument allow_implicit to the TypedField constructor (also exposed through the variable builtin), which make the field try implicit conversions before assigning the value to the test attribute. Therefore a variable declared as x = variable(int, allow_implicit=True) can be set with either x = 1 or x = '1'.

Closes #2815.

@vkarak vkarak added this to the ReFrame 4.2 milestone Mar 11, 2023
@vkarak vkarak requested review from ekouts and teojgo March 11, 2023 18:54
@vkarak vkarak self-assigned this Mar 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Mar 11, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (f1b0b15) 86.76% compared to head (6835b6d) 86.79%.

❗ Current head 6835b6d differs from pull request most recent head cc83890. Consider uploading reports for the commit cc83890 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2823      +/-   ##
==========================================
+ Coverage   86.76%   86.79%   +0.03%     
==========================================
  Files          60       60              
  Lines       11351    11348       -3     
==========================================
+ Hits         9849     9850       +1     
+ Misses       1502     1498       -4     
Impacted Files Coverage Δ
reframe/core/fields.py 97.19% <100.00%> (-0.37%) ⬇️
reframe/core/pipeline.py 93.88% <100.00%> (ø)
reframe/core/schedulers/__init__.py 98.38% <100.00%> (-0.01%) ⬇️
reframe/utility/typecheck.py 97.35% <100.00%> (+2.49%) ⬆️

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@vkarak vkarak merged commit 8558818 into reframe-hpc:master Mar 13, 2023
@vkarak vkarak deleted the bugfix/time_limit-cli branch March 13, 2023 15:09
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.

4 participants