From a151cefa1a4c077b4d85f923e3ea865d82c02e07 Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Fri, 22 Sep 2023 11:11:27 +0200 Subject: [PATCH] Repair coverage to be compatible with 8.3 test env Impacted drivers: LINSTOR, MooseFS and ZFS. - Ignore all linstor.* members during coverage, the module is not installed in github runner. - Use mock from unittest, the old one is not found now. - Remove useless return from LinstorSR scan method. Signed-off-by: Ronan Abhamon --- drivers/LinstorSR.py | 3 +-- tests/pylintrc | 2 +- tests/test_MooseFSSR.py | 4 +++- tests/test_ZFSSR.py | 5 +++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/LinstorSR.py b/drivers/LinstorSR.py index 7a345217a..c8aa56b34 100755 --- a/drivers/LinstorSR.py +++ b/drivers/LinstorSR.py @@ -779,9 +779,8 @@ def scan(self, uuid): # Update the database before the restart of the GC to avoid # bad sync in the process if new VDIs have been introduced. - ret = super(LinstorSR, self).scan(self.uuid) + super(LinstorSR, self).scan(self.uuid) self._kick_gc() - return ret @_locked_load def vdi(self, uuid): diff --git a/tests/pylintrc b/tests/pylintrc index a982913b3..4588675ba 100644 --- a/tests/pylintrc +++ b/tests/pylintrc @@ -84,7 +84,7 @@ ignored-classes=SQLObject # List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E0201 when accessed. -generated-members=REQUEST,acl_users,aq_parent +generated-members=REQUEST,acl_users,aq_parent,linstor.* # List of module names for which member attributes should not be checked # # (useful for modules/projects where namespaces are manipulated during runtime diff --git a/tests/test_MooseFSSR.py b/tests/test_MooseFSSR.py index feaac6267..f4e0a852f 100644 --- a/tests/test_MooseFSSR.py +++ b/tests/test_MooseFSSR.py @@ -1,4 +1,6 @@ -import mock +from unittest import mock +import unittest + import MooseFSSR import unittest diff --git a/tests/test_ZFSSR.py b/tests/test_ZFSSR.py index e95ab7eb6..ac2c6eb7b 100644 --- a/tests/test_ZFSSR.py +++ b/tests/test_ZFSSR.py @@ -1,8 +1,9 @@ +from unittest import mock +import unittest + import FileSR -import mock import os import SR -import unittest import ZFSSR