Message ID | 20230915115206.132198-1-bruce.richardson@intel.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 775FC425A4; Fri, 15 Sep 2023 13:52:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AC8B402DE; Fri, 15 Sep 2023 13:52:25 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id E0FF1402D7 for <dev@dpdk.org>; Fri, 15 Sep 2023 13:52:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694778743; x=1726314743; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=1VHc3juHc6qxEo1U4cir/EkVeuuAyazhFGGgiJ2SD+Q=; b=c75OzF3Wbqq7iLZ91XwC9MFgPrG1Yowprg35XjCfe+Ag7SAgWvawUnqQ YypNc1D2hQaliGrus5qC/PvzTiOs/fCujaH6RNCIJZsJ8X3xW0M384q6q SkyAbJ64rGUMYx/T1F6LAEGdiI/yZx1rNy8qDbFiVZ07xJGL0MoKnPmwO C6IS3ywyaupv/fvxIsUH3u2RrotXSKSilY9E5wMxWWJVQTKOpQcr/9uu5 AkgHf5ymvdqZKcjuXnl7PTXAHpoAp0JI/QK65mNVdvO1RceUG6L2sDZ30 pHJpUD0A+N9yOCdEusZ/iVCeXGfbGkZqq8Myeib+bL10QoAuH2BEKkuEH w==; X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="379149102" X-IronPort-AV: E=Sophos;i="6.02,149,1688454000"; d="scan'208";a="379149102" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 04:52:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="918631206" X-IronPort-AV: E=Sophos;i="6.02,149,1688454000"; d="scan'208";a="918631206" Received: from silpixa00401385.ir.intel.com ([10.237.214.14]) by orsmga005.jf.intel.com with ESMTP; 15 Sep 2023 04:52:09 -0700 From: Bruce Richardson <bruce.richardson@intel.com> To: dev@dpdk.org Cc: david.marchand@redhat.com, Bruce Richardson <bruce.richardson@intel.com> Subject: [PATCH 0/2] add checks for tests not in a suite Date: Fri, 15 Sep 2023 12:52:04 +0100 Message-Id: <20230915115206.132198-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org |
Series |
add checks for tests not in a suite
|
|
Message
Bruce Richardson
Sept. 15, 2023, 11:52 a.m. UTC
To help ensure that we don't have "orphaned" tests not in any test suites we can add the following checks: * In developer-mode builds, emit a warning for each test defined using REGISTER_TEST_COMMAND * In checkpatches, add a check to prevent the addition of new tests using the REGISTER_TEST_COMMAND macro Bruce Richardson (2): app/test: emit warning for tests not in a test suite devtools: check for tests added without a test suite app/test/suites/meson.build | 13 ++++++++++++- buildtools/get-test-suites.py | 12 +++++++++--- devtools/checkpatches.sh | 8 ++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) -- 2.39.2
Comments
On Fri, Sep 15, 2023 at 12:52:04PM +0100, Bruce Richardson wrote: > To help ensure that we don't have "orphaned" tests not in any test > suites we can add the following checks: > > * In developer-mode builds, emit a warning for each test defined using > REGISTER_TEST_COMMAND > * In checkpatches, add a check to prevent the addition of new tests > using the REGISTER_TEST_COMMAND macro > > Bruce Richardson (2): > app/test: emit warning for tests not in a test suite > devtools: check for tests added without a test suite > While not required, if testing this set, it's recommended to apply patch [1] from David first, to reduce the warning count visible. /Bruce [1] http://patches.dpdk.org/project/dpdk/patch/20230915075801.288931-1-david.marchand@redhat.com/
On Fri, Sep 15, 2023 at 1:52 PM Bruce Richardson <bruce.richardson@intel.com> wrote: > > To help ensure that we don't have "orphaned" tests not in any test > suites we can add the following checks: > > * In developer-mode builds, emit a warning for each test defined using > REGISTER_TEST_COMMAND > * In checkpatches, add a check to prevent the addition of new tests > using the REGISTER_TEST_COMMAND macro > > Bruce Richardson (2): > app/test: emit warning for tests not in a test suite > devtools: check for tests added without a test suite > > app/test/suites/meson.build | 13 ++++++++++++- > buildtools/get-test-suites.py | 12 +++++++++--- > devtools/checkpatches.sh | 8 ++++++++ > 3 files changed, 29 insertions(+), 4 deletions(-) The "non_suite_tests" testsuite returned by buildtools/get-test-suites.py is a bit strange, as it is not a testsuite from meson pov. But otherwise, the series looks good to me.
On Tue, Sep 19, 2023 at 10:29:07AM +0200, David Marchand wrote: > On Fri, Sep 15, 2023 at 1:52 PM Bruce Richardson > <bruce.richardson@intel.com> wrote: > > > > To help ensure that we don't have "orphaned" tests not in any test > > suites we can add the following checks: > > > > * In developer-mode builds, emit a warning for each test defined using > > REGISTER_TEST_COMMAND > > * In checkpatches, add a check to prevent the addition of new tests > > using the REGISTER_TEST_COMMAND macro > > > > Bruce Richardson (2): > > app/test: emit warning for tests not in a test suite > > devtools: check for tests added without a test suite > > > > app/test/suites/meson.build | 13 ++++++++++++- > > buildtools/get-test-suites.py | 12 +++++++++--- > > devtools/checkpatches.sh | 8 ++++++++ > > 3 files changed, 29 insertions(+), 4 deletions(-) > > The "non_suite_tests" testsuite returned by > buildtools/get-test-suites.py is a bit strange, as it is not a > testsuite from meson pov. Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I did it that way to avoid having yet another script to scan the files - I figured it was faster (in terms of runtime, not dev time) to do the scanning when the files are already being opened and processed by this one. Of course, if we can get the un-suitened [:-)] test cases down to zero, we can theoretically drop this check in future, and just use the checkpatch one. /Bruce
On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson <bruce.richardson@intel.com> wrote: > > On Tue, Sep 19, 2023 at 10:29:07AM +0200, David Marchand wrote: > > On Fri, Sep 15, 2023 at 1:52 PM Bruce Richardson > > <bruce.richardson@intel.com> wrote: > > > > > > To help ensure that we don't have "orphaned" tests not in any test > > > suites we can add the following checks: > > > > > > * In developer-mode builds, emit a warning for each test defined using > > > REGISTER_TEST_COMMAND > > > * In checkpatches, add a check to prevent the addition of new tests > > > using the REGISTER_TEST_COMMAND macro > > > > > > Bruce Richardson (2): > > > app/test: emit warning for tests not in a test suite > > > devtools: check for tests added without a test suite > > > > > > app/test/suites/meson.build | 13 ++++++++++++- > > > buildtools/get-test-suites.py | 12 +++++++++--- > > > devtools/checkpatches.sh | 8 ++++++++ > > > 3 files changed, 29 insertions(+), 4 deletions(-) > > > > The "non_suite_tests" testsuite returned by > > buildtools/get-test-suites.py is a bit strange, as it is not a > > testsuite from meson pov. > > Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I > did it that way to avoid having yet another script to scan the files - I > figured it was faster (in terms of runtime, not dev time) to do the I had figured it was "faster dev time" that won :-). I am fine with it, I don't expect more complications in this area in the future. > scanning when the files are already being opened and processed by this one. > > Of course, if we can get the un-suitened [:-)] test cases down to zero, we > can theoretically drop this check in future, and just use the checkpatch > one. Well, that's still a question that nobody seems to comment on. What should we do with tests that don't enter one of those testsuites, and are not invoked by the CI? Though we may be removing some level of coverage, I am for cleaning/unused dead code.
David Marchand <david.marchand@redhat.com> writes: > On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson > <bruce.richardson@intel.com> wrote: >> >> On Tue, Sep 19, 2023 at 10:29:07AM +0200, David Marchand wrote: >> > On Fri, Sep 15, 2023 at 1:52 PM Bruce Richardson >> > <bruce.richardson@intel.com> wrote: >> > > >> > > To help ensure that we don't have "orphaned" tests not in any test >> > > suites we can add the following checks: >> > > >> > > * In developer-mode builds, emit a warning for each test defined using >> > > REGISTER_TEST_COMMAND >> > > * In checkpatches, add a check to prevent the addition of new tests >> > > using the REGISTER_TEST_COMMAND macro >> > > >> > > Bruce Richardson (2): >> > > app/test: emit warning for tests not in a test suite >> > > devtools: check for tests added without a test suite >> > > >> > > app/test/suites/meson.build | 13 ++++++++++++- >> > > buildtools/get-test-suites.py | 12 +++++++++--- >> > > devtools/checkpatches.sh | 8 ++++++++ >> > > 3 files changed, 29 insertions(+), 4 deletions(-) >> > >> > The "non_suite_tests" testsuite returned by >> > buildtools/get-test-suites.py is a bit strange, as it is not a >> > testsuite from meson pov. >> >> Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I >> did it that way to avoid having yet another script to scan the files - I >> figured it was faster (in terms of runtime, not dev time) to do the > > I had figured it was "faster dev time" that won :-). > I am fine with it, I don't expect more complications in this area in the future. > > >> scanning when the files are already being opened and processed by this one. >> >> Of course, if we can get the un-suitened [:-)] test cases down to zero, we >> can theoretically drop this check in future, and just use the checkpatch >> one. > > Well, that's still a question that nobody seems to comment on. > > What should we do with tests that don't enter one of those testsuites, > and are not invoked by the CI? > > Though we may be removing some level of coverage, I am for > cleaning/unused dead code. I guess it does require actually looking at these tests and classifying them to either put them into the proper suites. As of now, we aren't really removing coverage if they aren't being run - but are any maintainers or developers actually running them?
On Tue, Sep 26, 2023 at 5:01 PM Aaron Conole <aconole@redhat.com> wrote: > David Marchand <david.marchand@redhat.com> writes: > > On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson > > <bruce.richardson@intel.com> wrote: > >> > > To help ensure that we don't have "orphaned" tests not in any test > >> > > suites we can add the following checks: > >> > > > >> > > * In developer-mode builds, emit a warning for each test defined using > >> > > REGISTER_TEST_COMMAND > >> > > * In checkpatches, add a check to prevent the addition of new tests > >> > > using the REGISTER_TEST_COMMAND macro > >> > > > >> > > Bruce Richardson (2): > >> > > app/test: emit warning for tests not in a test suite > >> > > devtools: check for tests added without a test suite > >> > > > >> > > app/test/suites/meson.build | 13 ++++++++++++- > >> > > buildtools/get-test-suites.py | 12 +++++++++--- > >> > > devtools/checkpatches.sh | 8 ++++++++ > >> > > 3 files changed, 29 insertions(+), 4 deletions(-) > >> > > >> > The "non_suite_tests" testsuite returned by > >> > buildtools/get-test-suites.py is a bit strange, as it is not a > >> > testsuite from meson pov. > >> > >> Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I > >> did it that way to avoid having yet another script to scan the files - I > >> figured it was faster (in terms of runtime, not dev time) to do the > > > > I had figured it was "faster dev time" that won :-). > > I am fine with it, I don't expect more complications in this area in the future. > > > > > >> scanning when the files are already being opened and processed by this one. > >> > >> Of course, if we can get the un-suitened [:-)] test cases down to zero, we > >> can theoretically drop this check in future, and just use the checkpatch > >> one. > > > > Well, that's still a question that nobody seems to comment on. > > > > What should we do with tests that don't enter one of those testsuites, > > and are not invoked by the CI? > > > > Though we may be removing some level of coverage, I am for > > cleaning/unused dead code. > > I guess it does require actually looking at these tests and classifying > them to either put them into the proper suites. As of now, we aren't > really removing coverage if they aren't being run - but are any > maintainers or developers actually running them? Could we go a step further than Bruce runtime warning (which is at the meson level and does not impact running the test)? Perhaps have those orphaned tests fail unless their test names are provided in a env variable like DPDK_TRUST_ME_I_WILL_SUBMIT_A_PATCH_FOR_THIS_TEST (naming is hard ;-))? With a systematic failure, there is less chance that developers/maintainers miss the situation. If those developers/maintainers simply waive the warning with the env variable and don't send a patch, well.. too bad. After a release or two, if we don't hear from anyone, we can start removing the unused one.
On Wed, Sep 27, 2023 at 08:30:05AM +0200, David Marchand wrote: > On Tue, Sep 26, 2023 at 5:01 PM Aaron Conole <aconole@redhat.com> wrote: > > David Marchand <david.marchand@redhat.com> writes: > > > On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson > > > <bruce.richardson@intel.com> wrote: > > >> > > To help ensure that we don't have "orphaned" tests not in any test > > >> > > suites we can add the following checks: > > >> > > > > >> > > * In developer-mode builds, emit a warning for each test defined using > > >> > > REGISTER_TEST_COMMAND > > >> > > * In checkpatches, add a check to prevent the addition of new tests > > >> > > using the REGISTER_TEST_COMMAND macro > > >> > > > > >> > > Bruce Richardson (2): > > >> > > app/test: emit warning for tests not in a test suite > > >> > > devtools: check for tests added without a test suite > > >> > > > > >> > > app/test/suites/meson.build | 13 ++++++++++++- > > >> > > buildtools/get-test-suites.py | 12 +++++++++--- > > >> > > devtools/checkpatches.sh | 8 ++++++++ > > >> > > 3 files changed, 29 insertions(+), 4 deletions(-) > > >> > > > >> > The "non_suite_tests" testsuite returned by > > >> > buildtools/get-test-suites.py is a bit strange, as it is not a > > >> > testsuite from meson pov. > > >> > > >> Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I > > >> did it that way to avoid having yet another script to scan the files - I > > >> figured it was faster (in terms of runtime, not dev time) to do the > > > > > > I had figured it was "faster dev time" that won :-). > > > I am fine with it, I don't expect more complications in this area in the future. > > > > > > > > >> scanning when the files are already being opened and processed by this one. > > >> > > >> Of course, if we can get the un-suitened [:-)] test cases down to zero, we > > >> can theoretically drop this check in future, and just use the checkpatch > > >> one. > > > > > > Well, that's still a question that nobody seems to comment on. > > > > > > What should we do with tests that don't enter one of those testsuites, > > > and are not invoked by the CI? > > > > > > Though we may be removing some level of coverage, I am for > > > cleaning/unused dead code. > > > > I guess it does require actually looking at these tests and classifying > > them to either put them into the proper suites. As of now, we aren't > > really removing coverage if they aren't being run - but are any > > maintainers or developers actually running them? > > Could we go a step further than Bruce runtime warning (which is at the > meson level and does not impact running the test)? > Perhaps have those orphaned tests fail unless their test names are > provided in a env variable like > DPDK_TRUST_ME_I_WILL_SUBMIT_A_PATCH_FOR_THIS_TEST (naming is hard > ;-))? > > With a systematic failure, there is less chance that > developers/maintainers miss the situation. > If those developers/maintainers simply waive the warning with the env > variable and don't send a patch, well.. too bad. > > After a release or two, if we don't hear from anyone, we can start > removing the unused one. > I think that seems a littel severe at this point. The one gap we have right now, as far as I can see, is actually explaining what the various suite types are, so that developers can choose the right one for their test(s). We may even need a couple more if some tests do not fit into the existing categories. Once that is done, we should then start looking for tests that are obsolete and can be removed. If we do already have documentation on the various suites and how to use them, apologies for my ignorance, and perhaps someone could post a link here. /Bruce
On Wed, Sep 27, 2023 at 10:27 AM Bruce Richardson <bruce.richardson@intel.com> wrote: > On Wed, Sep 27, 2023 at 08:30:05AM +0200, David Marchand wrote: > > On Tue, Sep 26, 2023 at 5:01 PM Aaron Conole <aconole@redhat.com> wrote: > > > David Marchand <david.marchand@redhat.com> writes: > > > > On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson > > > > <bruce.richardson@intel.com> wrote: > > > >> > > To help ensure that we don't have "orphaned" tests not in any test > > > >> > > suites we can add the following checks: > > > >> > > > > > >> > > * In developer-mode builds, emit a warning for each test defined using > > > >> > > REGISTER_TEST_COMMAND > > > >> > > * In checkpatches, add a check to prevent the addition of new tests > > > >> > > using the REGISTER_TEST_COMMAND macro > > > >> > > > > > >> > > Bruce Richardson (2): > > > >> > > app/test: emit warning for tests not in a test suite > > > >> > > devtools: check for tests added without a test suite > > > >> > > > > > >> > > app/test/suites/meson.build | 13 ++++++++++++- > > > >> > > buildtools/get-test-suites.py | 12 +++++++++--- > > > >> > > devtools/checkpatches.sh | 8 ++++++++ > > > >> > > 3 files changed, 29 insertions(+), 4 deletions(-) > > > >> > > > > >> > The "non_suite_tests" testsuite returned by > > > >> > buildtools/get-test-suites.py is a bit strange, as it is not a > > > >> > testsuite from meson pov. > > > >> > > > >> Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I > > > >> did it that way to avoid having yet another script to scan the files - I > > > >> figured it was faster (in terms of runtime, not dev time) to do the > > > > > > > > I had figured it was "faster dev time" that won :-). > > > > I am fine with it, I don't expect more complications in this area in the future. > > > > > > > > > > > >> scanning when the files are already being opened and processed by this one. > > > >> > > > >> Of course, if we can get the un-suitened [:-)] test cases down to zero, we > > > >> can theoretically drop this check in future, and just use the checkpatch > > > >> one. > > > > > > > > Well, that's still a question that nobody seems to comment on. > > > > > > > > What should we do with tests that don't enter one of those testsuites, > > > > and are not invoked by the CI? > > > > > > > > Though we may be removing some level of coverage, I am for > > > > cleaning/unused dead code. > > > > > > I guess it does require actually looking at these tests and classifying > > > them to either put them into the proper suites. As of now, we aren't > > > really removing coverage if they aren't being run - but are any > > > maintainers or developers actually running them? > > > > Could we go a step further than Bruce runtime warning (which is at the > > meson level and does not impact running the test)? > > Perhaps have those orphaned tests fail unless their test names are > > provided in a env variable like > > DPDK_TRUST_ME_I_WILL_SUBMIT_A_PATCH_FOR_THIS_TEST (naming is hard > > ;-))? > > > > With a systematic failure, there is less chance that > > developers/maintainers miss the situation. > > If those developers/maintainers simply waive the warning with the env > > variable and don't send a patch, well.. too bad. > > > > After a release or two, if we don't hear from anyone, we can start > > removing the unused one. > > > I think that seems a littel severe at this point. > > The one gap we have right now, as far as I can see, is actually explaining > what the various suite types are, so that developers can choose the right > one for their test(s). We may even need a couple more if some tests do not > fit into the existing categories. Once that is done, we should then start > looking for tests that are obsolete and can be removed. > > If we do already have documentation on the various suites and how to use > them, apologies for my ignorance, and perhaps someone could post a link > here. We have some guidelines but I agree the testsuites are not described. https://doc.dpdk.org/guides/contributing/unit_test.html
On Wed, Sep 27, 2023 at 11:31:07AM +0200, David Marchand wrote: > On Wed, Sep 27, 2023 at 10:27 AM Bruce Richardson > <bruce.richardson@intel.com> wrote: > > On Wed, Sep 27, 2023 at 08:30:05AM +0200, David Marchand wrote: > > > On Tue, Sep 26, 2023 at 5:01 PM Aaron Conole <aconole@redhat.com> wrote: > > > > David Marchand <david.marchand@redhat.com> writes: > > > > > On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson > > > > > <bruce.richardson@intel.com> wrote: > > > > >> > > To help ensure that we don't have "orphaned" tests not in any test > > > > >> > > suites we can add the following checks: > > > > >> > > > > > > >> > > * In developer-mode builds, emit a warning for each test defined using > > > > >> > > REGISTER_TEST_COMMAND > > > > >> > > * In checkpatches, add a check to prevent the addition of new tests > > > > >> > > using the REGISTER_TEST_COMMAND macro > > > > >> > > > > > > >> > > Bruce Richardson (2): > > > > >> > > app/test: emit warning for tests not in a test suite > > > > >> > > devtools: check for tests added without a test suite > > > > >> > > > > > > >> > > app/test/suites/meson.build | 13 ++++++++++++- > > > > >> > > buildtools/get-test-suites.py | 12 +++++++++--- > > > > >> > > devtools/checkpatches.sh | 8 ++++++++ > > > > >> > > 3 files changed, 29 insertions(+), 4 deletions(-) > > > > >> > > > > > >> > The "non_suite_tests" testsuite returned by > > > > >> > buildtools/get-test-suites.py is a bit strange, as it is not a > > > > >> > testsuite from meson pov. > > > > >> > > > > >> Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I > > > > >> did it that way to avoid having yet another script to scan the files - I > > > > >> figured it was faster (in terms of runtime, not dev time) to do the > > > > > > > > > > I had figured it was "faster dev time" that won :-). > > > > > I am fine with it, I don't expect more complications in this area in the future. > > > > > > > > > > > > > > >> scanning when the files are already being opened and processed by this one. > > > > >> > > > > >> Of course, if we can get the un-suitened [:-)] test cases down to zero, we > > > > >> can theoretically drop this check in future, and just use the checkpatch > > > > >> one. > > > > > > > > > > Well, that's still a question that nobody seems to comment on. > > > > > > > > > > What should we do with tests that don't enter one of those testsuites, > > > > > and are not invoked by the CI? > > > > > > > > > > Though we may be removing some level of coverage, I am for > > > > > cleaning/unused dead code. > > > > > > > > I guess it does require actually looking at these tests and classifying > > > > them to either put them into the proper suites. As of now, we aren't > > > > really removing coverage if they aren't being run - but are any > > > > maintainers or developers actually running them? > > > > > > Could we go a step further than Bruce runtime warning (which is at the > > > meson level and does not impact running the test)? > > > Perhaps have those orphaned tests fail unless their test names are > > > provided in a env variable like > > > DPDK_TRUST_ME_I_WILL_SUBMIT_A_PATCH_FOR_THIS_TEST (naming is hard > > > ;-))? > > > > > > With a systematic failure, there is less chance that > > > developers/maintainers miss the situation. > > > If those developers/maintainers simply waive the warning with the env > > > variable and don't send a patch, well.. too bad. > > > > > > After a release or two, if we don't hear from anyone, we can start > > > removing the unused one. > > > > > I think that seems a littel severe at this point. > > > > The one gap we have right now, as far as I can see, is actually explaining > > what the various suite types are, so that developers can choose the right > > one for their test(s). We may even need a couple more if some tests do not > > fit into the existing categories. Once that is done, we should then start > > looking for tests that are obsolete and can be removed. > > > > If we do already have documentation on the various suites and how to use > > them, apologies for my ignorance, and perhaps someone could post a link > > here. > > We have some guidelines but I agree the testsuites are not described. > https://doc.dpdk.org/guides/contributing/unit_test.html > I also see I missed updating the reference to REGISTER_TEST_COMMAND in the docs. I'll do a patch for a doc update for that. /Bruce
Bruce Richardson <bruce.richardson@intel.com> writes: > On Wed, Sep 27, 2023 at 11:31:07AM +0200, David Marchand wrote: >> On Wed, Sep 27, 2023 at 10:27 AM Bruce Richardson >> <bruce.richardson@intel.com> wrote: >> > On Wed, Sep 27, 2023 at 08:30:05AM +0200, David Marchand wrote: >> > > On Tue, Sep 26, 2023 at 5:01 PM Aaron Conole <aconole@redhat.com> wrote: >> > > > David Marchand <david.marchand@redhat.com> writes: >> > > > > On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson >> > > > > <bruce.richardson@intel.com> wrote: >> > > > >> > > To help ensure that we don't have "orphaned" tests not in any test >> > > > >> > > suites we can add the following checks: >> > > > >> > > >> > > > >> > > * In developer-mode builds, emit a warning for each test defined using >> > > > >> > > REGISTER_TEST_COMMAND >> > > > >> > > * In checkpatches, add a check to prevent the addition of new tests >> > > > >> > > using the REGISTER_TEST_COMMAND macro >> > > > >> > > >> > > > >> > > Bruce Richardson (2): >> > > > >> > > app/test: emit warning for tests not in a test suite >> > > > >> > > devtools: check for tests added without a test suite >> > > > >> > > >> > > > >> > > app/test/suites/meson.build | 13 ++++++++++++- >> > > > >> > > buildtools/get-test-suites.py | 12 +++++++++--- >> > > > >> > > devtools/checkpatches.sh | 8 ++++++++ >> > > > >> > > 3 files changed, 29 insertions(+), 4 deletions(-) >> > > > >> > >> > > > >> > The "non_suite_tests" testsuite returned by >> > > > >> > buildtools/get-test-suites.py is a bit strange, as it is not a >> > > > >> > testsuite from meson pov. >> > > > >> >> > > > >> Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I >> > > > >> did it that way to avoid having yet another script to scan the files - I >> > > > >> figured it was faster (in terms of runtime, not dev time) to do the >> > > > > >> > > > > I had figured it was "faster dev time" that won :-). >> > > > > I am fine with it, I don't expect more complications in this area in the future. >> > > > > >> > > > > >> > > > >> scanning when the files are already being opened and processed by this one. >> > > > >> >> > > > >> Of course, if we can get the un-suitened [:-)] test cases down to zero, we >> > > > >> can theoretically drop this check in future, and just use the checkpatch >> > > > >> one. >> > > > > >> > > > > Well, that's still a question that nobody seems to comment on. >> > > > > >> > > > > What should we do with tests that don't enter one of those testsuites, >> > > > > and are not invoked by the CI? >> > > > > >> > > > > Though we may be removing some level of coverage, I am for >> > > > > cleaning/unused dead code. >> > > > >> > > > I guess it does require actually looking at these tests and classifying >> > > > them to either put them into the proper suites. As of now, we aren't >> > > > really removing coverage if they aren't being run - but are any >> > > > maintainers or developers actually running them? >> > > >> > > Could we go a step further than Bruce runtime warning (which is at the >> > > meson level and does not impact running the test)? >> > > Perhaps have those orphaned tests fail unless their test names are >> > > provided in a env variable like >> > > DPDK_TRUST_ME_I_WILL_SUBMIT_A_PATCH_FOR_THIS_TEST (naming is hard >> > > ;-))? >> > > >> > > With a systematic failure, there is less chance that >> > > developers/maintainers miss the situation. >> > > If those developers/maintainers simply waive the warning with the env >> > > variable and don't send a patch, well.. too bad. >> > > >> > > After a release or two, if we don't hear from anyone, we can start >> > > removing the unused one. >> > > >> > I think that seems a littel severe at this point. >> > >> > The one gap we have right now, as far as I can see, is actually explaining >> > what the various suite types are, so that developers can choose the right >> > one for their test(s). We may even need a couple more if some tests do not >> > fit into the existing categories. Once that is done, we should then start >> > looking for tests that are obsolete and can be removed. >> > >> > If we do already have documentation on the various suites and how to use >> > them, apologies for my ignorance, and perhaps someone could post a link >> > here. >> >> We have some guidelines but I agree the testsuites are not described. >> https://doc.dpdk.org/guides/contributing/unit_test.html >> > I also see I missed updating the reference to REGISTER_TEST_COMMAND in the > docs. I'll do a patch for a doc update for that. Yeah, we should do some kind of breakout definition of the test suites. I will try to cook a patch, but the suites themselves are a bit ambiguous at the moment. Gotta start somewhere, though. > /Bruce
On Wed, Sep 27, 2023 at 10:27 AM Bruce Richardson <bruce.richardson@intel.com> wrote: > > On Wed, Sep 27, 2023 at 08:30:05AM +0200, David Marchand wrote: > > On Tue, Sep 26, 2023 at 5:01 PM Aaron Conole <aconole@redhat.com> wrote: > > > David Marchand <david.marchand@redhat.com> writes: > > > > On Tue, Sep 19, 2023 at 10:36 AM Bruce Richardson > > > > <bruce.richardson@intel.com> wrote: > > > >> > > To help ensure that we don't have "orphaned" tests not in any test > > > >> > > suites we can add the following checks: > > > >> > > > > > >> > > * In developer-mode builds, emit a warning for each test defined using > > > >> > > REGISTER_TEST_COMMAND > > > >> > > * In checkpatches, add a check to prevent the addition of new tests > > > >> > > using the REGISTER_TEST_COMMAND macro > > > >> > > > > > >> > > Bruce Richardson (2): > > > >> > > app/test: emit warning for tests not in a test suite > > > >> > > devtools: check for tests added without a test suite > > > >> > > > > > >> > > app/test/suites/meson.build | 13 ++++++++++++- > > > >> > > buildtools/get-test-suites.py | 12 +++++++++--- > > > >> > > devtools/checkpatches.sh | 8 ++++++++ > > > >> > > 3 files changed, 29 insertions(+), 4 deletions(-) > > > >> > > > > >> > The "non_suite_tests" testsuite returned by > > > >> > buildtools/get-test-suites.py is a bit strange, as it is not a > > > >> > testsuite from meson pov. > > > >> > > > >> Yeah, it is a bit strange, and I'm open to new ideas on other solutions. I > > > >> did it that way to avoid having yet another script to scan the files - I > > > >> figured it was faster (in terms of runtime, not dev time) to do the > > > > > > > > I had figured it was "faster dev time" that won :-). > > > > I am fine with it, I don't expect more complications in this area in the future. > > > > > > > > > > > >> scanning when the files are already being opened and processed by this one. > > > >> > > > >> Of course, if we can get the un-suitened [:-)] test cases down to zero, we > > > >> can theoretically drop this check in future, and just use the checkpatch > > > >> one. > > > > > > > > Well, that's still a question that nobody seems to comment on. > > > > > > > > What should we do with tests that don't enter one of those testsuites, > > > > and are not invoked by the CI? > > > > > > > > Though we may be removing some level of coverage, I am for > > > > cleaning/unused dead code. > > > > > > I guess it does require actually looking at these tests and classifying > > > them to either put them into the proper suites. As of now, we aren't > > > really removing coverage if they aren't being run - but are any > > > maintainers or developers actually running them? > > > > Could we go a step further than Bruce runtime warning (which is at the > > meson level and does not impact running the test)? > > Perhaps have those orphaned tests fail unless their test names are > > provided in a env variable like > > DPDK_TRUST_ME_I_WILL_SUBMIT_A_PATCH_FOR_THIS_TEST (naming is hard > > ;-))? > > > > With a systematic failure, there is less chance that > > developers/maintainers miss the situation. > > If those developers/maintainers simply waive the warning with the env > > variable and don't send a patch, well.. too bad. > > > > After a release or two, if we don't hear from anyone, we can start > > removing the unused one. > > > I think that seems a littel severe at this point. I'll put this idea in the fridge for now. Let's proceed with your series first (and some doc followups).
On Fri, Sep 15, 2023 at 1:52 PM Bruce Richardson <bruce.richardson@intel.com> wrote: > > To help ensure that we don't have "orphaned" tests not in any test > suites we can add the following checks: > > * In developer-mode builds, emit a warning for each test defined using > REGISTER_TEST_COMMAND > * In checkpatches, add a check to prevent the addition of new tests > using the REGISTER_TEST_COMMAND macro > > Bruce Richardson (2): > app/test: emit warning for tests not in a test suite > devtools: check for tests added without a test suite > > app/test/suites/meson.build | 13 ++++++++++++- > buildtools/get-test-suites.py | 12 +++++++++--- > devtools/checkpatches.sh | 8 ++++++++ > 3 files changed, 29 insertions(+), 4 deletions(-) Series applied. Thanks Bruce.