-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Do not require to set container_platform for running containerised tests
#2537
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
[feat] Do not require to set container_platform for running containerised tests
#2537
Conversation
victorusu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Co-authored-by: Eirini Koutsaniti <eirini.koutsaniti@cscs.ch>
Codecov Report
@@ Coverage Diff @@
## master #2537 +/- ##
==========================================
+ Coverage 85.81% 85.89% +0.08%
==========================================
Files 58 58
Lines 10798 10867 +69
==========================================
+ Hits 9266 9334 +68
- Misses 1532 1533 +1
Continue to review full report at Codecov.
|
This PR improves how tests handle the
container_platformattribute. Users are no more required to set thecontainer_platformin their tests. This will be taken from the defaultcontainer_platformdefined for the current partition in the configuration. Also, this PR brings back theworkdirattribute of the container platform and each backend emits the right option.The documentation and the tutorial are also adapted and a new tutorial example is added which show cases a tests of GROMACS that runs both natively and from different containers.
Implementation details
In order to allow setting the
container_platformattributes in the class body, we have employed the following trick. We assign a bogusContainerPlatformthat implements its abstract methods simply by raising aNotImplementedError. The purpose of this container platform is to hold any attributes set by the user. During the test's setup, when we know the current system partition, we replace thecontainer_platformby creating a concrete one and copying any set attributes from the bogus. This whole mechanism is completely transparent to the users, which they can also set explicitly thecontainer_platformif they wish, as in the past.Fixes #2396.