Merge lp:~benji/landscape-client/bug-1548946-xenial-test-failures into lp:~landscape/landscape-client/trunk
Status: | Merged |
---|---|
Approved by: | Benji York |
Approved revision: | 834 |
Merged at revision: | 832 |
Proposed branch: | lp:~benji/landscape-client/bug-1548946-xenial-test-failures |
Merge into: | lp:~landscape/landscape-client/trunk |
Diff against target: |
102 lines (+27/-13) 2 files modified
landscape/package/tests/helpers.py (+1/-1) landscape/package/tests/test_facade.py (+26/-12) |
To merge this branch: | bzr merge lp:~benji/landscape-client/bug-1548946-xenial-test-failures |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chris Glass (community) | Approve | ||
Free Ekanayaka (community) | Approve | ||
Review via email: mp+288180@code.launchpad.net |
Commit message
This branch fixes two test failures and one non-failure on Xenial.
The simplest failure was a simple difference in deb stanza ordering
that caused a failure of test_get_
to store the stanzas in sets and compared those instead so as to be
order-agnostic.
The next failure was caused by a change in the way the apt cache works.
The test_reload_
change in package visibility to the apt cache to tell when the cache's
update() method had been called. The cache behaviour has changed so
that package existance changes are now reflected earlier than before.
Therefore, I added a test-only subclass of the cache which records the
fact that it's update method has been called, which is the operative
piece of information for the test.
The change to the cache behaviour also meant that
test_reload_
to update() were removed, so I used the cache subclass in that test as
well.
Description of the change
This branch fixes two test failures and one non-failure on Xenial.
The simplest failure was a simple difference in deb stanza ordering
that caused a failure of test_get_
to store the stanzas in sets and compared those instead so as to be
order-agnostic.
The next failure was caused by a change in the way the apt cache works.
The test_reload_
change in package visibility to the apt cache to tell when the cache's
update() method had been called. The cache behaviour has changed so
that package existance changes are now reflected earlier than before.
Therefore, I added a test-only subclass of the cache which records the
fact that it's update method has been called, which is the operative
piece of information for the test.
The change to the cache behaviour also meant that
test_reload_
to update() were removed, so I used the cache subclass in that test as
well.
Testing instructions:
Before this branch running
trial landscape.
would result in failing tests. Now it shouldn't.
To ensure the test that never failed before will actually fail, remove
or comment out the calls to self._cache.
landscape/
trial landscape.
I'm basically +1 with a non-blocking nitpick.
Just marking as Needs information because of the following question.
Since it seems you investigated the issue in depth and possible looked at the changed behavior in the apt module, do you think it would be possible to avoid using the TestCache and change the test to adapt to the new behavior somehow? Or is it now plain impossible for calling code to have visibility on that?