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

include tests #4499

Merged
merged 3 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,9 @@ def run_setup():
install_requires=install_requires,
extras_require=extras_require,
package_dir={'': 'src'},
packages=find_packages(where='src',
# Note that we intentionally include the top-level `test` package for
# functionality like the @experimental and @integrative decorators:
exclude=['*.test.*']),
packages=find_packages(where='src'),
package_data={
'': ['*.yml', '*.yaml', 'cloud-config'],
'': ['*.yml', '*.yaml', 'cloud-config', '*.cwl'],
},
# Unfortunately, the names of the entry points are hard-coded elsewhere in the code base so
# you can't just change them here. Luckily, most of them are pretty unique strings, and thus
Expand Down
3 changes: 3 additions & 0 deletions src/toil/lib/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ def call_command(cmd: List[str], *args: str, input: Optional[str] = None, timeou
:returns: Command standard output, decoded as utf-8.
"""

# NOTE: Interface MUST be kept in sync with call_sacct and call_scontrol in
# test_slurm.py, which monkey-patch this!

# using non-C locales can cause GridEngine commands, maybe other to
# generate errors
if useCLocale:
Expand Down
6 changes: 4 additions & 2 deletions src/toil/test/batchSystems/test_slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
from toil.lib.misc import CalledProcessErrorStderr
from toil.test import ToilTest

# TODO: Come up with a better way to mock the commands then monkey-patching the
# command-calling functions.

def call_sacct(args) -> str:
def call_sacct(args, **_) -> str:
"""
The arguments passed to `call_command` when executing `sacct` are:
['sacct', '-n', '-j', '<comma-separated list of job-ids>', '--format',
Expand Down Expand Up @@ -41,7 +43,7 @@ def call_sacct(args) -> str:
return stdout


def call_scontrol(args) -> str:
def call_scontrol(args, **_) -> str:
"""
The arguments passed to `call_command` when executing `scontrol` are:
['scontrol', 'show', 'job'] or ['scontrol', 'show', 'job', '<job-id>']
Expand Down