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

Duplicate kwargs in bash_app call rather than modifying reusable dict #1413

Merged
merged 2 commits into from
Oct 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 4 additions & 3 deletions parsl/app/bash.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ def __call__(self, *args, **kwargs):
App_fut

"""
# Update kwargs in the app definition with ones passed in at calltime
self.kwargs.update(kwargs)
invocation_kwargs = {}
invocation_kwargs.update(self.kwargs)
invocation_kwargs.update(kwargs)

if self.data_flow_kernel is None:
dfk = DataFlowKernelLoader.dfk()
Expand All @@ -158,6 +159,6 @@ def __call__(self, *args, **kwargs):
executors=self.executors,
fn_hash=self.func_hash,
cache=self.cache,
**self.kwargs)
**invocation_kwargs)

return app_fut
12 changes: 5 additions & 7 deletions parsl/tests/test_bash_apps/test_kwarg_storage.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import os
import pytest

from parsl.app.app import App


@App('bash')
def foo(z=2, stdout=None):
return """echo {val} {{z}}
return """echo {val}
""".format(val=z)


@pytest.mark.xfail(reason="This failing test demonstrates issue #1058", strict=True)
def test_command_format_1():
"""Testing command format for BashApps
"""
Expand All @@ -33,7 +31,7 @@ def test_command_format_1():
if os.path.exists('stdout_file'):
os.remove(stdout)

assert contents == '2 2\n', 'Output does not match expected string "2 2", Got: "{0}"'.format(
assert contents == '2\n', 'Output does not match expected string "2", Got: "{0}"'.format(
contents)

# ===========
Expand All @@ -56,7 +54,7 @@ def test_command_format_1():
if os.path.exists('stdout_file'):
os.remove(stdout)

assert contents == '3 3\n', 'Output does not match expected string "3 3", Got: "{0}"'.format(
assert contents == '3\n', 'Output does not match expected string "3", Got: "{0}"'.format(
contents)

# ===========
Expand All @@ -78,7 +76,7 @@ def test_command_format_1():
if os.path.exists('stdout_file'):
os.remove(stdout)

assert contents == '4 4\n', 'Output does not match expected string "4 4", Got: "{0}"'.format(
assert contents == '4\n', 'Output does not match expected string "4", Got: "{0}"'.format(
contents)

# ===========
Expand All @@ -100,6 +98,6 @@ def test_command_format_1():
if os.path.exists('stdout_file'):
os.remove(stdout)

assert contents == '2 2\n', 'Output does not match expected string "2 2", Got: "{0}"'.format(
assert contents == '2\n', 'Output does not match expected string "2", Got: "{0}"'.format(
contents)
return True