DPDK CI discussions
 help / color / mirror / Atom feed
From: Manit Mahajan <mmahajan@iol.unh.edu>
To: ci@dpdk.org
Cc: probb@iol.unh.edu, thomas@monjalon.net, aconole@redhat.com,
	bruce.richardson@intel.com, Manit Mahajan <mmahajan@iol.unh.edu>
Subject: [PATCH] tools: run check-meson.py in create_series_artifact
Date: Tue, 15 Oct 2024 17:32:11 -0400	[thread overview]
Message-ID: <20241015213211.587-1-mmahajan@iol.unh.edu> (raw)

The check-meson.py is a python script that runs checks on meson.build
files in DPDK. Checks include, splitting a line into a code part and a
comment part, list of files are correctly indented, and more. Updating
create_series_artifact.py to run the check-meson.py so check-meson.py can
be run on all incoming patches. In UNH CI, we will report a build failure if the
check-meson.py reports an error.

Signed-off-by: Manit Mahajan <mmahajan@iol.unh.edu>
---
 tools/create_series_artifact.py | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/tools/create_series_artifact.py b/tools/create_series_artifact.py
index 550ea82..bfc97f8 100755
--- a/tools/create_series_artifact.py
+++ b/tools/create_series_artifact.py
@@ -251,6 +251,24 @@ class ProjectTree(object):
         self.set_properties(apply_error=error)
         return not error
 
+
+    def check_meson(self) -> bool:
+
+        result = subprocess.run(
+            ['python', os.path.join(self.path, "devtools/check-meson.py"), '-d', str(self.path), '-v'],
+            cwd=self.path,
+            stdout=subprocess.PIPE,
+            stderr=subprocess.PIPE,
+            )
+
+        self.log("Running Check Meson")
+        self.log(result.stdout.decode())
+        self.log(result.stderr.decode())
+
+        error = "Error" in result.stdout.decode()
+        self.set_properties(meson_error=error)
+        return not error
+
     def test_build(self) -> bool:
         ninja_result: Optional[subprocess.CompletedProcess] = None
         meson_result: subprocess.CompletedProcess = subprocess.run(
@@ -454,8 +472,14 @@ def collect_series_info(args: argparse.Namespace) -> CreateSeriesParameters:
 
 
 def try_to_apply(tree: ProjectTree) -> bool:
-    return tree.apply_patch_series() and tree.test_build() and tree.create_tarball()
 
+    artifact_build_result = True
+    artifact_build_result &= tree.apply_patch_series()
+    artifact_build_result &= tree.check_meson()
+    artifact_build_result &= tree.test_build()
+    artifact_build_result &= tree.create_tarball()
+
+    return artifact_build_result
 
 def main() -> int:
     data = collect_series_info(parse_args())
-- 
2.41.0


             reply	other threads:[~2024-10-15 21:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-15 21:32 Manit Mahajan [this message]
2024-10-15 22:26 ` Patrick Robb
2024-10-15 22:27 ` Patrick Robb

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=20241015213211.587-1-mmahajan@iol.unh.edu \
    --to=mmahajan@iol.unh.edu \
    --cc=aconole@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=ci@dpdk.org \
    --cc=probb@iol.unh.edu \
    --cc=thomas@monjalon.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).