Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: "Nícolas F. R. A. Prado" <nfraprado@collabora.com>
To: Shuah Khan <skhan@linuxfoundation.org>
Cc: Laura Nao <laura.nao@collabora.com>,
	shuah@kernel.org, gregkh@linuxfoundation.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com
Subject: Re: [PATCH] selftests: ksft: Track skipped tests when finishing the test suite
Date: Mon, 22 Jul 2024 14:51:58 -0400	[thread overview]
Message-ID: <b558e9dd-3c09-44a2-923d-afe7bc2a7e97@notapiano> (raw)
In-Reply-To: <0fe1b57e-4557-4020-878a-7eec13a2fdb1@linuxfoundation.org>

On Mon, Jul 22, 2024 at 11:32:35AM -0600, Shuah Khan wrote:
> On 7/22/24 09:43, Laura Nao wrote:
> > Consider skipped tests in addition to passed tests when evaluating the
> > overall result of the test suite in the finished() helper.
> > 
> > Signed-off-by: Laura Nao <laura.nao@collabora.com>
> > ---
> >   tools/testing/selftests/kselftest/ksft.py | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/kselftest/ksft.py b/tools/testing/selftests/kselftest/ksft.py
> > index cd89fb2bc10e..bf215790a89d 100644
> > --- a/tools/testing/selftests/kselftest/ksft.py
> > +++ b/tools/testing/selftests/kselftest/ksft.py
> > @@ -70,7 +70,7 @@ def test_result(condition, description=""):
> >   def finished():
> > -    if ksft_cnt["pass"] == ksft_num_tests:
> > +    if ksft_cnt["pass"] + ksft_cnt["skip"] == ksft_num_tests:
> 
> Please don't. Counting skips in pass or fail isn't accurate
> reporting. skips need to be reported as skips.

Hi Shuah,

this won't change the skip count, just allow a test suite that has a mix of pass
and skip results to exit with code 0. That's the same behavior as the C
ksft_finished() helper in kselftest.h:

#define ksft_finished()			\
	ksft_exit(ksft_plan ==		\
		  ksft_cnt.ksft_pass +	\
		  ksft_cnt.ksft_xfail +	\
		  ksft_cnt.ksft_xskip)

It was my oversight to not do the same in the python helper.

Laura,

I consider this fixing an incorrect behavior, so I'd add this tag:

Fixes: dacf1d7a78bf ("kselftest: Add test to verify probe of devices from discoverable buses")

I think the message is good as is, but maybe it could have mentioned that this
matches the behavior of the C helper, just to make the point above clearer.

Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>

And just a note for the maintainers, this patch depends on "kselftest: Move ksft
helper module to common directory"
https://lore.kernel.org/all/20240705-dev-err-log-selftest-v2-2-163b9cd7b3c1@collabora.com/
which was picked through the usb tree but is queued for 6.11-rc1.

Thanks,
Nícolas

  parent reply	other threads:[~2024-07-22 18:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-22 15:43 [PATCH] selftests: ksft: Track skipped tests when finishing the test suite Laura Nao
2024-07-22 17:32 ` Shuah Khan
2024-07-22 18:42   ` Shuah Khan
2024-07-22 18:51   ` Nícolas F. R. A. Prado [this message]
2024-07-23 14:06     ` Laura Nao
2024-07-23 16:17 ` Shuah Khan
2024-07-29 14:52   ` Laura Nao
2024-07-29 20:06     ` Shuah Khan
2024-07-30 10:35       ` Laura Nao
2024-07-31 23:04         ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b558e9dd-3c09-44a2-923d-afe7bc2a7e97@notapiano \
    --to=nfraprado@collabora.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@collabora.com \
    --cc=laura.nao@collabora.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox