-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Validate tests after loading them #1599
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] Validate tests after loading them #1599
Conversation
- Tests must provide `valid_systems` and `valid_prog_environs` - Tests must not use generator objects or file objects inside their constructors.
|
Hello @vkarak, Thank you for updating! Cheers! There are no PEP8 issues in this Pull Request!Do see the ReFrame Coding Style Guide Comment last updated at 2020-11-16 15:14:45 UTC |
Codecov Report
@@ Coverage Diff @@
## master #1599 +/- ##
==========================================
+ Coverage 87.48% 87.57% +0.09%
==========================================
Files 45 45
Lines 7127 7244 +117
==========================================
+ Hits 6235 6344 +109
- Misses 892 900 +8
Continue to review full report at Codecov.
|
This PR adds a post-init validation step to the check loader. A test must fulfil the following requirements in order to be loaded:
valid_systems.valid_prog_environs.Implementing (3) without copying the object was quite tricky. I had to implement a validator that recursively descends into the object and checks that every attribute fulfils a condition. The validator examines also any built-in container types element-by-element. The second tricky part was to implement the
is_copyable()condition, i.e., understanding that an object can be copied without doing the actual copy. For this, I had to sneak in thecopy.deepcopy()'s implementation, because, essentially, we want to returnTrueiff the object can be deep-copied.The validation step does not check whether
sanity_patternsis set, because this can be set in a pipeline hook.Fixes #701.
Fixes #795.
Fixes #55.