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

Test failure when running on a Vagrant VM #3306

Closed
cameronneylon opened this issue May 11, 2013 · 5 comments
Closed

Test failure when running on a Vagrant VM #3306

cameronneylon opened this issue May 11, 2013 · 5 comments
Milestone

Comments

@cameronneylon
Copy link

Have been working on creating a very simple Vagrant setup to run an iPythonNotebook. Two issues seem to come up.

The first is that easy_install does not seem to actually install all the required dependencies in this context. Neither build-essential nor tornado seem to be installed via:

$ easy_install ipython[zmq,qtconsole,notebook,test]

This is relatively easily fixed by explcitly installing the dependencies. With the following script everything gets installed and appears to work correctly:

# Provisioning script for a Vagrant VM running iPythonNotebook

# Obtain curl and install setuptools and pip
sudo apt-get -y install curl
curl https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg#md5=fe1f997bc722265116870bc7919059ea > setuptools-0.6c11-py2.7.egg
sudo sh setuptools-0.6c11-py2.7.egg
sudo easy_install pip

#Install Python headers and development requirements
sudo apt-get -y install python-dev
sudo apt-get -y install build-essential

# Get ipython and dependencies
echo Installing iPython and dependencies...
pip install tornado
sudo pip install pyzmq
pip install nose
pip install Pygments
pip install ipython
iptest -q

# Make a directory to play in
echo Setting up a directory
mkdir ipynb
cd ipynb

# Runup the notebook
echo Running up the notebook instance
ipython notebook --ip=192.168.33.10

However one test fails in this context. Not sure it matters very much but providing for completeness:

 FAIL: IPython.utils.tests.test_path.test_not_writable_ipdir
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python2.7/dist-packages/IPython/testing/decorators.py", line 228, in skipper_func
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/IPython/utils/tests/test_path.py", line 397, in test_not_writable_ipdir
    ipdir = path.get_ipython_dir()
  File "/usr/local/lib/python2.7/dist-packages/IPython/testing/tools.py", line 359, in __exit__
    assert self.s in printed, notprinted_msg.format(self.s, self.channel, printed)
AssertionError: Did not find 'is not a writable location' in printed output (on stderr):
u''
    <IPython.testing.tools.AssertPrints object at 0x1dd1f50>.tee.flush()
    setattr(<module 'sys' (built-in)>, <IPython.testing.tools.AssertPrints object at 0x1dd1f50>.channel, <IPython.testing.tools.AssertPrints object at 0x1dd1f50>.orig_stream)
    u'' = <IPython.testing.tools.AssertPrints object at 0x1dd1f50>.buffer.getvalue()
>>  assert <IPython.testing.tools.AssertPrints object at 0x1dd1f50>.s in u'', 'Did not find {0!r} in printed output (on {1}):\n{2!r}'.format(<IPython.testing.tools.AssertPrints object at 0x1dd1f50>.s, <IPython.testing.tools.AssertPrints object at 0x1dd1f50>.channel, u'')
    return False
@juliantaylor
Copy link
Contributor

this is a known failure when run with root rights, it does not have any consequences for runtime. you can skip it with

iptest -e test_not_writable_ipdir

btw, on debian based systems you are better of simply doing:

apt-get install ipython-notebook

it will install all required dependencies from authenticated sources.
add -t precise-backports if you are on ubuntu 12.04

@minrk
Copy link
Member

minrk commented May 11, 2013

Thanks, @juliantaylor.

@minrk minrk closed this as completed May 11, 2013
@cameronneylon
Copy link
Author

Thanks for the prompt response.

Just for the idiot noobs (like myself) trying this. If taking the apt-get approach suggested here you also need to issue an apt-get update beforehand to ensure all the correct packages are available.

The script is much simpler now. The linked provisioning shell script also returns control back to the host shell from the VM. For some reason iptest dosen't install under these conditions:

https://gist.github.com/cameronneylon/5566750

@juliantaylor
Copy link
Contributor

The package does not install the ipython tests. In principle the packages are already tested and as long as you don't mess to bad with your system should continue to work.
You can still run the test if you like by doing this:

apt-get install xauth xvfb python-nose
apt-get source ipython -t precise-backports
cd ipython-0.13.2
ADTTMP=$(mktemp -d) debian/tests/python2
# for more test dependencies see debian/tests/control

@lusitania
Copy link

If this is a known issue I suppose the test should reflect this in a way. After over a year this issue startles (me) and only searching Github helps. I suggest that you at least add a comment to the test case (referencing the original issue id).

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

No branches or pull requests

4 participants