File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -442,9 +442,9 @@ def run(self,
442442
443443 env = self .environment
444444 vars_to_preserve = runtimeContext .preserve_environment
445- if runtimeContext .preserve_entire_environment is not None :
445+ if runtimeContext .preserve_entire_environment is not False :
446446 vars_to_preserve = os .environ
447- if vars_to_preserve is not None :
447+ if vars_to_preserve :
448448 for key , value in os .environ .items ():
449449 if key in vars_to_preserve and key not in env :
450450 # On Windows, subprocess env can't handle unicode.
Original file line number Diff line number Diff line change 1+ cwlVersion: v1.0
2+ class: CommandLineTool
3+ inputs : []
4+ requirements :
5+ ShellCommandRequirement: {}
6+ baseCommand : echo
7+ arguments :
8+ - valueFrom : >
9+ {\\"env_count\\" : \$(env | wc -l)}
10+ shellQuote : False
11+ stdout : cwl.output.json
12+ outputs :
13+ env_count: int
Original file line number Diff line number Diff line change @@ -931,3 +931,12 @@ def test_optional_numeric_output_0():
931931 assert "completed success" in stderr
932932 assert error_code == 0
933933 assert json .loads (stdout )['out' ] == 0
934+
935+ def test_env_filtering ():
936+ test_file = "tests/env.cwl"
937+ error_code , stdout , stderr = get_main_output (
938+ [get_data (test_file )])
939+
940+ assert "completed success" in stderr
941+ assert error_code == 0
942+ assert json .loads (stdout )['env_count' ] == 4
You can’t perform that action at this time.
0 commit comments