From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id F1CB85A004F for ; Mon, 08 Jul 2024 12:01:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1720432869; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=5t7hgsqRBp3n6qqg88it+TDKWYOpW6VJ3bEQplY0tE4=; b=TaiyWiYAn/VFl/aqlGKtGD04wkcAv920twdAmJATVahrsOkBhUY2uif6cgSMHKxV6Gp6DF wXC2RECpaSoAcZBFHTM+nIt4YGoY1N1WwJ0c6nvexVT4yWuFe5Xs+DhaIY8nAmHEKZuWiY 5TVfMZN9YnHhBob3TS/WkJgqPovC6UU= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-203-iE-D3FhTP6-M41U69Z3z4A-1; Mon, 08 Jul 2024 06:01:08 -0400 X-MC-Unique: iE-D3FhTP6-M41U69Z3z4A-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-6b5e0b5c9eeso53229526d6.3 for ; Mon, 08 Jul 2024 03:01:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720432868; x=1721037668; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=5t7hgsqRBp3n6qqg88it+TDKWYOpW6VJ3bEQplY0tE4=; b=r42mQtOtp3F38TrSjSfrgIRqJtqMfNH59mv+t9WKRSC0W2h84V0lHk50yhxY7Ev70/ Z2zJUp7TMRT2xXxhzGB24+FpfAUtDIj4qMHqG+zq88I8oxCxi1hMV26Ldm4aejjyHvlu 1QfQCLpRi4eOPEcxvtgmmYjfAT/UFpI5gzoralz7Iz8zpCJQDi2N2+OjnKm1CC1m2TGP lfn/JcAodsS6ogu7Blk9nYDm5HtZ6vh7L9YQ0ztU4wqhCOTo2VTlEOwA9iBOimmoay9G aHKBtTrbgARjZV6nniBUsFJzqxfZOM6XhY9VhEvhjVm3Go8QrHPIVAnJ9yNysdN4R3Tb Duag== X-Forwarded-Encrypted: i=1; AJvYcCWeDNHHO8kkHSz5diIht3QXdIq4Et7UVgVyFqdpj/5+nx5e1bNtq8ZmVl5165HuFuzlelbyEIqzNP1VkJSZADdydKBD X-Gm-Message-State: AOJu0YyesYbfv6Gvz1mRxqMLsMtl2ciolKP5YzycbzWlu5ijnBap54AD ZJ8fmr/okWd288FN9TipkKrG3d/8JVwnJAhW4VbzUey1L6nz1uxYTcrckxSyBpECB+eInV1A+HE 3lmtsfYEpiUJC/E1FwAWkiq82UReHr6xxmJJUHUtqOekcLulT6Q== X-Received: by 2002:a05:6214:401c:b0:6b5:dd7d:f8a5 with SMTP id 6a1803df08f44-6b5ecf7b7d3mr154077376d6.11.1720432867820; Mon, 08 Jul 2024 03:01:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHF0WWqZQYd3SZf3HDb6W0AK9CCfrZK8CUz+Y9fPNXNLS+hcmm48r2cJS895W7oYk+SlN0P4w== X-Received: by 2002:a05:6214:401c:b0:6b5:dd7d:f8a5 with SMTP id 6a1803df08f44-6b5ecf7b7d3mr154077156d6.11.1720432867474; Mon, 08 Jul 2024 03:01:07 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b5fdf423a1sm29408096d6.7.2024.07.08.03.01.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Jul 2024 03:01:06 -0700 (PDT) Date: Mon, 8 Jul 2024 12:00:32 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH/RFC] test: run static checkers with Avocado and JSON definitions Message-ID: <20240708120032.421cc67a@elisabeth> In-Reply-To: References: <20240629121342.3284907-1-crosa@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 4DF6B7S7P2WZS4WXQ5MQ7D2VAYDDTVHL X-Message-ID-Hash: 4DF6B7S7P2WZS4WXQ5MQ7D2VAYDDTVHL X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Cleber Rosa , passt-dev@passt.top, David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Not a review, just two remarks: On Fri, 5 Jul 2024 21:35:28 +1000 David Gibson wrote: > > [...] > > So, you can run the tests either with run_avocado, or running Avocado > directly? > > > The installation of Avocado itself is left to users, given that the > > details on how to install it (virtual environments and specific > > tooling) can be a very different and long discussion. > > Right... if the required Avocado version was already packaged in > latest Fedora and/or Debian, I'd have no qualms about that. It looks > like you require a very new one though, which makes me a little > nervous about requiring that complex installation. I guess if it's > pip installable that helps. Though if I recall on Debian even that > requires some venv setup. Eventually I think we'll want a README for > Avocado installation, or better yet make targets that will install it > automatically in a local venv. I plan to try this out on Debian and report back -- I didn't have time yet. Indeed, it would help to have all the dependencies packaged because it would be really beneficial if we could run the upstream tests also as automated package testing, e.g. for Debian it's autopkgtest: https://wiki.debian.org/ContinuousIntegration/autopkgtest The current test suite has all the dependencies packaged on (at least) Debian and Fedora, minus neper (https://github.com/google/neper), but tests will be skipped if those tools are not available. > > [...] > > > > +++ b/test/avocado/static_checkers.json > > @@ -0,0 +1,16 @@ > > +[ > > + { > > + "kind": "exec-test", > > + "uri": "make", > > + "args": [ > > + "clang-tidy" > > + ] > > + }, > > + { > > + "kind": "exec-test", > > + "uri": "make", > > + "args": [ > > + "cppcheck" > > + ] > > + } > > +] > > Looks pretty reasonable to me, at least for these simple cases. It > would be nice to have comments, but IIUC that's one of the things > notably missing from json :/, You could use HJSON (https://hjson.github.io/), or a subset of it, for example with just comments. We're using it like that in seitan, because that's what Parson supports, example: https://seitan.rocks/seitan/tree/demo/routes.hjson -- Stefano