From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Shuah Khan <skhan@linuxfoundation.org>, Shuah Khan <shuah@kernel.org>
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>,
Aleksa Sarai <cyphar@cyphar.com>,
kernel@collabora.com, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] selftests: openat2: don't print total number of tests and then skip
Date: Thu, 1 Aug 2024 13:42:15 +0500 [thread overview]
Message-ID: <d30aa38c-5dbd-4c18-b20f-a6eb9e9e722b@collabora.com> (raw)
In-Reply-To: <c1414d9d-61b1-4f92-bc8a-333679362283@linuxfoundation.org>
On 7/31/24 9:57 PM, Shuah Khan wrote:
> On 7/31/24 07:39, Muhammad Usama Anjum wrote:
>> Don't print that 88 sub-tests are going to be executed, but then skip.
>> This is against TAP compliance. Instead check pre-requisites first
>> before printing total number of tests.
>
> Does TAP clearly mention this?
Yes from https://testanything.org/tap-version-13-specification.html
Skipping everything
This listing shows that the entire listing is a skip. No tests were run.
TAP version 13
1..0 # skip because English-to-French translator isn't installed
We can see above that we need to print 1..0 and skip without printing the
total number of tests to be executed as they are going to be skipped.
>
>>
>> Old non-tap compliant output:
>> TAP version 13
>> 1..88
>> ok 2 # SKIP all tests require euid == 0
>> # Planned tests != run tests (88 != 1)
>> # Totals: pass:0 fail:0 xfail:0 xpass:0 skip:1 error:0
>>
>> New and correct output:
>> TAP version 13
>> 1..0 # SKIP all tests require euid == 0
>
> The problem is that this new output doesn't show how many tests
> are in this test suite that could be run.
>
> I am not use if this is better for communicating coverage information
> even if meets the TAP compliance.
I think the number of tests represents the number of planned tests. If we
don't plan to run X number of tests, we shouldn't print it.
>
>>
>> Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
>> ---
>> Changes since v1:
>> - Remove simplifying if condition lines
>> - Update the patch message
>> ---
>> tools/testing/selftests/openat2/resolve_test.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/tools/testing/selftests/openat2/resolve_test.c
>> b/tools/testing/selftests/openat2/resolve_test.c
>> index bbafad440893c..85a4c64ee950d 100644
>> --- a/tools/testing/selftests/openat2/resolve_test.c
>> +++ b/tools/testing/selftests/openat2/resolve_test.c
>> @@ -508,12 +508,13 @@ void test_openat2_opath_tests(void)
>> int main(int argc, char **argv)
>> {
>> ksft_print_header();
>> - ksft_set_plan(NUM_TESTS);
>> /* NOTE: We should be checking for CAP_SYS_ADMIN here... */
>> if (geteuid() != 0)
>> ksft_exit_skip("all tests require euid == 0\n");
>> + ksft_set_plan(NUM_TESTS);
>> +
>> test_openat2_opath_tests();
>> if (ksft_get_fail_cnt() + ksft_get_error_cnt() > 0)
>
> thanks,
> -- Shuah
>
>
--
BR,
Muhammad Usama Anjum
next prev parent reply other threads:[~2024-08-01 8:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-31 13:39 [PATCH v2] selftests: openat2: don't print total number of tests and then skip Muhammad Usama Anjum
2024-07-31 14:58 ` Aleksa Sarai
2024-07-31 16:57 ` Shuah Khan
2024-08-01 8:42 ` Muhammad Usama Anjum [this message]
2024-08-01 16:27 ` Shuah Khan
2024-08-01 17:27 ` Shuah Khan
2024-08-02 5:40 ` Muhammad Usama Anjum
2024-08-02 5:38 ` Muhammad Usama Anjum
2024-08-02 23:10 ` 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=d30aa38c-5dbd-4c18-b20f-a6eb9e9e722b@collabora.com \
--to=usama.anjum@collabora.com \
--cc=cyphar@cyphar.com \
--cc=kernel@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