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

Missing outputs should be recorded as test errors #16094

Conversation

bernt-matthias
Copy link
Contributor

@bernt-matthias bernt-matthias commented May 15, 2023

from planemo the verify_tool function is called from within an try-except block which silently catches any exception.

Thus any exception raised from within verify_tool will not be detected, i.e. the assertion needs to be moved into _verify_outputs (which also seems to make sense by name) in order to make verify_tool record the problem properly.

This only affects tool tests. Guess we do not want to actually forbid tool runs with no outputs.. Even if I don't know what they are used for.

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@bernt-matthias bernt-matthias marked this pull request as draft May 15, 2023 16:58
@github-actions github-actions bot added this to the 23.1 milestone May 15, 2023
@mvdbeek mvdbeek removed this from the 23.1 milestone Jun 21, 2023
@bernt-matthias bernt-matthias marked this pull request as ready for review July 20, 2023 07:56
@github-actions github-actions bot added this to the 23.2 milestone Jul 20, 2023
@bernt-matthias bernt-matthias force-pushed the topic/assert-empty-output branch 3 times, most recently from 3a24616 to 288a6c9 Compare July 31, 2023 15:37
@mvdbeek
Copy link
Member

mvdbeek commented Jul 31, 2023

A minor remark on the PR title: In general it is a good idea for the title to document what the PR does, instead of how you did something (which is pretty clear from the code anyway). So in this case I'd say something like "Make sure that missing outputs are recorded as test errors" helps a lot, both for the docs and the reviewer.

@mvdbeek mvdbeek modified the milestones: 23.2, 24.0 Dec 19, 2023
@jdavcs jdavcs modified the milestones: 24.0, 24.1 Feb 26, 2024
@jdavcs
Copy link
Member

jdavcs commented Feb 26, 2024

@bernt-matthias I'm bumping this to 24.1. Feel free to re-milestone.

- remove the output that is always present
- add a test that has no outputs
from planemo the verify_tool function is called from
[within an try-except block](https://github.com/galaxyproject/planemo/blob/1aa3eb05a97ad20c0be6f6560ab5cec090e76612/planemo/engine/galaxy.py#L109)
which silently catches any exception.

Thus any exception raised from within verify_tool will not be
detected, i.e. the assertion needs to be moved into
`_verify_outputs` (which also seems to make sense by name)
in order to make verify_tool record the problem properly.
thereby we implicitly make the assumption that a test needs to produce
an output

also make message more specific
otherwise the tool test will just return a list out of bounds exception
which is unclear to the user
else:
output_data = data_list[len(data_list) - len(testdef.outputs) + output_index]
except IndexError:
pass
Copy link
Member

Choose a reason for hiding this comment

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

That seems weird, can you add a comment here ? I think that's also why the framework test failed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right. How about 6ee5b09? Hope this makes it clearer. The comment would have been more or less the content of the exception we are recording here.

then it might be clearer what's going on here
@bernt-matthias
Copy link
Contributor Author

Should we target 24.0?

@jdavcs jdavcs changed the title tool verification: move no output assertion Missing outputs should be recorded as test errors Mar 29, 2024
@jdavcs
Copy link
Member

jdavcs commented Mar 29, 2024

@bernt-matthias I'm merging this into dev - I don't think it's a bug (as per discussion above)? I've also edited the title - please feel free to change it if it's not a good summary of the PR. As per this comment, we'd have to manually edit this for the 24.1 release notes.
EDIT: i'm rerunning the failed tests first as a sanity check.

@mvdbeek
Copy link
Member

mvdbeek commented Mar 29, 2024

It is definitely a bug, 24.0 is a good idea

@bernt-matthias
Copy link
Contributor Author

#17873

@bernt-matthias bernt-matthias changed the base branch from dev to release_24.0 April 1, 2024 16:12
@bernt-matthias bernt-matthias changed the base branch from release_24.0 to dev April 1, 2024 16:12
@bernt-matthias
Copy link
Contributor Author

Not sure how to retarget without adding loads of commits?

@jdavcs
Copy link
Member

jdavcs commented Apr 1, 2024

Not sure how to retarget without adding loads of commits?

You should be able to edit the target: click the 'edit' button at the top of the page - it'll let you edit the title AND the base branch: you'll see a drop down list. Select '24.0 release' - it'll ask you to confirm and that's it. There may or may not be conflicts - is that what you were referring to?

@bernt-matthias bernt-matthias changed the base branch from dev to release_24.0 April 1, 2024 16:31
@bernt-matthias
Copy link
Contributor Author

If I do this I get 215 commits.

@jdavcs
Copy link
Member

jdavcs commented Apr 1, 2024

If I do this I get 215 commits.

Oh no! Would you like to do #17873 instead of this (adding the extra commit to it)? i.e., merge it into 24.0 and then, if there are conflicts, manually forward-merge it into dev?

@bernt-matthias bernt-matthias changed the base branch from release_24.0 to dev April 2, 2024 07:33
@bernt-matthias
Copy link
Contributor Author

All this is now in #17874 (had to create a new PR since I force pushed before reopening .. and apparently one cannot reopen in this case).

@bernt-matthias bernt-matthias deleted the topic/assert-empty-output branch April 2, 2024 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants