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=-8.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 16F93C433EF for ; Wed, 15 Sep 2021 14:56:55 +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 5E02360EB2 for ; Wed, 15 Sep 2021 14:56:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5E02360EB2 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]:51520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQWLF-0003g9-HG for qemu-devel@archiver.kernel.org; Wed, 15 Sep 2021 10:56:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQWFq-0004Rc-5d for qemu-devel@nongnu.org; Wed, 15 Sep 2021 10:51:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56505) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQWFZ-0001NG-0d for qemu-devel@nongnu.org; Wed, 15 Sep 2021 10:51:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631717460; 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=1VaxMp60fs54oW0tlE8/U57xFZSTNdpQ+WTiFQb2flk=; b=KlYmQUtevTLfgn2B59Ld+3DPFGdA3scLza+vAp+i1Exa77lRcoUL+zeURmPZyc3hFsQ4q5 ITL6JHtCNi+MrkQhXMcp4p40IGyOaETdWXIcmL0zXRknPNCUICV0b7VxjEs8gKZEA14VDA ebyb3xo88b0DnmRTB2I/pchqaDt7MaQ= Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-602-C95wr9DZOMCbanqzlGn9tw-1; Wed, 15 Sep 2021 10:50:58 -0400 X-MC-Unique: C95wr9DZOMCbanqzlGn9tw-1 Received: by mail-oo1-f72.google.com with SMTP id m4-20020a4ae3c4000000b00291a653baceso2229047oov.21 for ; Wed, 15 Sep 2021 07:50:58 -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=1VaxMp60fs54oW0tlE8/U57xFZSTNdpQ+WTiFQb2flk=; b=cQ53bcbnAQ5mvppokn/I1PWy03i083x6Jpcdgr4wAudrtbyVsWmn4XllUe/zJVf1q5 E4GzCOSUC0odXO72e3AbvBXvSV9sP8wWu5kHK8oUOqs/idJhYIWNDJpkljReNtk1Ryjl CxtSQmEanBfZcfUoBaszXL4GJF6meUKzXmCc7jmmmSWcmYebd8siKjCiZTqFbaACz5S3 icbA8bt4TAu9zrzvZMaskIW05EGjFfWqwu+S09fRhUoCol0vSeF/Hqza1hZwK1CnorGC iiYnEoMfEiVwfUNtzhkpxO8YOdIx9Jbe3kPxppszekhb1A9UqIb8ZX5Rm+njIJ9gmUnw sumg== X-Gm-Message-State: AOAM531H2cyCveXaA2r/6hA8aAAN02RF4c5KzdyGAUl0rtL/aEXxggYv rQioR6JgUipb8pRaY5Pdd9RBJ3+nhQCrz/fr3+m6YSh39SG7wTX2Gj2NctfBuBAZs8sOCuYHMOJ xxIYxL6mdsQGozbhJBmUrafVtMyGTDRg= X-Received: by 2002:a9d:a12:: with SMTP id 18mr286695otg.252.1631717458082; Wed, 15 Sep 2021 07:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPQN+okiTULW9dZYrWgtVh+JriBHzxvFpzGnMS3sCHAWVLzcXDmcYoknvDc8NWKTjzQgzIXsW9TNZTb88SKcg= X-Received: by 2002:a9d:a12:: with SMTP id 18mr286670otg.252.1631717457841; Wed, 15 Sep 2021 07:50:57 -0700 (PDT) MIME-Version: 1.0 References: <20210831123809.1107782-1-armbru@redhat.com> <87mtoxwuw8.fsf@dusky.pond.sub.org> In-Reply-To: <87mtoxwuw8.fsf@dusky.pond.sub.org> From: John Snow Date: Wed, 15 Sep 2021 10:50:47 -0400 Message-ID: Subject: Re: [PATCH 00/12] qapi: Fixes and cleanups for recent work (mostly) To: Markus Armbruster 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="00000000000072e02d05cc09d3e1" Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, T_SPF_HELO_TEMPERROR=0.01, T_SPF_TEMPERROR=0.01 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: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , qemu-devel , Michael Roth Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000072e02d05cc09d3e1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 documentation > >> 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 tha= t > > 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-button in most environments. 'make check-tox' and 'make check-pipenv' are executed by GitlabCI as check-python-tox and check-python-pipenv, respectively. In the meantime, I've been running tests against qapi manually -- with the scripts I included in my 'python-qapi-cleanup-pt0' branch. --js --00000000000072e02d05cc09d3e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Tue, Aug 31, 2021 at 10:28 AM Mark= us Armbruster <armbru@redhat.com> wrote:
Mar= c-Andr=C3=A9 Lureau <marcandre.lureau@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.

In the meantime, I've been running tests against = qapi manually -- with the scripts I included in my 'python-qapi-cleanup= -pt0' branch.

--js
<= /div>
--00000000000072e02d05cc09d3e1--