diff mbox series

python3-license-expression: Fix the ptest failure

Message ID 20231213102129.618430-1-mingli.yu@windriver.com
State Accepted, archived
Commit 6b06ad7a9f1dd5900483102f5723a6821f961dab
Headers show
Series python3-license-expression: Fix the ptest failure | expand

Commit Message

Yu, Mingli Dec. 13, 2023, 10:21 a.m. UTC
From: Mingli Yu <mingli.yu@windriver.com>

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")
 > 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):
 > 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 =============================

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 .../python/python3-license-expression/run-ptest                 | 2 +-
 .../python/python3-license-expression_30.1.1.bb                 | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Alexander Kanavin Dec. 13, 2023, 4:38 p.m. UTC | #1
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

On Wed, 13 Dec 2023 at 11:21, Yu, Mingli <mingli.yu@eng.windriver.com> wrote:
>
> From: Mingli Yu <mingli.yu@windriver.com>
>
> 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")
>  > 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):
>  > 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 =============================
>
> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> ---
>  .../python/python3-license-expression/run-ptest                 | 2 +-
>  .../python/python3-license-expression_30.1.1.bb                 | 1 +
>  2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/python/python3-license-expression/run-ptest b/meta/recipes-devtools/python/python3-license-expression/run-ptest
> index 5cec711696..3385d68939 100644
> --- a/meta/recipes-devtools/python/python3-license-expression/run-ptest
> +++ b/meta/recipes-devtools/python/python3-license-expression/run-ptest
> @@ -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}}'
> diff --git a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> index 31fb88d6e5..5d3923d487 100644
> --- a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> +++ b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> @@ -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: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexander Kanavin Dec. 13, 2023, 4:39 p.m. UTC | #2
I see that run-ptest consists of a single pytest command; does that
command return a zero exit code even it fails?

Alex

On Wed, 13 Dec 2023 at 17:38, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
>
> 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
>
> On Wed, 13 Dec 2023 at 11:21, Yu, Mingli <mingli.yu@eng.windriver.com> wrote:
> >
> > From: Mingli Yu <mingli.yu@windriver.com>
> >
> > 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")
> >  > 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):
> >  > 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 =============================
> >
> > Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > ---
> >  .../python/python3-license-expression/run-ptest                 | 2 +-
> >  .../python/python3-license-expression_30.1.1.bb                 | 1 +
> >  2 files changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/recipes-devtools/python/python3-license-expression/run-ptest b/meta/recipes-devtools/python/python3-license-expression/run-ptest
> > index 5cec711696..3385d68939 100644
> > --- a/meta/recipes-devtools/python/python3-license-expression/run-ptest
> > +++ b/meta/recipes-devtools/python/python3-license-expression/run-ptest
> > @@ -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}}'
> > diff --git a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> > index 31fb88d6e5..5d3923d487 100644
> > --- a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> > +++ b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> > @@ -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: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
Ross Burton Dec. 13, 2023, 6:05 p.m. UTC | #3
On 13 Dec 2023, at 10:21, Yu, Mingli via lists.openembedded.org <mingli.yu=eng.windriver.com@lists.openembedded.org> wrote:
> -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
Yu, Mingli Dec. 14, 2023, 3:34 a.m. UTC | #4
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")
>       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):
>           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,
Alexander Kanavin Dec. 14, 2023, 8:35 a.m. UTC | #5
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

On Thu, 14 Dec 2023 at 04:35, Yu, Mingli <Mingli.Yu@windriver.com> wrote:
>
> 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")
> >       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):
> >           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 <alex.kanavin@gmail.com>
> Sent: Thursday, December 14, 2023 00:39
> To: Yu, Mingli <Mingli.Yu@windriver.com>
> Cc: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org>
> 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
>
> On Wed, 13 Dec 2023 at 17:38, Alexander Kanavin <alex.kanavin@gmail.com> wrote:
> >
> > 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
> >
> > On Wed, 13 Dec 2023 at 11:21, Yu, Mingli <mingli.yu@eng.windriver.com> wrote:
> > >
> > > From: Mingli Yu <mingli.yu@windriver.com>
> > >
> > > 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")
> > >  > 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):
> > >  > 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 =============================
> > >
> > > Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> > > ---
> > >  .../python/python3-license-expression/run-ptest                 | 2 +-
> > >  .../python/python3-license-expression_30.1.1.bb                 | 1 +
> > >  2 files changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/meta/recipes-devtools/python/python3-license-expression/run-ptest b/meta/recipes-devtools/python/python3-license-expression/run-ptest
> > > index 5cec711696..3385d68939 100644
> > > --- a/meta/recipes-devtools/python/python3-license-expression/run-ptest
> > > +++ b/meta/recipes-devtools/python/python3-license-expression/run-ptest
> > > @@ -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}}'
> > > diff --git a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> > > index 31fb88d6e5..5d3923d487 100644
> > > --- a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> > > +++ b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
> > > @@ -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: openembedded-core+owner@lists.openembedded.org
> > > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > > -=-=-=-=-=-=-=-=-=-=-=-
> > >
Yu, Mingli Dec. 18, 2023, 8:59 a.m. UTC | #6
Hi Ross,

On 12/14/23 02:05, Ross Burton wrote:
> 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.
> 
> On 13 Dec 2023, at 10:21, Yu, Mingli via lists.openembedded.org <mingli.yu=eng.windriver.com@lists.openembedded.org> wrote:
>> -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,

> 
> 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: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [mingli.yu@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-license-expression/run-ptest b/meta/recipes-devtools/python/python3-license-expression/run-ptest
index 5cec711696..3385d68939 100644
--- a/meta/recipes-devtools/python/python3-license-expression/run-ptest
+++ b/meta/recipes-devtools/python/python3-license-expression/run-ptest
@@ -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}}'
diff --git a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
index 31fb88d6e5..5d3923d487 100644
--- a/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
+++ b/meta/recipes-devtools/python/python3-license-expression_30.1.1.bb
@@ -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}/
 }