Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/1] selftest/seltest.py: Add test to check imports from other layers
       [not found] <cover.1468328858.git.mariano.lopez@linux.intel.com>
@ 2016-07-12 13:09 ` mariano.lopez
  2016-07-13 14:09   ` Benjamin Esquivel
  0 siblings, 1 reply; 3+ messages in thread
From: mariano.lopez @ 2016-07-12 13:09 UTC (permalink / raw)
  To: openembedded-core

From: Mariano Lopez <mariano.lopez@linux.intel.com>

This tests adds a check of selftest itself to verify if can
add test from other layers.

[YOCTO #9770]

Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
---
 meta-selftest/lib/oeqa/selftest/imported.py | 14 ++++++++++++++
 meta/lib/oeqa/selftest/seltest.py           | 19 +++++++++++++++++++
 2 files changed, 33 insertions(+)
 create mode 100644 meta-selftest/lib/oeqa/selftest/imported.py
 create mode 100644 meta/lib/oeqa/selftest/seltest.py

diff --git a/meta-selftest/lib/oeqa/selftest/imported.py b/meta-selftest/lib/oeqa/selftest/imported.py
new file mode 100644
index 0000000..b80150b
--- /dev/null
+++ b/meta-selftest/lib/oeqa/selftest/imported.py
@@ -0,0 +1,14 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.decorators import testcase
+
+class ImportedTests(oeSelfTest):
+
+    def test_import_dummy(self):
+        """
+        Summary: Doesn't check anything, used to check import test from other layers.
+        Expected: 1. Pass unconditionally
+        Product: oe-core
+        Author: Mariano Lopez <mariano.lopez@intel.comr
+        """
+
+        self.assertEqual(True, True, msg = "Impossible to fail this test")
diff --git a/meta/lib/oeqa/selftest/seltest.py b/meta/lib/oeqa/selftest/seltest.py
new file mode 100644
index 0000000..ea185ec
--- /dev/null
+++ b/meta/lib/oeqa/selftest/seltest.py
@@ -0,0 +1,19 @@
+from oeqa.selftest.base import oeSelfTest
+from oeqa.utils.commands import runCmd
+from oeqa.utils.decorators import testcase
+
+class Selftest(oeSelfTest):
+
+    def test_import_test_from_layer(self):
+        """
+        Summary: Checks functionality to import tests from other layers.
+        Expected: 1. Must show "test_import_dummy" in the test list.
+        Product: oe-core
+        Author: Mariano Lopez <mariano.lopez@intel.com>
+        """
+
+        test_name = "imported.ImportedTests.test_import_dummy"
+        error_msg = "Couldn't find test: %s; Not importing tests from other layers" % test_name
+        result = runCmd("oe-selftest --list-tests")
+        success = True if test_name in result.output else False
+        self.assertEqual(success, True, msg = error_msg)
-- 
2.6.6



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] selftest/seltest.py: Add test to check imports from other layers
  2016-07-12 13:09 ` [PATCH 1/1] selftest/seltest.py: Add test to check imports from other layers mariano.lopez
@ 2016-07-13 14:09   ` Benjamin Esquivel
  2016-07-13 20:05     ` Mariano Lopez
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Esquivel @ 2016-07-13 14:09 UTC (permalink / raw)
  To: mariano.lopez, openembedded-core

Comments below

The test looks good.

> -----Original Message-----
> From: mariano.lopez@linux.intel.com
> [mailto:mariano.lopez@linux.intel.com]
> Sent: Tuesday, July 12, 2016 8:10 AM
> To: openembedded-core@lists.openembedded.org
> Cc: benjamin.esquivel@linux.intel.com; Mariano Lopez
> <mariano.lopez@linux.intel.com>
> Subject: [PATCH 1/1] selftest/seltest.py: Add test to check imports from
> other layers
> 
> From: Mariano Lopez <mariano.lopez@linux.intel.com>
> 
> This tests adds a check of selftest itself to verify if can add test from
other
> layers.
> 
> [YOCTO #9770]
> 
> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
> ---
>  meta-selftest/lib/oeqa/selftest/imported.py | 14 ++++++++++++++
>  meta/lib/oeqa/selftest/seltest.py           | 19 +++++++++++++++++++
>  2 files changed, 33 insertions(+)
>  create mode 100644 meta-selftest/lib/oeqa/selftest/imported.py
>  create mode 100644 meta/lib/oeqa/selftest/seltest.py
> 
> diff --git a/meta-selftest/lib/oeqa/selftest/imported.py b/meta-
> selftest/lib/oeqa/selftest/imported.py
> new file mode 100644
> index 0000000..b80150b
> --- /dev/null
> +++ b/meta-selftest/lib/oeqa/selftest/imported.py
> @@ -0,0 +1,14 @@
> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.decorators
> +import testcase
> +
> +class ImportedTests(oeSelfTest):
> +
> +    def test_import_dummy(self):
There is a bug where I am proposing some changes to the naming of the tests.
I'll take this test name as an example:
imported.ImportedTests.test_import_dummy. With my proposal I'd name this
test something more along these lines:
external_layer.ImportedTests.test_inconditional_pass.
> +        """
> +        Summary: Doesn't check anything, used to check import test from
other
> layers.
> +        Expected: 1. Pass unconditionally
> +        Product: oe-core
> +        Author: Mariano Lopez <mariano.lopez@intel.comr
typo at the end of the line
> +        """
> +
> +        self.assertEqual(True, True, msg = "Impossible to fail this
> + test")
> diff --git a/meta/lib/oeqa/selftest/seltest.py
> b/meta/lib/oeqa/selftest/seltest.py
> new file mode 100644
> index 0000000..ea185ec
> --- /dev/null
> +++ b/meta/lib/oeqa/selftest/seltest.py
> @@ -0,0 +1,19 @@
> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands
> +import runCmd from oeqa.utils.decorators import testcase
> +
> +class Selftest(oeSelfTest):
> +
> +    def test_import_test_from_layer(self):
Based on the naming guidelines comment above, proposing something like:
selftest.externalLayer.test_list_imported
> +        """
> +        Summary: Checks functionality to import tests from other layers.
> +        Expected: 1. Must show "test_import_dummy" in the test list.
> +        Product: oe-core
> +        Author: Mariano Lopez <mariano.lopez@intel.com>
> +        """
> +
> +        test_name = "imported.ImportedTests.test_import_dummy"
> +        error_msg = "Couldn't find test: %s; Not importing tests from
other
> layers" % test_name
> +        result = runCmd("oe-selftest --list-tests")
> +        success = True if test_name in result.output else False
> +        self.assertEqual(success, True, msg = error_msg)
> --
> 2.6.6




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] selftest/seltest.py: Add test to check imports from other layers
  2016-07-13 14:09   ` Benjamin Esquivel
@ 2016-07-13 20:05     ` Mariano Lopez
  0 siblings, 0 replies; 3+ messages in thread
From: Mariano Lopez @ 2016-07-13 20:05 UTC (permalink / raw)
  To: benjamin.esquivel, openembedded-core



On 07/13/2016 09:09 AM, Benjamin Esquivel wrote:
> Comments below
>
> The test looks good.
>
>> --- /dev/null
>> +++ b/meta-selftest/lib/oeqa/selftest/imported.py
>> @@ -0,0 +1,14 @@
>> +from oeqa.selftest.base import oeSelfTest from oeqa.utils.decorators
>> +import testcase
>> +
>> +class ImportedTests(oeSelfTest):
>> +
>> +    def test_import_dummy(self):
> There is a bug where I am proposing some changes to the naming of the tests.
> I'll take this test name as an example:
> imported.ImportedTests.test_import_dummy. With my proposal I'd name this
> test something more along these lines:
> external_layer.ImportedTests.test_inconditional_pass.

I'll send v2 with the revised name

Mariano Lopez


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-07-13 20:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <cover.1468328858.git.mariano.lopez@linux.intel.com>
2016-07-12 13:09 ` [PATCH 1/1] selftest/seltest.py: Add test to check imports from other layers mariano.lopez
2016-07-13 14:09   ` Benjamin Esquivel
2016-07-13 20:05     ` Mariano Lopez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox