Skip to content

Forward force_path_paste for non-composite test inputs - #23401

Open
afgane wants to merge 1 commit into
galaxyproject:devfrom
afgane:fix-remote-to-input-force-path-paste
Open

Forward force_path_paste for non-composite test inputs#23401
afgane wants to merge 1 commit into
galaxyproject:devfrom
afgane:fix-remote-to-input-force-path-paste

Conversation

@afgane

@afgane afgane commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Problem

remote_to_input() passes force_path_paste to _get_path_or_location() on
its composite_data branch, but not on the branch immediately below it:

if composite_data := test_data["composite_data"]:
    tool_input["composite_data"] = [
        self._get_path_or_location(
            ...
            force_path_paste=force_path_paste,   # forwarded here
        ).path
        for fname_ in composite_data
    ]
else:
    path_or_location = self._get_path_or_location(
        fname,
        test_data,
        tool_id,
        tool_version=tool_version,               # ...but not here
        mode="file" if tool_input["class"].lower() == "file" else "directory",
    )

So galaxy-tool-test --force_path_paste has been silently ignored for ordinary
single-file inputs — the far commoner case — and those inputs fall through to
the client-upload path regardless of the flag.

Fix

Add the missing keyword argument.

Tests

There was no coverage of force_path_paste anywhere, so this adds two
parametrised tests in test/unit/tool_util/verify/test_interactor.py, one per
branch, since the bug is precisely that the two branches disagree. They record
what _get_path_or_location is called with rather than standing up an
interactor, as none of GalaxyInteractorApi.__init__'s connection setup is
relevant to argument forwarding.

Verified on Python 3.10 that the non-composite pair fails without the fix and
passes with it, while the composite pair passes either way.

@jmchilton jmchilton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is conflicted and needs a rebase or merge - but it is ready to be merged after that.

remote_to_input() passes force_path_paste to _get_path_or_location() on its
composite_data branch but not on the branch immediately below it, so
galaxy-tool-test's --force_path_paste has been silently ignored for ordinary
single-file inputs - the far commoner case. Those inputs fall through to the
client-upload path regardless of the flag.

Add the missing keyword argument, and cover both branches with tests. The
tests record what _get_path_or_location is called with rather than standing up
an interactor, since none of GalaxyInteractorApi's connection setup is
relevant to argument forwarding. Confirmed they fail against the current code
and pass with the fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@afgane
afgane force-pushed the fix-remote-to-input-force-path-paste branch from a120563 to 3b0b745 Compare September 5, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants