Merge lp://qastaging/~laney/ubuntu-release-upgrader/testfix into lp://qastaging/ubuntu-release-upgrader

Proposed by Iain Lane
Status: Merged
Merged at revision: 3113
Proposed branch: lp://qastaging/~laney/ubuntu-release-upgrader/testfix
Merge into: lp://qastaging/ubuntu-release-upgrader
Diff against target: 23 lines (+2/-0)
2 files modified
tests/test_prerequists.py (+1/-0)
tests/test_sources_list.py (+1/-0)
To merge this branch: bzr merge lp://qastaging/~laney/ubuntu-release-upgrader/testfix
Reviewer Review Type Date Requested Status
Julian Andres Klode Approve
Ubuntu Core Development Team Pending
Review via email: mp+341842@code.qastaging.launchpad.net

Description of the change

Don't let a system's APT::Default-Release setting interfere with the tests

I had hoped that you could set Dir::Etc::Parts, but we `import apt' which seems to read the parts already, so setting it from the tests doesn't change anything. This is a pragmatic solution.

To post a comment you must log in.
Revision history for this message
Julian Andres Klode (juliank) wrote :

LGTM.

I was thinking about making this more generic, but this requires a few tricks, but should fully isolate the rootdir, possibly by adding an argument to apt.Cache, like:

apt.Cache(..., config={})

to start a cache with an empty config. Needs changes in python-apt, update-manager, and ubuntu-release-upgrader, but should make things nice. What do you think?

review: Approve
Revision history for this message
Iain Lane (laney) wrote :

autopkgtest [20:17:23]: test nose-tests: [-----------------------
...
(nosetests3:3774): Gtk-CRITICAL **: 20:17:36.409: gtk_main_quit: assertion 'main_loops != NULL' failed
.......................................äää....
----------------------------------------------------------------------
Ran 46 tests in 37.471s

OK
autopkgtest [20:18:02]: test nose-tests: -----------------------]
autopkgtest [20:18:05]: test nose-tests: - - - - - - - - - - results - - - - - - - - - -
nose-tests PASS
autopkgtest [20:18:07]: @@@@@@@@@@@@@@@@@@@@ summary
nose-tests PASS

---

Works, BTW. Don't have time to think about the comment right now, sorry - just wanted to paste that. Feel free to merge/upload.

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks, I'll merge / upload this as I've another fix to make too.

Revision history for this message
Iain Lane (laney) wrote :

On Wed, Mar 21, 2018 at 10:57:33PM -0000, Brian Murray wrote:
> Thanks, I'll merge / upload this as I've another fix to make too.

Steve actually reverted the autopkgtest change that provoked this
behaviour, so this isn't required but can still be included if we
want.

--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]

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