Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for computational_resources module. #448

Merged
merged 5 commits into from
Mar 16, 2023

Conversation

yakutovicha
Copy link
Member

fixes #447

@yakutovicha yakutovicha marked this pull request as draft March 15, 2023 16:19
@codecov
Copy link

codecov bot commented Mar 15, 2023

Codecov Report

Patch coverage: 98.87% and project coverage change: +10.81 🎉

Comparison is base (130457e) 39.69% compared to head (74f4751) 50.50%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master     #448       +/-   ##
===========================================
+ Coverage   39.69%   50.50%   +10.81%     
===========================================
  Files          20       21        +1     
  Lines        3162     3249       +87     
===========================================
+ Hits         1255     1641      +386     
+ Misses       1907     1608      -299     
Flag Coverage Δ
python-3.10 50.50% <98.87%> (+10.81%) ⬆️
python-3.8 50.53% <98.87%> (+10.83%) ⬆️
python-3.9 50.53% <98.87%> (+10.83%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiidalab_widgets_base/__init__.py 100.00% <ø> (ø)
aiidalab_widgets_base/computational_resources.py 70.55% <83.33%> (+51.15%) ⬆️
tests/conftest.py 63.04% <100.00%> (+1.24%) ⬆️
tests/test_computational_resources.py 100.00% <100.00%> (ø)

... 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.

@yakutovicha yakutovicha marked this pull request as ready for review March 15, 2023 16:24
@danielhollas
Copy link
Contributor

Just FYI there is this known bug for creating a new localhost computer. Not sure if you've run into it while testng

#417

I'll leave this review to @unkcpz since he's been working on this widget a lot.

@danielhollas danielhollas removed their request for review March 16, 2023 10:10
@yakutovicha
Copy link
Member Author

Just FYI there is this known bug for creating a new localhost computer. Not sure if you've run into it while testng

I prefer to fix that bug in a follow-up PR.

Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

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

@yakutovicha thanks a lot for testing this, very helpful. Just one request, all are good to me.

assert widget.on_setup_computer()

# Check that the computer is created.
computer = orm.load_computer("daint")
Copy link
Member

Choose a reason for hiding this comment

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

In this widget we combine setup phase and configuration phase, is this test still valid if the computer is setup but not run with configure? I think for in this test, we need to test and make sure the configure phase is hint and the computer in the DB is ready to use.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, @unkcpz. But the current widget is simply not supporting this use case. It deserves a PR on its own. Is it ok if we do that as a follow-up?

Copy link
Member

@unkcpz unkcpz Mar 16, 2023

Choose a reason for hiding this comment

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

Ah, I see, it is not possible to do it with the widget. I'd propose if you don't provide the configuration in the dict above it will fail in the configuration stage and you test the exception raised.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion, done in 74f4751.

Just one clarification: I guess we don't want the visuals to raise an exception. They should rather print a message.

Copy link
Member

@unkcpz unkcpz Mar 16, 2023

Choose a reason for hiding this comment

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

I guess we don't want the visuals to raise an exception. They should rather print a message.

Indeed. 👍 The change looks great, thanks!

@yakutovicha yakutovicha requested a review from unkcpz March 16, 2023 16:23
Copy link
Member

@unkcpz unkcpz left a comment

Choose a reason for hiding this comment

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

It is all good from my side, thanks again this is very important test!

@unkcpz unkcpz merged commit 970b5e1 into master Mar 16, 2023
@unkcpz unkcpz deleted the chore/test-and-update-computational-resources branch March 16, 2023 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test computational_resources module
3 participants