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

some refactoring to the unit tests, adding cases for slurm #104

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

djarecka
Copy link
Collaborator

@djarecka djarecka commented Jun 7, 2023

some refactoring of the tests and adding slurm

I've tried to slightly simplified the test functions and separate issues (e.g. asserts errors) that comes from potential issues in babs code and from the fact that someone added a testing case that is not covered by the examples of the configuration file.

I've also moved some some information to function arguments (and pytest.mark.parametrize), so it's easier to see right away what is expected and what should be provided if more test cases are added.

Of course, feel free to revert some/all the changes, I've also left a couple questions.

Copy link
Collaborator

@zhao-cy zhao-cy left a comment

Choose a reason for hiding this comment

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

@djarecka Hey Dorota! I've replied your todo s - let me know if I missed anything? Happy to clarify more!


# TODO: should we just point to a dir in tmp_path? the assert should not be needed
Copy link
Collaborator

Choose a reason for hiding this comment

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

The environmental variable TEMPLATEFLOW_HOME will be used by babs-init to generate the correct command for singularity run, where the path specified in TEMPLATEFLOW_HOME will be bound. Therefore this env var is needed. The assert here is just to make sure that the env var was set successfully in the line above assert. I understand this might seem a bit redundant to check, but that's easier for debugging (i.e., if it passes this assert, then the env var setting was not wrong).

tests/get_data.py Outdated Show resolved Hide resolved
tests/test_babs_check_setup.py Outdated Show resolved Hide resolved
tests/test_babs_check_setup.py Show resolved Hide resolved
babs/utils.py Outdated
@@ -16,6 +16,9 @@
from datetime import datetime
import re


TYPE_SYSTEM_SUPPORTED = ['sge', 'slurm']
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a good idea! Do you mind moving this "constant" variable into babs/constants.py and importing it here? That python file holds several constant variables.

@djarecka
Copy link
Collaborator Author

sorry, completely forgot that I was planning just remove some comments

it's ready to merge, if you like it

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.

2 participants