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

-t "command1;command2" doesn't show errors if only command1 fails #108

Open
asmeurer opened this issue May 22, 2012 · 1 comment
Open

-t "command1;command2" doesn't show errors if only command1 fails #108

asmeurer opened this issue May 22, 2012 · 1 comment
Labels

Comments

@asmeurer
Copy link
Member

See sympy/sympy#1258. Something like sympy-bot -t "./bin/test; ./bin/doctest" will report success if the tests fail but the doctests pass, because only the return value from doctest is used. The current workarounds are to either use ./bin/test && ./bin/doctest, which isn't nice because it doesn't run the doctests if the tests fail, or to run two separate sympy-bot commands, which isn't efficient, especially for Python 3 tests (where we are currently forced to use this, due to http://code.google.com/p/sympy/issues/detail?id=2899).

My idea was to let it parse sympy-bot -t "command1" "command2" ..., but it seems that optparse does not support an arbitrary number of arguments to an option. However, argparse, the Python 2.7+ replacement of optparse does. So we have the options:

  • Use argparse and require Python 2.7 to run SymPy-Bot.
  • Run multiple commands like sympy-bot -t "./bin/test" -t "./bin/doctest". I believe this is possible with optparse using the append option.
  • Don't fix this, and just note it as a gotcha.
  • Parse the test command for ; and split it manually.
  • Allow the test command be specified as Python code. This would be straight-forward thanks to the factoring out of run_all_tests from SymPy's setup.py. So you could just run sympy-bot --python-test-command "from sympy.utilities.runtests import run_all_tests; run_all_tests(...)" (... means the keyword arguments to only run the tests you want). We might need to modify that function a little bit to let you disable specific kinds of tests altogether, but it wouldn't be hard.
@asmeurer
Copy link
Member Author

asmeurer commented Nov 8, 2012

We use argparse now. Was this fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant