All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, "Peter Xu" <peterx@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PATCH 03/22] tests/qtest/migration: Stop calling everything "test"
Date: Wed, 06 Nov 2024 09:12:53 -0300	[thread overview]
Message-ID: <87zfmc1ry2.fsf@suse.de> (raw)
In-Reply-To: <Zys3F6326kF5W2Br@redhat.com>

Daniel P. Berrangé <berrange@redhat.com> writes:

> On Tue, Nov 05, 2024 at 03:08:18PM -0300, Fabiano Rosas wrote:
>> Test frameworks usually prefix "test_" to the entry point of the test
>> code. Having every function prefixed with test_ makes it hard to
>> understand the code and to grep for the actual tests.
>> 
>> Remove the "test" prefix from everything that is not a test.
>> 
>> In order to still keep some namespacing, stick to the "migrate_"
>> prefix, which is the most used currently.
>> 
>> Signed-off-by: Fabiano Rosas <farosas@suse.de>
>> ---
>> note: I would prefer the prefix "mig_" to avoid using "migrate_" which
>> is a verb, but several functions such as migrate_qmp() would have to
>> be given an entirely new name to keep expressiveness and I want to
>> keep this a mechanical change.
>> ---
>>  tests/qtest/migration-test.c | 410 +++++++++++++++++------------------
>>  1 file changed, 205 insertions(+), 205 deletions(-)
>> 
>> diff --git a/tests/qtest/migration-test.c b/tests/qtest/migration-test.c
>> index 04890e0479..a40451df1e 100644
>> --- a/tests/qtest/migration-test.c
>> +++ b/tests/qtest/migration-test.c
>
>> @@ -919,9 +919,9 @@ struct TestMigrateTLSPSKData {
>>  };
>>  
>>  static void *
>> -test_migrate_tls_psk_start_common(QTestState *from,
>> -                                  QTestState *to,
>> -                                  bool mismatch)
>> +migrate_tls_psk_start_common(QTestState *from,
>> +                             QTestState *to,
>> +                             bool mismatch)
>>  {
>>      struct TestMigrateTLSPSKData *data =
>>          g_new0(struct TestMigrateTLSPSKData, 1);
>> @@ -964,23 +964,23 @@ test_migrate_tls_psk_start_common(QTestState *from,
>>  }
>>  
>>  static void *
>> -test_migrate_tls_psk_match_start(QTestState *from,
>> -                                 QTestState *to)
>> +migrate_tls_psk_match_start(QTestState *from,
>> +                            QTestState *to)
>
> My inclination is usually to go from most general, to
> most specific, left-to-right. I think it is also worth
> distinguishing these functions as hooks, which would
> suggest:
>
>   migrate_hook_start_psk_match
>
> That makes it easy to identify all hooks by grepping
> for 'migrate_hook', or identify all start hooks by
> grepping 'migrate_hook_start', or all PSK start
> hooks with 'migrate_hook_star_psk'.
>

Sure, I don't have a preference, as long as it's consistent.

>
> With regards,
> Daniel


  reply	other threads:[~2024-11-06 12:13 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 18:08 [PATCH 00/22] tests/qtest: migration-test refactoring Fabiano Rosas
2024-11-05 18:08 ` [PATCH 01/22] tests/qtest/migration: Fix indentations Fabiano Rosas
2024-11-06  9:24   ` Daniel P. Berrangé
2024-11-05 18:08 ` [PATCH 02/22] tests/qtest/migration: Standardize hook names Fabiano Rosas
2024-11-05 18:08 ` [PATCH 03/22] tests/qtest/migration: Stop calling everything "test" Fabiano Rosas
2024-11-06  9:29   ` Daniel P. Berrangé
2024-11-06 12:12     ` Fabiano Rosas [this message]
2024-11-05 18:08 ` [PATCH 04/22] tests/migration: Disambiguate guestperf vs. a-b Fabiano Rosas
2024-11-06  9:24   ` Daniel P. Berrangé
2024-11-06 12:11     ` Fabiano Rosas
2024-11-05 18:08 ` [PATCH 05/22] tests/qtest/migration: Move bootfile code to its own file Fabiano Rosas
2024-11-06 10:48   ` Daniel P. Berrangé
2024-11-05 18:08 ` [PATCH 06/22] tests/qtest/migration: Move qmp helpers to a separate file Fabiano Rosas
2024-11-06 10:52   ` Daniel P. Berrangé
2024-11-06 12:13     ` Fabiano Rosas
2024-11-05 18:08 ` [PATCH 07/22] tests/qtest/migration: Rename migration-helpers.c Fabiano Rosas
2024-11-05 18:08 ` [PATCH 08/22] tests/qtest/migration: Move ufd_version_check to utils Fabiano Rosas
2024-11-06 11:00   ` Daniel P. Berrangé
2024-11-05 18:08 ` [PATCH 09/22] tests/qtest/migration: Move kvm_dirty_ring_supported " Fabiano Rosas
2024-11-05 18:08 ` [PATCH 10/22] tests/qtest/migration: Isolate test initialization Fabiano Rosas
2024-11-06 11:02   ` Daniel P. Berrangé
2024-11-05 18:08 ` [PATCH 11/22] tests/qtest/migration: Move common test code Fabiano Rosas
2024-11-06 11:05   ` Daniel P. Berrangé
2024-11-06 12:26     ` Fabiano Rosas
2024-11-06 12:33       ` Daniel P. Berrangé
2024-11-05 18:08 ` [PATCH 12/22] tests/qtest/migration: Split TLS tests from migration-test.c Fabiano Rosas
2024-11-06 11:15   ` Daniel P. Berrangé
2024-11-06 13:05     ` Fabiano Rosas
2024-11-06 13:13       ` Daniel P. Berrangé
2024-11-05 18:08 ` [PATCH 13/22] tests/qtest/migration: Split compression " Fabiano Rosas
2024-11-05 18:08 ` [PATCH 14/22] tests/qtest/migration: Split postcopy tests Fabiano Rosas
2024-11-05 18:08 ` [PATCH 15/22] tests/qtest/migration: Split file tests Fabiano Rosas
2024-11-05 18:08 ` [PATCH 16/22] tests/qtest/migration: Split precopy tests Fabiano Rosas
2024-11-05 18:08 ` [PATCH 17/22] tests/qtest/migration: Split CPR tests Fabiano Rosas
2024-11-05 18:08 ` [PATCH 18/22] tests/qtest/migration: Split validation tests + misc Fabiano Rosas
2024-11-05 18:08 ` [PATCH 19/22] tests/qtest/migration: Add migration-test-smoke Fabiano Rosas
2024-11-05 18:08 ` [PATCH 20/22] tests/qtest/migration: Pick smoke tests Fabiano Rosas
2024-11-05 18:08 ` [PATCH 21/22] tests/qtest: Add support for check-qtest-<subsystem> Fabiano Rosas
2024-11-06 11:11   ` Daniel P. Berrangé
2024-11-06 12:40     ` Fabiano Rosas
2024-11-06 12:42       ` Daniel P. Berrangé
2024-11-05 18:08 ` [PATCH 22/22] docs: Add migration tests documentation Fabiano Rosas

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=87zfmc1ry2.fsf@suse.de \
    --to=farosas@suse.de \
    --cc=alex.bennee@linaro.org \
    --cc=berrange@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.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 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.