All of lore.kernel.org
 help / color / mirror / Atom feed
* [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
@ 2020-05-12 14:23 zangrc
  2020-05-12 21:23 ` Richard Purdie
  0 siblings, 1 reply; 6+ messages in thread
From: zangrc @ 2020-05-12 14:23 UTC (permalink / raw)
  To: openembedded-devel

Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
---
 .../recipes-devtools/python/python3-parse-type/run-ptest        | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest b/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
index 5cec71169..b63c4de0d 100644
--- a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
+++ b/meta-python/recipes-devtools/python/python3-parse-type/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/SKIPPED/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}}'
-- 
2.17.1




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

* Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
  2020-05-12 14:23 [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format zangrc
@ 2020-05-12 21:23 ` Richard Purdie
  2020-05-18  6:08   ` 答复: " zangrc
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Purdie @ 2020-05-12 21:23 UTC (permalink / raw)
  To: zangrc, openembedded-devel; +Cc: Tim Orling

On Tue, 2020-05-12 at 22:23 +0800, zangrc wrote:
> Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
> ---
>  .../recipes-devtools/python/python3-parse-type/run-ptest        | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest b/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> index 5cec71169..b63c4de0d 100644
> --- a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> +++ b/meta-python/recipes-devtools/python/python3-parse-type/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/SKIPPED/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}}'

Rather than doing this for every python module, it may be an idea to
consider:

a) teaching ptest runner how to handle the alternate output format
(triggered by run-ptest-XXX instead of run-ptest)

or

b) adding a common python script which could avoid all this sed/awk
magic and the extra dependencies

or

c) patch in a parameter to pytest which outputs the data in the format
we need.

Cheers,

Richard


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

* 答复: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
  2020-05-12 21:23 ` Richard Purdie
@ 2020-05-18  6:08   ` zangrc
  0 siblings, 0 replies; 6+ messages in thread
From: zangrc @ 2020-05-18  6:08 UTC (permalink / raw)
  To: Richard Purdie, openembedded-devel; +Cc: Tim Orling

Now I have modified the output of pytest by modifying ptest-runner. My solution is that if OSS uses pytest testing, name its ptest file run-ptest-pytest.

The content of run-ptest-pytest is as follows:
pytest -o log_cli = true -o log_cli_level = INFO

The test output is as follows:
START: ptest-runner
2020-05-18T05:42
BEGIN: /usr/lib/python3-parse-type/ptest
============================= test session starts ==============================
platform linux -- Python 3.8.2, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /usr/lib/python3-parse-type/ptest
collected 192 items

PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_dict 
PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_enum_class 
PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_parse_enum_yesno 
...
PASS: tests/test_parse_util.py::TestFieldParser::test_extract_types 
PASS: tests/test_parse_util.py::TestFieldParser::test_parse__raises_error_with_missing_or_partial_br 
PASS: tests/test_parse_util.py::TestFieldParser::test_parse__with_valid_fields 


============================= 192 passed in 18.41s =============================
STOP: ptest-runner
DURATION: 32
END: /usr/lib/python3-parse-type/ptest
2020-05-18T05:42
STOP: ptest-runner

-----邮件原件-----
发件人: Richard Purdie <richard.purdie@linuxfoundation.org> 
发送时间: 2020年5月13日 5:23
收件人: Zang, Ruochen/臧 若尘 <zangrc.fnst@cn.fujitsu.com>; openembedded-devel@lists.openembedded.org
抄送: Tim Orling <ticotimo@gmail.com>
主题: Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format

On Tue, 2020-05-12 at 22:23 +0800, zangrc wrote:
> Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
> ---
>  .../recipes-devtools/python/python3-parse-type/run-ptest        | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git 
> a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest 
> b/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> index 5cec71169..b63c4de0d 100644
> --- a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> +++ b/meta-python/recipes-devtools/python/python3-parse-type/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/SKIPPED/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}}'

Rather than doing this for every python module, it may be an idea to
consider:

a) teaching ptest runner how to handle the alternate output format (triggered by run-ptest-XXX instead of run-ptest)

or

b) adding a common python script which could avoid all this sed/awk magic and the extra dependencies

or

c) patch in a parameter to pytest which outputs the data in the format we need.

Cheers,

Richard






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

* Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
  2020-05-21  1:03 ` zangrc
@ 2020-05-21 17:39   ` Khem Raj
  0 siblings, 0 replies; 6+ messages in thread
From: Khem Raj @ 2020-05-21 17:39 UTC (permalink / raw)
  To: openembedded-devel

check master, I think its already applied via
https://git.openembedded.org/meta-openembedded/commit/?id=86d1c32a818abba71c5a52d21249759cf601ab2e

if not, please send a followup.

On 5/20/20 6:03 PM, zangrc wrote:
> Ping
> 
> -----Original Message-----
> From: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> On Behalf Of zangrc
> Sent: Monday, May 18, 2020 2:12 PM
> To: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-devel@lists.openembedded.org
> Cc: Tim Orling <ticotimo@gmail.com>
> Subject: Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
> 
> Is this solution feasible, and if it is feasible, which mailing list should I submit the patch to?
> 
> -----邮件原件-----
> 发件人: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> 代表 zangrc
> 发送时间: 2020年5月18日 14:09
> 收件人: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-devel@lists.openembedded.org
> 抄送: Tim Orling <ticotimo@gmail.com>
> 主题: 答复: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
> 
> Now I have modified the output of pytest by modifying ptest-runner. My solution is that if OSS uses pytest testing, name its ptest file run-ptest-pytest.
> 
> The content of run-ptest-pytest is as follows:
> pytest -o log_cli = true -o log_cli_level = INFO
> 
> The test output is as follows:
> START: ptest-runner
> 2020-05-18T05:42
> BEGIN: /usr/lib/python3-parse-type/ptest ============================= test session starts ============================== platform linux -- Python 3.8.2, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
> rootdir: /usr/lib/python3-parse-type/ptest collected 192 items
> 
> PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_dict
> PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_enum_class
> PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_parse_enum_yesno
> ...
> PASS: tests/test_parse_util.py::TestFieldParser::test_extract_types
> PASS: tests/test_parse_util.py::TestFieldParser::test_parse__raises_error_with_missing_or_partial_br
> PASS: tests/test_parse_util.py::TestFieldParser::test_parse__with_valid_fields
> 
> 
> ============================= 192 passed in 18.41s =============================
> STOP: ptest-runner
> DURATION: 32
> END: /usr/lib/python3-parse-type/ptest
> 2020-05-18T05:42
> STOP: ptest-runner
> 
> -----邮件原件-----
> 发件人: Richard Purdie <richard.purdie@linuxfoundation.org>
> 发送时间: 2020年5月13日 5:23
> 收件人: Zang, Ruochen/臧 若尘 <zangrc.fnst@cn.fujitsu.com>; openembedded-devel@lists.openembedded.org
> 抄送: Tim Orling <ticotimo@gmail.com>
> 主题: Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
> 
> On Tue, 2020-05-12 at 22:23 +0800, zangrc wrote:
>> Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
>> ---
>>   .../recipes-devtools/python/python3-parse-type/run-ptest        | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git
>> a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
>> b/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
>> index 5cec71169..b63c4de0d 100644
>> --- a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
>> +++ b/meta-python/recipes-devtools/python/python3-parse-type/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/SKIPPED/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}}'
> 
> Rather than doing this for every python module, it may be an idea to
> consider:
> 
> a) teaching ptest runner how to handle the alternate output format (triggered by run-ptest-XXX instead of run-ptest)
> 
> or
> 
> b) adding a common python script which could avoid all this sed/awk magic and the extra dependencies
> 
> or
> 
> c) patch in a parameter to pytest which outputs the data in the format we need.
> 
> Cheers,
> 
> Richard
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

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

* Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
       [not found] <16100A98A66EDE53.23434@lists.openembedded.org>
@ 2020-05-21  1:03 ` zangrc
  2020-05-21 17:39   ` Khem Raj
  0 siblings, 1 reply; 6+ messages in thread
From: zangrc @ 2020-05-21  1:03 UTC (permalink / raw)
  To: Zang, Ruochen, Richard Purdie, openembedded-devel; +Cc: Tim Orling

Ping

-----Original Message-----
From: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> On Behalf Of zangrc
Sent: Monday, May 18, 2020 2:12 PM
To: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-devel@lists.openembedded.org
Cc: Tim Orling <ticotimo@gmail.com>
Subject: Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format

Is this solution feasible, and if it is feasible, which mailing list should I submit the patch to?

-----邮件原件-----
发件人: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> 代表 zangrc
发送时间: 2020年5月18日 14:09
收件人: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-devel@lists.openembedded.org
抄送: Tim Orling <ticotimo@gmail.com>
主题: 答复: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format

Now I have modified the output of pytest by modifying ptest-runner. My solution is that if OSS uses pytest testing, name its ptest file run-ptest-pytest.

The content of run-ptest-pytest is as follows:
pytest -o log_cli = true -o log_cli_level = INFO

The test output is as follows:
START: ptest-runner
2020-05-18T05:42
BEGIN: /usr/lib/python3-parse-type/ptest ============================= test session starts ============================== platform linux -- Python 3.8.2, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /usr/lib/python3-parse-type/ptest collected 192 items

PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_dict
PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_enum_class
PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_parse_enum_yesno
...
PASS: tests/test_parse_util.py::TestFieldParser::test_extract_types
PASS: tests/test_parse_util.py::TestFieldParser::test_parse__raises_error_with_missing_or_partial_br
PASS: tests/test_parse_util.py::TestFieldParser::test_parse__with_valid_fields 


============================= 192 passed in 18.41s =============================
STOP: ptest-runner
DURATION: 32
END: /usr/lib/python3-parse-type/ptest
2020-05-18T05:42
STOP: ptest-runner

-----邮件原件-----
发件人: Richard Purdie <richard.purdie@linuxfoundation.org>
发送时间: 2020年5月13日 5:23
收件人: Zang, Ruochen/臧 若尘 <zangrc.fnst@cn.fujitsu.com>; openembedded-devel@lists.openembedded.org
抄送: Tim Orling <ticotimo@gmail.com>
主题: Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format

On Tue, 2020-05-12 at 22:23 +0800, zangrc wrote:
> Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
> ---
>  .../recipes-devtools/python/python3-parse-type/run-ptest        | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> b/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> index 5cec71169..b63c4de0d 100644
> --- a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> +++ b/meta-python/recipes-devtools/python/python3-parse-type/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/SKIPPED/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}}'

Rather than doing this for every python module, it may be an idea to
consider:

a) teaching ptest runner how to handle the alternate output format (triggered by run-ptest-XXX instead of run-ptest)

or

b) adding a common python script which could avoid all this sed/awk magic and the extra dependencies

or

c) patch in a parameter to pytest which outputs the data in the format we need.

Cheers,

Richard










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

* Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format
@ 2020-05-18  6:11 zangrc
  0 siblings, 0 replies; 6+ messages in thread
From: zangrc @ 2020-05-18  6:11 UTC (permalink / raw)
  To: Richard Purdie, openembedded-devel; +Cc: Tim Orling

Is this solution feasible, and if it is feasible, which mailing list should I submit the patch to?

-----邮件原件-----
发件人: openembedded-devel@lists.openembedded.org <openembedded-devel@lists.openembedded.org> 代表 zangrc
发送时间: 2020年5月18日 14:09
收件人: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-devel@lists.openembedded.org
抄送: Tim Orling <ticotimo@gmail.com>
主题: 答复: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format

Now I have modified the output of pytest by modifying ptest-runner. My solution is that if OSS uses pytest testing, name its ptest file run-ptest-pytest.

The content of run-ptest-pytest is as follows:
pytest -o log_cli = true -o log_cli_level = INFO

The test output is as follows:
START: ptest-runner
2020-05-18T05:42
BEGIN: /usr/lib/python3-parse-type/ptest ============================= test session starts ============================== platform linux -- Python 3.8.2, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /usr/lib/python3-parse-type/ptest collected 192 items

PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_dict
PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_make_enum_with_enum_class
PASS: tests/test_builder.py::TestTypeBuilder4Enum::test_parse_enum_yesno
...
PASS: tests/test_parse_util.py::TestFieldParser::test_extract_types
PASS: tests/test_parse_util.py::TestFieldParser::test_parse__raises_error_with_missing_or_partial_br
PASS: tests/test_parse_util.py::TestFieldParser::test_parse__with_valid_fields 


============================= 192 passed in 18.41s =============================
STOP: ptest-runner
DURATION: 32
END: /usr/lib/python3-parse-type/ptest
2020-05-18T05:42
STOP: ptest-runner

-----邮件原件-----
发件人: Richard Purdie <richard.purdie@linuxfoundation.org>
发送时间: 2020年5月13日 5:23
收件人: Zang, Ruochen/臧 若尘 <zangrc.fnst@cn.fujitsu.com>; openembedded-devel@lists.openembedded.org
抄送: Tim Orling <ticotimo@gmail.com>
主题: Re: [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format

On Tue, 2020-05-12 at 22:23 +0800, zangrc wrote:
> Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>
> ---
>  .../recipes-devtools/python/python3-parse-type/run-ptest        | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> b/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> index 5cec71169..b63c4de0d 100644
> --- a/meta-python/recipes-devtools/python/python3-parse-type/run-ptest
> +++ b/meta-python/recipes-devtools/python/python3-parse-type/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/SKIPPED/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}}'

Rather than doing this for every python module, it may be an idea to
consider:

a) teaching ptest runner how to handle the alternate output format (triggered by run-ptest-XXX instead of run-ptest)

or

b) adding a common python script which could avoid all this sed/awk magic and the extra dependencies

or

c) patch in a parameter to pytest which outputs the data in the format we need.

Cheers,

Richard








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

end of thread, other threads:[~2020-05-21 17:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 14:23 [oe] [meta-python] [PATCH] python3-parse-type: Modify ptest output format zangrc
2020-05-12 21:23 ` Richard Purdie
2020-05-18  6:08   ` 答复: " zangrc
2020-05-18  6:11 zangrc
     [not found] <16100A98A66EDE53.23434@lists.openembedded.org>
2020-05-21  1:03 ` zangrc
2020-05-21 17:39   ` Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.