Skip to contentSkip to conversation

python3-license-expression: Fix the ptest failure

PATCH Superseded [email protected] 3 participants 16 messages Dec 13, 2023 – Dec 19, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-license-expression: Fix the ptest failure

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +1 -1
index 5cec711696..3385d68939 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -0
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
Signature · 1 line
2.25.1
#1 lore raw

Why isn't the ptest failure reported by the autobuilder? Shouldn't we first fix the ptest so that the failure is reported correctly, if it starts occurring again?

Alex

Quoted 77 lines · Mingli

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +1 -1
index 5cec711696..3385d68939 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -1
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192278): https://lists.openembedded.org/g/openembedded-core/message/192278
Mute This Topic: https://lists.openembedded.org/mt/103146950/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

I see that run-ptest consists of a single pytest command; does that command return a zero exit code even it fails?

Alex

Quoted 85 lines · Alexander Kanavin

Why isn't the ptest failure reported by the autobuilder? Shouldn't we first fix the ptest so that the failure is reported correctly, if it starts occurring again?

Alex

Quoted 77 lines · Mingli

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +1 -1
index 5cec711696..3385d68939 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -1
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192278): https://lists.openembedded.org/g/openembedded-core/message/192278
Mute This Topic: https://lists.openembedded.org/mt/103146950/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#3 lore raw

Hi Alex,

The single command is enough to indicate the build failure such as:

 root@qemux86-64:/usr/lib64/python3-license-expression/ptest# ./run-ptest
[snip]
PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
FAIL: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

=================================== FAILURES =================================== ______________________ BaseTests.test_skeleton_codestyle _______________________

self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle>

    def test_skeleton_codestyle(self):
        """
        This test shouldn't run in proliferated repositories.
        """
        setup_cfg = configparser.ConfigParser()
        setup_cfg.read("setup.cfg")
Quoted 1 line
      if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <configparser.ConfigParser object at 0x7f04c0473610>, key = 'metadata'

    def __getitem__(self, key):
        if key != self.default_section and not self.has_section(key):
Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

../../python3.11/configparser.py:979: KeyError =========================== short test summary info ============================ FAIL tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle ======================== 1 failed, 174 passed in 7.08s =========================

Thanks,
________________________________
From: Alexander Kanavin <[email protected]>
Sent: Thursday, December 14, 2023 00:39
To: Yu, Mingli <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] python3-license-expression: Fix the ptest failure

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

I see that run-ptest consists of a single pytest command; does that command return a zero exit code even it fails?

Alex

Quoted 85 lines · Alexander Kanavin

Why isn't the ptest failure reported by the autobuilder? Shouldn't we first fix the ptest so that the failure is reported correctly, if it starts occurring again?

Alex

Quoted 77 lines · Mingli

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +1 -1
index 5cec711696..3385d68939 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -1
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192278): https://lists.openembedded.org/g/openembedded-core/message/192278
Mute This Topic: https://lists.openembedded.org/mt/103146950/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw

This doesn't answer the question I asked: does the pytest command return a zero exit code when some of the tests fail? If so, that is incorrect behaviour.

It's expected that we can catch the overall failiure from the exit code even if there's no output that can point to specific test cases failing (because upstreams change the output without telling us, sed processing in run-ptest quietly regress etc).

Alex

Quoted 141 lines · Mingli

Hi Alex,

The single command is enough to indicate the build failure such as:

 root@qemux86-64:/usr/lib64/python3-license-expression/ptest# ./run-ptest
[snip]
PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
FAIL: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

=================================== FAILURES =================================== ______________________ BaseTests.test_skeleton_codestyle _______________________

self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle>

    def test_skeleton_codestyle(self):
        """
        This test shouldn't run in proliferated repositories.
        """
        setup_cfg = configparser.ConfigParser()
        setup_cfg.read("setup.cfg")
Quoted 1 line
      if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <configparser.ConfigParser object at 0x7f04c0473610>, key = 'metadata'

    def __getitem__(self, key):
        if key != self.default_section and not self.has_section(key):
Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

../../python3.11/configparser.py:979: KeyError =========================== short test summary info ============================ FAIL tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle ======================== 1 failed, 174 passed in 7.08s =========================

Thanks,
________________________________
From: Alexander Kanavin <[email protected]>
Sent: Thursday, December 14, 2023 00:39
To: Yu, Mingli <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] python3-license-expression: Fix the ptest failure

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

I see that run-ptest consists of a single pytest command; does that command return a zero exit code even it fails?

Alex

Quoted 85 lines · Alexander Kanavin

Why isn't the ptest failure reported by the autobuilder? Shouldn't we first fix the ptest so that the failure is reported correctly, if it starts occurring again?

Alex

Quoted 77 lines · Mingli

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +1 -1
index 5cec711696..3385d68939 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -1
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192278): https://lists.openembedded.org/g/openembedded-core/message/192278
Mute This Topic: https://lists.openembedded.org/mt/103146950/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw

PATCH v2 1/1 python3-license-expression: Fix the ptest failure

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
 .../python/python3-license-expression/run-ptest             | 6 +++++-
 .../python/python3-license-expression_30.1.1.bb             | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +5 -1
index 5cec711696..07e2dd17ee 100644
@@ -1,3 +1,7 @@
 #!/bin/sh
 
-pytest
+rm -rf output.log
+pytest -o log_cli=true -o log_cli_level=INFO > output.log 2>&1
+exitcode=$?
+cat output.log | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
+exit $exitcode
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -0
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
Signature · 1 line
2.25.1
#6 lore raw

Wait. There were two specific review requests, and both remain unanswered. You are just resending the patch, and that is not acceptable.

- (from Ross) can we use pytest —automake instead of unreadable sed/awk monster expression?
- (from me) is ptest returning a non-zero error code when it fails like the commit says? If it does, why isn't the failure seen when running -c testimage, or in the autobuilder which does that?

Please do check these first, and please do pay attention to what people ask.

Alex

Quoted 72 lines · On Mon, 18 Dec 2023 at 07:15, <[email protected]> wrote:

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
 .../python/python3-license-expression/run-ptest             | 6 +++++-
 .../python/python3-license-expression_30.1.1.bb             | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +5 -1
index 5cec711696..07e2dd17ee 100644
@@ -1,3 +1,7 @@
 #!/bin/sh
 
-pytest
+rm -rf output.log
+pytest -o log_cli=true -o log_cli_level=INFO > output.log 2>&1
+exitcode=$?
+cat output.log | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
+exit $exitcode
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -1
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
--

2.25.1

author
#7 lore raw

Hi Alex,

Please check the comments inline.

Quoted 9 lines · Alexander Kanavin

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Wait. There were two specific review requests, and both remain unanswered. You are just resending the patch, and that is not acceptable.

- (from Ross) can we use pytest —automake instead of unreadable sed/awk monster expression?

A: Will use pytest --automake in v3.

Quoted 3 lines

- (from me) is ptest returning a non-zero error code when it fails like the commit says? If it does, why isn't the failure seen when running -c testimage, or in the autobuilder which does that?

Yes, the pytest command should return non-zero as below:

 # ./run-ptest
 [snip]

PASS: tests/test_license_expression.py:CombineExpressionTest.test_combine_expressions_with_duplicated_elements
PASS: tests/test_license_expression.py:CombineExpressionTest.test_combine_expressions_with_empty_input
PASS: tests/test_license_expression.py:CombineExpressionTest.test_combine_expressions_with_or_relationship
PASS: tests/test_license_expression.py:CombineExpressionTest.test_combine_expressions_with_regular

self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle>

    def test_skeleton_codestyle(self):
        """
        This test shouldn't run in proliferated repositories.
        """
        setup_cfg = configparser.ConfigParser()
        setup_cfg.read("setup.cfg")
Quoted 1 line
      if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <configparser.ConfigParser object at 0x7f6e46e36e90>, key = 'metadata'

    def __getitem__(self, key):
        if key != self.default_section and not self.has_section(key):
Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

../../python3.11/configparser.py:979: KeyError
FAIL: tests/test_skeleton_codestyle.py:BaseTests.test_skeleton_codestyle
============================================================================
Testsuite summary
# TOTAL: 175
# PASS: 174
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0

# echo $?
1

Thanks,

Quoted 80 lines

Please do check these first, and please do pay attention to what people ask.

Alex

Quoted 72 lines · On Mon, 18 Dec 2023 at 07:15, <[email protected]> wrote:

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

  # ./run-ptest
  [snip]
  PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
  PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
  PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
  PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
  PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
  PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
  PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
  PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
  PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
  PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
  PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
  PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
  PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
  PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
  PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle

============================= 175 passed in 10.36s =============================

---
  .../python/python3-license-expression/run-ptest             | 6 +++++-
  .../python/python3-license-expression_30.1.1.bb             | 1 +
  2 files changed, 6 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +5 -1
index 5cec711696..07e2dd17ee 100644
@@ -1,3 +1,7 @@
  #!/bin/sh
 
-pytest
+rm -rf output.log
+pytest -o log_cli=true -o log_cli_level=INFO > output.log 2>&1
+exitcode=$?
+cat output.log | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}'
+exit $exitcode
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +1 -1
index 31fb88d6e5..5d3923d487 100644
@@ -33,4 +33,5 @@ do_install_ptest() {
      install -d ${D}${PTEST_PATH}/src
      cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
      cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
  }
--

2.25.1

#8 lore raw
Quoted 2 lines · Mingli
# echo $?
1

Thanks. This however doesn't explain why the failure is not seen on the autobuilder, but I'll answer that in a response to the patch.

Alex

#9 lore raw

PATCH v3 1/1 python3-license-expression: Fix the ptest failure

In reply to Alexander Kanavin

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle
============================================================================
Testsuite summary
 # TOTAL: 175
 # PASS: 175
 # SKIP: 0
 # XFAIL: 0
 # FAIL: 0
 # XPASS: 0
---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +1 -1
index 5cec711696..8d2017d39c 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest --automake
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +2 -0
index 31fb88d6e5..92ca419e4a 100644
@@ -26,6 +26,7 @@ SRC_URI += " \
 
 RDEPENDS:${PN}-ptest += " \
 	${PYTHON_PN}-pytest \
+	${PYTHON_PN}-unittest-automake-output \
 "
 
 do_install_ptest() {
@@ -33,4 +34,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
Signature · 1 line
2.25.1
#10 lore raw
Quoted 11 lines · Mingli

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 7 lines
Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

I went and checked why this isn't seen on the autobulder - this ptest is actually excluded from testing because it's in PTESTS_PROBLEMS. Please add it to PTESTS_FAST (if it's quick enough), and then it's good.

Alex

author
#11 lore raw

yes, the python3-license-expression ptest is fast and v4 sent to add python3-license-expression to PTESTS_FAST.

Thanks,
________________________________
From: Alexander Kanavin <[email protected]>
Sent: Monday, December 18, 2023 17:26
To: Yu, Mingli <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH v3] python3-license-expression: Fix the ptest failure

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 11 lines · Mingli

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 7 lines
Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

I went and checked why this isn't seen on the autobulder - this ptest is actually excluded from testing because it's in PTESTS_PROBLEMS. Please add it to PTESTS_FAST (if it's quick enough), and then it's good.

Alex

#12 lore raw

PATCH v4 1/2 python3-license-expression: Fix the ptest failure

In reply to Alexander Kanavin

From: Mingli Yu <[email protected]>

Fix the below ptest failure:
self = <test_skeleton_codestyle.BaseTests testMethod=test_skeleton_codestyle> def test_skeleton_codestyle(self):
"""
This test shouldn't run in proliferated repositories.
"""
setup_cfg = configparser.ConfigParser() setup_cfg.read("setup.cfg")

Quoted 1 line

if setup_cfg["metadata"]["name"] != "skeleton":

tests/test_skeleton_codestyle.py:22:
self = <configparser.ConfigParser object at 0x7fd87cf55110>, key = 'metadata' def _getitem_(self, key):
if key != self.default_section and not self.has_section(key):

Quoted 1 line

raise KeyError(key)

E KeyError: 'metadata'

After the patch:

 # ./run-ptest
 [snip]
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
 PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
 PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
 PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
 PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
 PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle
============================================================================
Testsuite summary
 # TOTAL: 175
 # PASS: 175
 # SKIP: 0
 # XFAIL: 0
 # FAIL: 0
 # XPASS: 0

Changed in v4:
Add python3-license-expression to PTESTS_FAST

---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-license-expression/run-ptest +1 -1
index 5cec711696..8d2017d39c 100644
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-pytest
+pytest --automake
meta/recipes-devtools/python/python3-license-expression_30.1.1.bb +2 -0
index 31fb88d6e5..92ca419e4a 100644
@@ -26,6 +26,7 @@ SRC_URI += " \
 
 RDEPENDS:${PN}-ptest += " \
 	${PYTHON_PN}-pytest \
+	${PYTHON_PN}-unittest-automake-output \
 "
 
 do_install_ptest() {
@@ -33,4 +34,5 @@ do_install_ptest() {
     install -d ${D}${PTEST_PATH}/src
     cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
     cp -rf ${S}/src/* ${D}${PTEST_PATH}/src/
+    cp -rf ${S}/setup.cfg ${D}${PTEST_PATH}/
 }
Signature · 1 line
2.25.1
#13 lore raw

PATCH v4 2/2 ptest-packagelists.inc: Add python3-license-expression

From: Mingli Yu <[email protected]>

 # ./run-ptest
     [snip]
     PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_bad_syntax
     PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_as_regular_key
     PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_exception_with_choice
     PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception
     PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_exception_strict_false
     PASS: tests/test_license_expression.py::LicensingValidateTest::test_validation_invalid_license_key
     PASS: tests/test_license_expression.py::UtilTest::test_build_licensing
     PASS: tests/test_license_expression.py::UtilTest::test_build_spdx_licensing
     PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info
     PASS: tests/test_license_expression.py::UtilTest::test_get_license_key_info_vendored
     PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_duplicated_elements
     PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_empty_input
     PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_or_relationship
     PASS: tests/test_license_expression.py::CombineExpressionTest::test_combine_expressions_with_regular
     PASS: tests/test_skeleton_codestyle.py::BaseTests::test_skeleton_codestyle
    ============================================================================
    Testsuite summary
     # TOTAL: 175
     # PASS: 175
     # SKIP: 0
     # XFAIL: 0
     # FAIL: 0
     # XPASS: 0
---
 meta/conf/distro/include/ptest-packagelists.inc | 1 +
 1 file changed, 1 insertion(+)
meta/conf/distro/include/ptest-packagelists.inc +1 -0
index 7ca23cb4f0..9057c12b09 100644
@@ -62,6 +62,7 @@ PTESTS_FAST = "\
     python3-hypothesis \
     python3-jinja2 \
     python3-jsonpointer \
+    python3-license-expression \
     python3-markupsafe \
     python3-more-itertools \
     python3-pluggy \
Signature · 1 line
2.25.1
#14 lore raw
In reply to [email protected]

Review

Quoted 2 lines · Mingli via lists.openembedded.org
(quoted diff) +1 -1
-pytest
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}’

python3-unittest-automake-output has a helper class to do this for you, so you just need to "pytest —automake”.

Ross

author
#15 lore raw

Hi Ross,

Quoted 8 lines · Ross Burton

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Review

Quoted 2 lines · Mingli via lists.openembedded.org
(quoted diff) +1 -1
-pytest
+pytest -o log_cli=true -o log_cli_level=INFO | sed -e 's/\[...%\]//g'| sed -e 's/PASSED/PASS/g'| sed -e 's/FAILED/FAIL/g'|sed -e 's/SKIPED/SKIP/g'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS"){printf "%s: %s\n", $NF, $0}else{print}}'| awk '{if ($NF=="PASS" || $NF=="FAIL" || $NF=="SKIP" || $NF=="XFAIL" || $NF=="XPASS") {$NF="";print $0}else{print}}’

python3-unittest-automake-output has a helper class to do this for you, so you just need to "pytest —automake”.

Thanks your suggestion! Will use "pytest —automake" in v3.

Thanks,

Quoted 13 lines

Ross

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192309): https://lists.openembedded.org/g/openembedded-core/message/192309
Mute This Topic: https://lists.openembedded.org/mt/103146950/3618448
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-