idaholab / raven

RAVEN is a flexible and multi-purpose probabilistic risk analysis, validation and uncertainty quantification, parameter optimization, model reduction and data knowledge-discovering framework.
https://raven.inl.gov/
Apache License 2.0
217 stars 133 forks source link

[DEFECT] run_tests fails to correctly forward arguments with spaces to rook #2338

Closed caleb-sitton-inl closed 1 month ago

caleb-sitton-inl commented 2 months ago

Thank you for the defect report

Defect Description

run_tests does not correctly process command line arguments with spaces that need to be forwarded to rook. Such multi-word arguments are contained in double quotes (e.g., ./run_tests --arg-for-rook="content to be passed to rook". When placed in a string variable (ROOK_COMMAND) that is called as a command, these quotation marks are lost instead of transferred to the rook command called. This yields python rook/main.py --arg-for-rook=content to be passed to rook. rook/main.py then tries to parse its arguments and fails because it does not recognize to, be, etc. as known command line arguments.

This causes problems in the PluginAPI section as well as in the Plugins section, since in these two sections the rook command is placed in a string variable.

Steps to Reproduce

Call run_tests with a command line argument that has spaces and is not recognized by run_tests. A relatively simple, practical example is shown in the screenshot below.

Expected Behavior

run_tests should forward the multi-word argument to rook while preserving the quotation marks. To use the example above, rook should be called with python rook/main.py --arg-for-rook="content to be passed to rook". In the screenshot below, code coverage should be run on the tests to which the input refers.

Screenshots and Input Files

Screenshot 2024-07-08 at 8 42 05 AM

OS

MacOS

OS Version

No response

Dependency Manager

CONDA

For Change Control Board: Issue Review

For Change Control Board: Issue Closure