Francesco Romani has posted comments on this change.

Change subject: unbreak testHostSampleHandlesDisappearingVlanInterfaces.
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/40346/2/tests/samplingTests.py
File tests/samplingTests.py:

Line 180:             with MonkeyPatchScope([(sampling, 'NumaNodeMemorySample',
Line 181:                                     NumaNodeMemorySampleMock)]):
Line 182:                 with dummy_if() as dummy_name:
Line 183:                     with vlan(self.NEW_VLAN, dummy_name, 999):
Line 184:                         hs = sampling.HostSample(os.getpid())
> well, I guess I initially called HostSample constructor to catch future cas
Your approach *is* more correct - we should test public interface, not private 
one.
Problem is that HostSample needs a serious amount a refactoring, so this is 
impractical due to the huge amount of faking and monkeypatching required. In 
the end, this will make the test worse.


On a positive side, I begun a (low-priority :( ) refactoring of the missing 
bits of sampling.py, including HostSample and co. Reviews will be appreciated! 
:)
Line 185:                         self.assertNotIn(self.NEW_VLAN, hs.interfaces)
Line 186: 
Line 187: 
Line 188: @expandPermutations


-- 
To view, visit https://gerrit.ovirt.org/40346
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I77f5f2298cf6202d80f54d736ef20646d7d4a04e
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ido Barkan <ibar...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Ido Barkan <ibar...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to