Skip to content

Commit a89c329

Browse files
rupertnashmr-c
andcommitted
Apply suggestions from code review
Co-authored-by: Michael R. Crusoe <[email protected]>
1 parent 3f6b455 commit a89c329

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[run]
22
branch = True
33
source = cwltool
4+
omit = cwltool/run_job.py
45

56
[report]
67
exclude_lines =

README.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -317,11 +317,11 @@ This file may be specified as either XML or YAML and very simply describes vario
317317
plugins to enable to "resolve" ``SoftwareRequirement`` dependencies.
318318

319319
Using these hints will allow cwltool to modify the environment in
320-
which your tool runs, for example by loading one or more environment
321-
modules. The enviroment is constructed as normal (i.e. standard CWL
320+
which your tool runs, for example by loading one or more Environment
321+
Modules. The environment is constructed as normal (i.e. standard CWL
322322
runtime enviroment, ``EnvVarRequirement``, ``--preserve-environment``
323-
are applied), then this is modified. This currently means that you
324-
cannot override variables set in this way.
323+
are applied), then the environment may modified by the selected tool resolver. This currently means that you
324+
cannot override any environment variables set by the selected tool resolver.
325325

326326
To discuss some of these plugins and how to configure them, first consider the
327327
following ``hint`` definition for an example CWL tool.

tests/test_dependencies.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_bioconda() -> None:
4444
@pytest.mark.skipif(not deps, reason="galaxy-lib is not installed")
4545
@pytest.mark.skipif(not which("modulecmd"), reason="modulecmd not installed")
4646
def test_modules(monkeypatch: pytest.MonkeyPatch) -> None:
47+
"""Do a basic smoke test using environment modules to satisfy a SoftwareRequirement."""
4748
wflow = get_data("tests/random_lines.cwl")
4849
job = get_data("tests/random_lines_job.json")
4950
monkeypatch.setenv(
@@ -65,6 +66,11 @@ def test_modules(monkeypatch: pytest.MonkeyPatch) -> None:
6566
@pytest.mark.skipif(not deps, reason="galaxy-lib is not installed")
6667
@pytest.mark.skipif(not which("modulecmd"), reason="modulecmd not installed")
6768
def test_modules_environment(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
69+
"""
70+
Check that the environment variables set by a module are being propagated correctly.
71+
72+
Do so by by running `env` as the tool and parsing its output.
73+
"""
6874
monkeypatch.setenv(
6975
"MODULEPATH", os.path.join(os.getcwd(), "tests/test_deps_env/modulefiles")
7076
)

0 commit comments

Comments
 (0)