Commit f051d0be authored by Łukasz Nowak's avatar Łukasz Nowak

Implement real test.

For now it is done by using external networkcache server. Integration of
simulator is WIP.
parent 40e9171f
Using buildout with cache over network
======================================
Note: We are in process of preparing docs. This is only showcase.
Networkcache in buildout is optional, and during normal run no information
is shown:
>>> write(sample_buildout, 'buildout.cfg',
... '''
... [buildout]
... parts =
... ''')
>>> print system(buildout)
But whenever networkcache configuration is enabled, it is possible to use it:
>>> write(sample_buildout, 'buildout.cfg',
... '''
......@@ -13,35 +23,40 @@ Note: We are in process of preparing docs. This is only showcase.
...
... [eggs]
... recipe = zc.recipe.egg:eggs
... eggs = demo ==0.2
... eggs = demoneeded ==1.2c1
...
... [networkcache]
... download-cache-url = http://127.0.0.1:1/
... download-dir-url = http://127.0.0.1:1/
... upload-cache-url = http://127.0.0.1:1/
... upload-dir-url = http://127.0.0.1:1/
... download-cache-url = http://127.0.0.1:8000/shacache
... download-dir-url = http://127.0.0.1:8000/shadir
... upload-cache-url = http://127.0.0.1:8000/shacache
... upload-dir-url = http://127.0.0.1:8000/shadir
... ''' % globals())
>>> print system(buildout)
Networkcache enabled.
Networkcache download cache: 'http://127.0.0.1:8000/shacache', directory 'http://127.0.0.1:8000/shadir'
Networkcache upload cache: 'http://127.0.0.1:8000/shacache', directory 'http://127.0.0.1:8000/shadir'
Installing eggs.
Getting distribution for 'demoneeded==1.2c1'.
Downloading demoneeded-1.2c1.zip from network cache.
Failed to download from network cache demoneeded-1.2c1.zip:
Uploading http://localhost:28922/demoneeded-1.2c1.zip into network cache.
Got demoneeded 1.2c1.
<BLANKLINE>
Now lets clean up buildout directory:
>>> from glob import glob
>>> from os.path import join
>>> for egg in glob(join(sample_buildout, 'eggs', 'demoneeded*.egg')):
... remove(sample_buildout, 'eggs', egg)
>>> import os, glob
>>> [remove(q) for q in glob.glob(os.path.join(sample_buildout, 'eggs', 'demoneeded*'))]
[None]
>>> remove('.installed.cfg')
And run it again, data will be downloaded from networkcache:
>>> print system(buildout)
Networkcache enabled.
Networkcache download cache: 'http://127.0.0.1:1/', directory 'http://127.0.0.1:1/'
Networkcache upload cache: 'http://127.0.0.1:1/', directory 'http://127.0.0.1:1/'
Networkcache download cache: 'http://127.0.0.1:8000/shacache', directory 'http://127.0.0.1:8000/shadir'
Networkcache upload cache: 'http://127.0.0.1:8000/shacache', directory 'http://127.0.0.1:8000/shadir'
Installing eggs.
Getting distribution for 'demo==0.2'.
Downloading demo-0.2-py2.7.egg from network cache.
Failed to download from network cache demo-0.2-py2.7.egg: [Errno 111] Connection refused
Uploading http://localhost/demo-0.2-py2.7.egg into network cache.
Fail to upload file. [Errno 111] Connection refused
Got demo 0.2.
Getting distribution for 'demoneeded'.
Getting distribution for 'demoneeded==1.2c1'.
Downloading demoneeded-1.2c1.zip from network cache.
Failed to download from network cache demoneeded-1.2c1.zip: [Errno 111] Connection refused
Uploading http://localhost/demoneeded-1.2c1.zip into network cache.
Fail to upload file. [Errno 111] Connection refused
Got demoneeded 1.2c1.
<BLANKLINE>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment