Skip to content

Conversation

@jjotero
Copy link
Contributor

@jjotero jjotero commented Feb 22, 2021

When the LoggerAdapter class calls the attrs method from reframe/utility/__init__.py it retrieves the values of the data descriptors from an object.

With the recent addition of the variable built-in, variables can be set as required (undefined), which means that a call to getattr on these variables will raise an AttributeError. When any of these required variables is not set when LoggerAdapter class attempts to fetch all the descriptors from a test, this raises a very ugly AttributeError.

For this reason, this attrs function from utility must pass if its call to getattr raises an AttributeError.

The unit test has also been changed accordingly.

@jjotero jjotero requested review from ekouts, teojgo and vkarak February 22, 2021 17:28
@jjotero jjotero self-assigned this Feb 22, 2021
@vkarak vkarak added this to the ReFrame 3.5.0 milestone Feb 22, 2021
@vkarak vkarak changed the title [bugfix] Make attrs utility function pass when an AttributeError is raised [bugfix] Make attrs() utility function pass when an AttributeError is raised Feb 23, 2021
Copy link
Contributor

@vkarak vkarak left a comment

Choose a reason for hiding this comment

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

lgtm

@codecov-io
Copy link

Codecov Report

Merging #1802 (70a5edd) into master (c5817eb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1802   +/-   ##
=======================================
  Coverage   87.57%   87.57%           
=======================================
  Files          49       49           
  Lines        7919     7922    +3     
=======================================
+ Hits         6935     6938    +3     
  Misses        984      984           
Impacted Files Coverage Δ
reframe/utility/__init__.py 91.95% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5817eb...70a5edd. Read the comment docs.

@vkarak
Copy link
Contributor

vkarak commented Feb 23, 2021

@jenkins-cscs retry none

@vkarak vkarak merged commit 9d02ba4 into reframe-hpc:master Feb 23, 2021
@jjotero jjotero deleted the bugfix/utility branch February 23, 2021 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants