Merge lp://staging/~barry/ubuntu-system-image/test-fixes into lp://staging/ubuntu-system-image/server

Proposed by Barry Warsaw
Status: Merged
Merged at revision: 274
Proposed branch: lp://staging/~barry/ubuntu-system-image/test-fixes
Merge into: lp://staging/ubuntu-system-image/server
Diff against target: 88 lines (+25/-12)
4 files modified
bin/generate-keys (+1/-1)
lib/systemimage/tests/test_generators.py (+15/-7)
lib/systemimage/tests/test_static.py (+6/-1)
lib/systemimage/tree.py (+3/-3)
To merge this branch: bzr merge lp://staging/~barry/ubuntu-system-image/test-fixes
Reviewer Review Type Date Requested Status
Łukasz Zemczak (community) Approve
Steve Langasek (community) Needs Fixing
Review via email: mp+272665@code.staging.launchpad.net

Description of the change

Various repairs to the test suite. Fix and ignore PEP 8 violations. Python 2.7 does not have tar.xz files.

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) wrote :

What does this mean, that python 2.7 "does not have" tar.xz files? We are using python2.7 in production, and we must support tar.xz in production (both as an import source and as a generation target). If the test as written can't test tar.xz support correctly on python2.7, then the test should be fixed, not skipped.

review: Needs Information
Revision history for this message
Steve Langasek (vorlon) wrote :

looking at the test code, I see that the test relies on xz support in tarfile:

            # Check that for touch and pd the android hacks are executed
            target_obj = tarfile.open(
                os.path.join(self.config.publish_path, "pool",
                             "ubuntu-HASH.tar.xz"), "r:xz")

This appears to be newly-introduced behavior as part of Lukasz's latest change. However, your change disables the complete test_generate_file_cdimage_ubuntu() test, which is a very extensive test that tests many other aspects of the generator. We cannot reasonably disable this test as a whole on python2.7.

review: Needs Fixing
275. By Barry Warsaw

Fix the test for Python 2.7 without skipping it.

Revision history for this message
Barry Warsaw (barry) wrote :

On Sep 28, 2015, at 11:23 PM, Steve Langasek wrote:

>We are using python2.7 in production

/me has a sad, but also a question: does anything or anyone actually run the
server's test suite? While the .xz test failure may be new, the PEP 8
failures have probably been there a while.

In any case, I pushed an update that avoids the direct use of xz in the
tarfile.open() and removes the skip.

276. By Barry Warsaw

Grammar

Revision history for this message
Łukasz Zemczak (sil2100) wrote :

The changes in the test code looks good, branch is passing all tests here. As for ignoring the certain PEP8 warnings - well, as long as you're ok with that, then I'm ok with that as well ;)

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

On Tue, Sep 29, 2015 at 01:42:33AM -0000, Barry Warsaw wrote:
> On Sep 28, 2015, at 11:23 PM, Steve Langasek wrote:

> >We are using python2.7 in production

> /me has a sad, but also a question: does anything or anyone actually run the
> server's test suite? While the .xz test failure may be new, the PEP 8
> failures have probably been there a while.

Well, the test suite ought to be run when people are committing changes to
the server ;) I don't know the last time I ran it myself.

> In any case, I pushed an update that avoids the direct use of xz in the
> tarfile.open() and removes the skip.

Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: