Hello Nir Soffer, Dan Kenigsberg,
I'd like you to do a code review. Please visit
https://gerrit.ovirt.org/40030
to review the following change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
tests: Enable again utils.memoized in the tests
Tests that may leave dirt in memoized functions should invalidate the functions during teardown.
Since we disabled memoizing becuase of pulluted memoized functions in caps module, caps tests invalidate all memoized functions now.
Change-Id: I019e2a2ad75973511cccd195a7e9eaa105d8154f Signed-off-by: Nir Soffer nsoffer@redhat.com Reviewed-on: http://gerrit.ovirt.org/37841 Reviewed-by: Francesco Romani fromani@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com Tested-by: Dan Kenigsberg danken@redhat.com --- M tests/capsTests.py M tests/testrunner.py 2 files changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/30/40030/1
diff --git a/tests/capsTests.py b/tests/capsTests.py index e3f7d6a..d0ac3d5 100644 --- a/tests/capsTests.py +++ b/tests/capsTests.py @@ -41,6 +41,13 @@
class TestCaps(TestCaseBase): + + def tearDown(self): + for name in dir(caps): + obj = getattr(caps, name) + if isinstance(obj, utils.memoized): + obj.invalidate() + def _readCaps(self, fileName): testPath = os.path.realpath(__file__) dirName = os.path.split(testPath)[0] diff --git a/tests/testrunner.py b/tests/testrunner.py index 13fe55e..37b4c95 100644 --- a/tests/testrunner.py +++ b/tests/testrunner.py @@ -411,10 +411,6 @@ raise AssertionError(msg)
-def fakeMemoized(func): - return func - - if __name__ == '__main__': if "--help" in sys.argv: print("testrunner options:\n" @@ -426,6 +422,4 @@
# Mock panic() calls for tests utils.panic = panicMock - # Memoization during tests is a bad idea. - utils.memoized = fakeMemoized run()
automation@ovirt.org has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 1: Verified-1
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::ERROR, At least one bug-url is required for the stable branch * Check merged to previous::OK, change not open on any previous branch
automation@ovirt.org has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found
* Check Bug-Url::ERROR, At least one bug-url is required for the stable branch * Check merged to previous::OK, change not open on any previous branch
automation@ovirt.org has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 3:
* Update tracker::#1267851::OK * Check Bug-Url::OK * Check Public Bug::#1267851::OK, public bug * Check Product::#1267851::OK, Correct classification oVirt * Check TR::#1267851::ERROR, wrong target release for stable branch, --- should match ^3.[54321].* * Check merged to previous::OK, change not open on any previous branch
Francesco Romani has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 3: Verified+1
tests passes, and this code will be used only in tests: V+1
Nir Soffer has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 3: Code-Review+1
Francesco Romani has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 3: Continuous-Integration+1
run CI checks manually
automation@ovirt.org has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 4:
* Update tracker::#1267851::OK * Check Bug-Url::OK * Check Public Bug::#1267851::OK, public bug * Check Product::#1267851::OK, Correct classification oVirt * Check TR::#1267851::ERROR, wrong target release for stable branch, --- should match ^3.[54321].* * Check merged to previous::OK, change not open on any previous branch
Dan Kenigsberg has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 4: Code-Review+2
Francesco Romani has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 4: Continuous-Integration+1
Francesco Romani has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 4:
run CI scripts manually.
Francesco Romani has submitted this change and it was merged.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
tests: Enable again utils.memoized in the tests
Tests that may leave dirt in memoized functions should invalidate the functions during teardown.
Since we disabled memoizing becuase of pulluted memoized functions in caps module, caps tests invalidate all memoized functions now.
Change-Id: I019e2a2ad75973511cccd195a7e9eaa105d8154f Signed-off-by: Nir Soffer nsoffer@redhat.com Bug-Url: https://bugzilla.redhat.com/1267851 Reviewed-on: http://gerrit.ovirt.org/37841 Reviewed-by: Francesco Romani fromani@redhat.com Reviewed-by: Dan Kenigsberg danken@redhat.com Tested-by: Dan Kenigsberg danken@redhat.com Reviewed-on: https://gerrit.ovirt.org/40030 Tested-by: Francesco Romani fromani@redhat.com Continuous-Integration: Francesco Romani fromani@redhat.com --- M tests/capsTests.py M tests/testrunner.py 2 files changed, 7 insertions(+), 6 deletions(-)
Approvals: Nir Soffer: Looks good to me, but someone else must approve Dan Kenigsberg: Looks good to me, approved Francesco Romani: Verified; Passed CI tests
automation@ovirt.org has posted comments on this change.
Change subject: tests: Enable again utils.memoized in the tests ......................................................................
Patch Set 5:
* Update tracker::#1267851::OK * Set MODIFIED::bug 1267851::::#1267851::::IGNORE, not oVirt prod but vdsm
vdsm-patches@lists.fedorahosted.org