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

nosetests: use /usr/bin/env to find nosetests #12091

Merged
merged 1 commit into from Jan 10, 2017

Conversation

wjwithagen
Copy link
Contributor

@wjwithagen wjwithagen commented Nov 21, 2016

  • Options are not required, so do not pass them to the script.

Signed-off-by: Willem Jan Withagen wjw@digiware.nl


[ ! -z $CEPH_ROOT ] || exit 1

PYBIND=$CEPH_ROOT/src/pybind /usr/local/bin/nosetests --stop $CEPH_ROOT/src/test/pybind/test_ceph_argparse.py
Copy link
Contributor

Choose a reason for hiding this comment

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

test_ceph_argparse.py does not use ${PYBIND}, i think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tchaikov
Eh, that could be that case.
I first did the daemon case, and then copied the wrapper.
Even considered make it a generic one in taking arg0 and rewrite it to basename + .py.
What is your preference: ONE generic one, or that I check PYBIND usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tchaikov
Could you please indicate which solution you prefer here?
I'll fix, and submit, so this one can be merged..

Copy link
Contributor

Choose a reason for hiding this comment

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

@wjwithagen i think the root cause might be that the shebang line in src/test/pybind/test_ceph_daemon.py assume that nosetests is located in /usr/bin. while on your FreeBSD installation, it's not the case.

as to PYBIND, it's not necessary. as the cmake function add_ceph_test() takes care of the pybinding path already by setting PYTHONPATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/cython_modules/lib.${PYTHON${PYTHON_VERSION}_VERSION_MAJOR}:${CMAKE_SOURCE_DIR}/src/pybind.

instead of using #!/usr/bin/nosetest --nocapture, probably we can just use #!/usr/bin/env nosetests. because shebang line does not support more than two or more parameters. i guess it's safe to remove the --nocapture option. it does not hurt to read the captured message sent to stdout along with the error message. @dachary what do you think?

Copy link

Choose a reason for hiding this comment

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

@tchaikov I agree that it is safe to remove the --nocapture option

Copy link

Choose a reason for hiding this comment

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

@wjwithagen I agree with @tchaikov, it would be better to just use #!/usr/bin/env nosetest to resolve that issue. It is simpler and looks like it would work for FreeBSD as well.

@ghost ghost added the tests label Nov 23, 2016
@tchaikov tchaikov self-assigned this Jan 4, 2017
@tchaikov tchaikov requested a review from a user January 6, 2017 08:44
ghost
ghost previously requested changes Jan 10, 2017

[ ! -z $CEPH_ROOT ] || exit 1

PYBIND=$CEPH_ROOT/src/pybind /usr/local/bin/nosetests --stop $CEPH_ROOT/src/test/pybind/test_ceph_argparse.py
Copy link

Choose a reason for hiding this comment

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

@tchaikov I agree that it is safe to remove the --nocapture option


[ ! -z $CEPH_ROOT ] || exit 1

PYBIND=$CEPH_ROOT/src/pybind /usr/local/bin/nosetests --stop $CEPH_ROOT/src/test/pybind/test_ceph_argparse.py
Copy link

Choose a reason for hiding this comment

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

@wjwithagen I agree with @tchaikov, it would be better to just use #!/usr/bin/env nosetest to resolve that issue. It is simpler and looks like it would work for FreeBSD as well.

@tchaikov tchaikov assigned wjwithagen and unassigned tchaikov Jan 10, 2017
@wjwithagen
Copy link
Contributor Author

@dachary @tchaikov
I do like KISS as well, so I'll start with /usr/bin/env and see if that works.

 - Option nocapture is not really required so no problem
   with the fact that FreeBSD env does not work for params
   for nosetests

Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
@wjwithagen wjwithagen changed the title nosetests: FreeBSD /usr/bin/env does not set the options correct nosetests: use /usr/bin/env to find noestests Jan 10, 2017
@wjwithagen
Copy link
Contributor Author

@dachary @tchaikov
Run nicely in my wip with env and without options..

@tchaikov tchaikov assigned tchaikov and unassigned wjwithagen Jan 10, 2017
@tchaikov
Copy link
Contributor

Reviewed-by: once jenkins is back and green.

@tchaikov tchaikov dismissed ghost ’s stale review January 10, 2017 16:41

the latest change addressed the comment.

@tchaikov tchaikov changed the title nosetests: use /usr/bin/env to find noestests nosetests: use /usr/bin/env to find nosetests Jan 10, 2017
@tchaikov tchaikov merged commit 7b8eca5 into ceph:master Jan 10, 2017
@wjwithagen wjwithagen deleted the wip-wjw-nosetests branch January 11, 2017 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants