Closed Bug 709340 Opened 13 years ago Closed 12 years ago

Talos setup.py does not download pageloader correctly

Categories

(Testing :: Talos, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: k0scist, Unassigned)

References

Details

(Whiteboard: [mozbase][good first bug][mentor=jhammel][lang=py][mozharness+talos])

http://hg.mozilla.org/build/talos/file/705a12151bf2/setup.py#l50

This takes the whole pageloader repository as a zipfile, whereas
instead there is an extra level of namespacing provided in the zipfile
which makes it incompatible with .xpi.  Instead, the logic should be
more like:

import urllib2
import zipfile
from StringIO import StringIO
pageloader = 'http://hg.mozilla.org/build/pageloader/archive/tip.zip'

def get_pageloader():
    """
    gets pageloader
    """
    output = os.path.join(dest, 'page_load_test', 'pageloader.xpi')
    output = zipfile.ZipFile(output, mode='w')
    buffer = StringIO() # unfortunately, urllib2 "file like objects"
    do not have seek
    buffer.write(urllib2.urlopen(pageloader).read())
    input = zipfile.ZipFile(buffer)
    for member in input.infolist():
        contents = input.read(member)
        member.filename = member.filename.split(os.path.sep, 1)[-1]
        if member.filename == '.hg_archival.txt':
            continue # ignore the hg generated file
        output.writestr(member, contents)
    output.close()
See also bug 701490

Alternatively, we could move this logic to the installation script: http://hg.mozilla.org/build/talos/file/705a12151bf2/INSTALL.py . I would be in favor of this.

We should probably have tests to ensure that installing talos does something sane.  See also bug 703014
Whiteboard: [good first bug][mentor=jhammel]
Whiteboard: [good first bug][mentor=jhammel] → [good first bug][mentor=jhammel][lang=py]
Blocks: 713055
Priority: -- → P2
Whiteboard: [good first bug][mentor=jhammel][lang=py] → [mozbase][good first bug][mentor=jhammel][lang=py][mozharness+talos]
Blocks: 714659
bug 715188 fixes this in a different way
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.