Skip to contentSkip to conversation

tests/acceptance: move @skipUnless decoration to test itself

PATCH In review Alex Bennée 3 participants 5 messages Mar 2, 2020 – Mar 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/acceptance: move @skipUnless decoration to test itself

It appears ignore the decoration if just applied to the class.

---
 tests/acceptance/machine_mips_malta.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/acceptance/machine_mips_malta.py +2 -2
index 92b4f28a112..b8fac2a44d5 100644
@@ -30,14 +30,14 @@ except ImportError:
     CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
 class MaltaMachineFramebuffer(Test):
 
     timeout = 30
 
     KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
         """
         Boot Linux kernel and check Tux logo is displayed on the framebuffer.
Signature · 1 line
2.20.1
#1 lore raw
Quoted 1 line · Alex Bennée

It appears ignore the decoration if just applied to the class.

Odd I remember testing this, this might be a feature supported by a newer Avocado version than the one available on Travis-CI.

Quoted 18 lines
---
  tests/acceptance/machine_mips_malta.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tests/acceptance/machine_mips_malta.py +0 -2
index 92b4f28a112..b8fac2a44d5 100644
@@ -30,14 +30,14 @@ except ImportError:
      CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
  class MaltaMachineFramebuffer(Test):

tests/acceptance/machine_mips_malta.py except ImportError: · line 43

Quoted 10 lines
tests/acceptance/machine_mips_malta.py +2 -0
 
      timeout = 30
 
      KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
      def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
          """
          Boot Linux kernel and check Tux logo is displayed on the framebuffer.

Unfortunately you have to also add it to the 7/8cores tests.

#2 lore raw

----- Original Message -----

Quoted 35 lines

From: "Philippe Mathieu-Daudé" <[email protected]>
To: "Alex Bennée" <[email protected]>, [email protected]
Cc: "Aurelien Jarno" <[email protected]>, [email protected], "Aleksandar Markovic" <[email protected]>
Sent: Monday, March 2, 2020 1:14:31 PM
Subject: Re: [PATCH] tests/acceptance: move @skipUnless decoration to test itself

Quoted 1 line · Alex Bennée

It appears ignore the decoration if just applied to the class.

Odd I remember testing this, this might be a feature supported by a newer Avocado version than the one available on Travis-CI.

Quoted 23 lines
---
  tests/acceptance/machine_mips_malta.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tests/acceptance/machine_mips_malta.py +0 -2
index 92b4f28a112..b8fac2a44d5 100644
@@ -30,14 +30,14 @@ except ImportError:
      CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
  class MaltaMachineFramebuffer(Test):
 
      timeout = 30
 
      KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
Quoted 12 lines
Quoted 7 lines
tests/acceptance/machine_mips_malta.py +2 -0
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
      def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
          """
          Boot Linux kernel and check Tux logo is displayed on the

framebuffer.

Unfortunately you have to also add it to the 7/8cores tests.

This is true of Avocado < 76.0, but on 76.0 you can decorate the class too:

https://avocado-framework.readthedocs.io/en/76.0/releases/76_0.html#users-test-writers

Maybe replace this patch and bump Avocado's version?

- Cleber.

#3 lore raw
Quoted 49 lines · Cleber Rosa

----- Original Message -----

Quoted 35 lines

From: "Philippe Mathieu-Daudé" <[email protected]>
To: "Alex Bennée" <[email protected]>, [email protected]
Cc: "Aurelien Jarno" <[email protected]>, [email protected], "Aleksandar Markovic" <[email protected]>
Sent: Monday, March 2, 2020 1:14:31 PM
Subject: Re: [PATCH] tests/acceptance: move @skipUnless decoration to test itself

Quoted 1 line · Alex Bennée

It appears ignore the decoration if just applied to the class.

Odd I remember testing this, this might be a feature supported by a newer Avocado version than the one available on Travis-CI.

Quoted 23 lines
---
  tests/acceptance/machine_mips_malta.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tests/acceptance/machine_mips_malta.py +0 -2
index 92b4f28a112..b8fac2a44d5 100644
@@ -30,14 +30,14 @@ except ImportError:
      CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
  class MaltaMachineFramebuffer(Test):
 
      timeout = 30
 
      KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
Quoted 12 lines
Quoted 7 lines
tests/acceptance/machine_mips_malta.py +2 -0
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
      def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
          """
          Boot Linux kernel and check Tux logo is displayed on the

framebuffer.

Unfortunately you have to also add it to the 7/8cores tests.

Quoted 6 lines

This is true of Avocado < 76.0, but on 76.0 you can decorate the class too:

https://avocado-framework.readthedocs.io/en/76.0/releases/76_0.html#users-test-writers

Maybe replace this patch and bump Avocado's version?

Where is this defined in the source?

Quoted 2 lines

- Cleber.

Signature · 1 line
Alex Bennée
#4 lore raw

----- Original Message -----

Quoted 61 lines

From: "Alex Bennée" <[email protected]>
To: "Cleber Rosa" <[email protected]>
Cc: "Philippe Mathieu-Daudé" <[email protected]>, [email protected], "Aurelien Jarno" <[email protected]>, [email protected], "Aleksandar Markovic" <[email protected]>
Sent: Tuesday, March 3, 2020 8:59:47 AM
Subject: Re: [PATCH] tests/acceptance: move @skipUnless decoration to test itself

Quoted 51 lines · Cleber Rosa

----- Original Message -----

Quoted 49 lines

From: "Philippe Mathieu-Daudé" <[email protected]>
To: "Alex Bennée" <[email protected]>, [email protected]
Cc: "Aurelien Jarno" <[email protected]>, [email protected], "Aleksandar Markovic" <[email protected]>
Sent: Monday, March 2, 2020 1:14:31 PM
Subject: Re: [PATCH] tests/acceptance: move @skipUnless decoration to test itself

Quoted 1 line · Alex Bennée

It appears ignore the decoration if just applied to the class.

Odd I remember testing this, this might be a feature supported by a newer Avocado version than the one available on Travis-CI.

Quoted 28 lines
---
  tests/acceptance/machine_mips_malta.py | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
tests/acceptance/machine_mips_malta.py +2 -2
index 92b4f28a112..b8fac2a44d5 100644
@@ -30,14 +30,14 @@ except ImportError:
      CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
  class MaltaMachineFramebuffer(Test):
 
      timeout = 30
 
      KERNEL_COMMON_COMMAND_LINE = 'printk.time=0 '
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
      def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
          """
          Boot Linux kernel and check Tux logo is displayed on the
Quoted 2 lines

framebuffer.

Unfortunately you have to also add it to the 7/8cores tests.

Quoted 9 lines
Quoted 6 lines

This is true of Avocado < 76.0, but on 76.0 you can decorate the class too:

https://avocado-framework.readthedocs.io/en/76.0/releases/76_0.html#users-test-writers

Maybe replace this patch and bump Avocado's version?

Where is this defined in the source?

It's defined at tests/requirements.txt.

- Cleber.

Quoted 8 lines
Quoted 2 lines

- Cleber.

--
Alex Bennée