From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A8EDC433F5 for ; Wed, 15 Sep 2021 15:40:11 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7CF00611C1 for ; Wed, 15 Sep 2021 15:40:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7CF00611C1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:54852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQX17-0001uI-BR for qemu-devel@archiver.kernel.org; Wed, 15 Sep 2021 11:40:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQX0E-0001DX-Qw for qemu-devel@nongnu.org; Wed, 15 Sep 2021 11:39:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQX09-0002IO-Rk for qemu-devel@nongnu.org; Wed, 15 Sep 2021 11:39:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631720348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5m9k+jwa4suiD2VrkgSppJ3RqxHZJM/jT4dySR6zMZE=; b=PAUIaTnKhBUNEv/M+QSE/quUFIGEh+dGzZjjxuQTkIhXeRhpLCwOnBYGHEdTI6vBy2Iews naUYvxuX5aJu6hujA489nsSaUaAFDF2FYyEKdSybHNDOvYc+CSUCUniUnSXRzf8Pa2G7T1 lzKdLWMwQoYRocKSG296aQgrSEyHXCA= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-423-_8e7ryvZOBitIllIZhZk4w-1; Wed, 15 Sep 2021 11:39:07 -0400 X-MC-Unique: _8e7ryvZOBitIllIZhZk4w-1 Received: by mail-ot1-f70.google.com with SMTP id i7-20020a9d6507000000b0051c10643794so2808078otl.22 for ; Wed, 15 Sep 2021 08:39:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5m9k+jwa4suiD2VrkgSppJ3RqxHZJM/jT4dySR6zMZE=; b=zXwyEG0MeyXPvFl+AXDERtQcz0H2gaPlgy0OFea6ajg1B/KA0VJ4LPEZkGc8JdUH4P 92Z4h1shxz9fekmzN7VGViD7kyYC7uevnZwgiEBoQRbqHhP+mQ49cl3hiFaE82oI7Gn0 a0HAmKaF880WttX6Beu4NEwDF+wwsFg+aRi+/WpgorLwPjCNhmIUkD/aLzz2/WwXjuDu 6io6oC2Rr38OGmKWyBy4+Euvf+CzbnouFL2libEonU+KPVB17aSCfx/JczlroSXQqsUy P2Z/87Xqwd9pYKc8tMAt2LX4Iax5rJqe7R9C9Or1/AQ6wYYOAgCWtBAGn2aZRMC3wGlT c7TQ== X-Gm-Message-State: AOAM5318CBZEJG+vkxfcgkIzHtkFmMF/x7O9hqpnzdLL3q8EW4KHG6Za nmmhNbg8GRVUrbR8yJBOphlnO615q87ukUGFAhkF7VtWg7TaylMY6u4lP4iHB848gloh03Beh48 hs7AYg1JmPR3ncM4qZOnZ8nuhNdGaeYk= X-Received: by 2002:a05:6808:a01:: with SMTP id n1mr216937oij.52.1631720346526; Wed, 15 Sep 2021 08:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ7TdQiI5WvUOo0iQTvwJvQ+0GxfDB/f5JbIA9O1M3gQzuCGJpysfrwhc6H0gtKD4ofLk9AtPu4IPTj9vrMo0= X-Received: by 2002:a05:6808:a01:: with SMTP id n1mr215014oij.52.1631720316373; Wed, 15 Sep 2021 08:38:36 -0700 (PDT) MIME-Version: 1.0 References: <20210831123809.1107782-1-armbru@redhat.com> <87mtoxwuw8.fsf@dusky.pond.sub.org> In-Reply-To: From: John Snow Date: Wed, 15 Sep 2021 11:38:25 -0400 Message-ID: Subject: Re: [PATCH 00/12] qapi: Fixes and cleanups for recent work (mostly) To: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000d49c0405cc0a7d55" Received-SPF: pass client-ip=216.205.24.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.39, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Roth , Markus Armbruster , qemu-devel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000d49c0405cc0a7d55 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Sep 15, 2021 at 11:08 AM Marc-Andr=C3=A9 Lureau < marcandre.lureau@redhat.com> wrote: > Hi > > On Wed, Sep 15, 2021 at 6:51 PM John Snow wrote: > >> >> >> On Tue, Aug 31, 2021 at 10:28 AM Markus Armbruster >> wrote: >> >>> Marc-Andr=C3=A9 Lureau writes: >>> >>> > On Tue, Aug 31, 2021 at 4:38 PM Markus Armbruster >>> wrote: >>> > >>> >> Markus Armbruster (12): >>> >> qapi: Simplify QAPISchemaIfCond's interface for generating C >>> >> qapi: Simplify how QAPISchemaIfCond represents "no condition" >>> >> tests/qapi-schema: Correct two 'if' conditionals >>> >> tests/qapi-schema: Demonstrate broken C code for 'if' >>> >> qapi: Fix C code generation for 'if' >>> >> qapi: Factor common recursion out of cgen_ifcond(), docgen_ifcond(= ) >>> >> qapi: Avoid redundant parens in code generated for conditionals >>> >> qapi: Use "not COND" instead of "!COND" for generated documentatio= n >>> >> qapi: Use re.fullmatch() where appropriate >>> >> tests/qapi-schema: Hide OrderedDict in test output >>> >> qapi: Tweak error messages for missing / conflicting meta-type >>> >> qapi: Tweak error messages for unknown / conflicting 'if' keys >>> >> >>> >> scripts/qapi/common.py | 51 >>> ++++++++++++++----------- >>> >> scripts/qapi/expr.py | 32 +++++++--------- >>> >> scripts/qapi/gen.py | 6 +-- >>> >> scripts/qapi/introspect.py | 6 +-- >>> >> scripts/qapi/schema.py | 12 +++++- >>> >> scripts/qapi/types.py | 22 +++++------ >>> >> scripts/qapi/visit.py | 14 +++---- >>> >> tests/qapi-schema/bad-if-key.err | 2 +- >>> >> tests/qapi-schema/bad-if-keys.err | 2 +- >>> >> tests/qapi-schema/doc-good.json | 2 +- >>> >> tests/qapi-schema/doc-good.out | 6 +-- >>> >> tests/qapi-schema/doc-good.txt | 8 ++-- >>> >> tests/qapi-schema/double-type.err | 4 +- >>> >> tests/qapi-schema/enum-if-invalid.err | 2 +- >>> >> tests/qapi-schema/missing-type.err | 2 +- >>> >> tests/qapi-schema/qapi-schema-test.json | 9 +++-- >>> >> tests/qapi-schema/qapi-schema-test.out | 31 ++++++++------- >>> >> tests/qapi-schema/test-qapi.py | 11 +++++- >>> >> 18 files changed, 118 insertions(+), 104 deletions(-) >>> >> >>> >> >>> > The first patch, you should apply isort >>> >>> Will fix. >>> >>> > The first patch, you should apply isort (we should have a check for >>> that >>> > and linters I suppose). >>> >>> John will get us there. >>> >>> >> The goal is to move scripts/qapi to python/qemu/qapi where it will be >> covered by the tests that exist there. >> Try going to the python/ directory and run 'make' to see help output on >> what tests are available and how to invoke them, and what they actually >> test. >> >> "make check-dev" is the target that requires the least amount of >> dependencies and environment setup to run, and should be nearly push-but= ton >> in most environments. >> 'make check-tox' and 'make check-pipenv' are executed by GitlabCI as >> check-python-tox and check-python-pipenv, respectively. >> >> > What about a pre-commit hook? > "patches welcome" ? There are other python tests likely to go here in the future too, so it might be too costly to run as a commit hook. YMMV. --js --000000000000d49c0405cc0a7d55 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Wed, Sep 15, 2021 at 11:08 AM Marc= -Andr=C3=A9 Lureau <marca= ndre.lureau@redhat.com> wrote:
Hi

On Wed, Sep 1= 5, 2021 at 6:51 PM John Snow <jsnow@redhat.com> wrote:

On Tue, A= ug 31, 2021 at 10:28 AM Markus Armbruster <armbru@redhat.com> wrote:
Marc-Andr=C3=A9 Lureau <marcandre.lurea= u@redhat.com> writes:

> On Tue, Aug 31, 2021 at 4:38 PM Markus Armbruster <armbru@redhat.com> wrote:
>
>> Markus Armbruster (12):
>>=C2=A0 =C2=A0qapi: Simplify QAPISchemaIfCond's interface for ge= nerating C
>>=C2=A0 =C2=A0qapi: Simplify how QAPISchemaIfCond represents "n= o condition"
>>=C2=A0 =C2=A0tests/qapi-schema: Correct two 'if' conditiona= ls
>>=C2=A0 =C2=A0tests/qapi-schema: Demonstrate broken C code for '= if'
>>=C2=A0 =C2=A0qapi: Fix C code generation for 'if'
>>=C2=A0 =C2=A0qapi: Factor common recursion out of cgen_ifcond(), do= cgen_ifcond()
>>=C2=A0 =C2=A0qapi: Avoid redundant parens in code generated for con= ditionals
>>=C2=A0 =C2=A0qapi: Use "not COND" instead of "!COND&= quot; for generated documentation
>>=C2=A0 =C2=A0qapi: Use re.fullmatch() where appropriate
>>=C2=A0 =C2=A0tests/qapi-schema: Hide OrderedDict in test output
>>=C2=A0 =C2=A0qapi: Tweak error messages for missing / conflicting m= eta-type
>>=C2=A0 =C2=A0qapi: Tweak error messages for unknown / conflicting &= #39;if' keys
>>
>>=C2=A0 scripts/qapi/common.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 | 51 ++++++++++++++-----------
>>=C2=A0 scripts/qapi/expr.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 32 +++++++---------
>>=C2=A0 scripts/qapi/gen.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 6 +--
>>=C2=A0 scripts/qapi/introspect.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 |=C2=A0 6 +--
>>=C2=A0 scripts/qapi/schema.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 | 12 +++++-
>>=C2=A0 scripts/qapi/types.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 22 +++++------
>>=C2=A0 scripts/qapi/visit.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 14 +++----
>>=C2=A0 tests/qapi-schema/bad-if-key.err=C2=A0 =C2=A0 =C2=A0 =C2=A0 = |=C2=A0 2 +-
>>=C2=A0 tests/qapi-schema/bad-if-keys.err=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 2 +-
>>=C2=A0 tests/qapi-schema/doc-good.json=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0|=C2=A0 2 +-
>>=C2=A0 tests/qapi-schema/doc-good.out=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 6 +--
>>=C2=A0 tests/qapi-schema/doc-good.txt=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 |=C2=A0 8 ++--
>>=C2=A0 tests/qapi-schema/double-type.err=C2=A0 =C2=A0 =C2=A0 =C2=A0= |=C2=A0 4 +-
>>=C2=A0 tests/qapi-schema/enum-if-invalid.err=C2=A0 =C2=A0|=C2=A0 2 = +-
>>=C2=A0 tests/qapi-schema/missing-type.err=C2=A0 =C2=A0 =C2=A0 |=C2= =A0 2 +-
>>=C2=A0 tests/qapi-schema/qapi-schema-test.json |=C2=A0 9 +++--
>>=C2=A0 tests/qapi-schema/qapi-schema-test.out=C2=A0 | 31 ++++++++--= -----
>>=C2=A0 tests/qapi-schema/test-qapi.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 | 11 +++++-
>>=C2=A0 18 files changed, 118 insertions(+), 104 deletions(-)
>>
>>
> The first patch, you should apply isort

Will fix.

> The first patch, you should apply isort (we should have a check for th= at
> and linters I suppose).

John will get us there.


The goal is to move scripts/qapi = to python/qemu/qapi where it will be covered by the tests that exist there.=
Try going to the python/ directory and run 'make' to see= help output on what tests are available and how to invoke them, and what t= hey actually test.

"make check-dev" = is the target that requires the least amount of dependencies and environmen= t setup to run, and should be nearly push-button in most environments.
'make check-tox' and 'make check-pipenv' are executed= by GitlabCI as check-python-tox and check-python-pipenv, respectively.

=C2=A0
What = about a pre-commit hook?

"patches welcome" ? There are other python t= ests likely to go here in the future too, so it might be too costly to run = as a commit hook. YMMV.

--js

--000000000000d49c0405cc0a7d55--