galaxyproject / galaxyproject/planemo
planemo shed_diff does not set return value if differences found
- Dominant language
- Python
- Stars
- 110
- Forks
- 102
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 13
Description
```
$ planemo --version
planemo, version 0.14.1.dev0
$ planemo shed_diff --fail_fast -t testtoolshed packages/package_mira_3_4_1_1/ ; echo "Returned $?"
Diffing repository package_mira_3_4_1_1
wget -q --recursive -O - 'https://testtoolshed.g2.bx.psu.edu/repository/download?repository_id=d9693259f6de6944&changeset_revision=default&file_type=gz' | tar -xzf - -C /tmp/tool_shed_diff_cuPMTH/_testtoolshed_ --strip-components 1
mkdir "/tmp/tool_shed_diff_cuPMTH/_local_"; tar -xzf "/tmp/tmpEN6BMK" -C "/tmp/tool_shed_diff_cuPMTH/_local_"; rm -rf /tmp/tmpEN6BMK
cd "/tmp/tool_shed_diff_cuPMTH"; diff -r _local_ _testtoolshed_
Returned 0
```
Above example had no changes, return value 0.
```
$ planemo shed_diff --fail_fast -t toolshed packages/package_mira_3_4_1_1/ ; echo "Returned $?"
Diffing repository package_mira_3_4_1_1
wget -q --recursive -O - 'https://toolshed.g2.bx.psu.edu/repository/download?repository_id=26e439d9fbdd2237&changeset_revision=default&file_type=gz' | tar -xzf - -C /tmp/tool_shed_diff_0qDu52/_toolshed_ --strip-components 1
mkdir "/tmp/tool_shed_diff_0qDu52/_local_"; tar -xzf "/tmp/tmpB_dTVz" -C "/tmp/tool_shed_diff_0qDu52/_local_"; rm -rf /tmp/tmpB_dTVz
text: 'echo "via https://github.com/peterjc/galaxy_mira/issues - thank you!"' != 'echo "via https://github.com/peterjc/pico_galaxy/issues - thank you!"'children 6 do not match: actionchildren 2 do not match: actionschildren 1 do not match: actions_groupchildren 1 do not match: installchildren 1 do not match: packagecd "/tmp/tool_shed_diff_0qDu52"; diff -r _local_ _toolshed_
Returned 0
```
Above example had changes, but still return value 0.
Following the Unix `diff` command, I expected 0 for no differences were found, 1 for differences were found, and >1 for an error.
For background, I want to try using this as part of a continuous intregration plan - see also #7.
Bonus points: Adding a `diff` like `-q` or `--brief` option simply reporting whether files differ.
Contributor guide
Research direction
Start at the planemo shed_diff command and trace how the Unix diff invocation's status is handled. Reproduce the two command examples, then verify that no differences, differences, and errors produce the expected exit statuses; the work is done when the command reports those statuses reliably for CI use.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100