tools: run check-meson.py in create_series_artifact

Message ID 20241024183526.16946-1-mmahajan@iol.unh.edu (mailing list archive)
State New
Headers
Series tools: run check-meson.py in create_series_artifact |

Commit Message

Manit Mahajan Oct. 24, 2024, 6:35 p.m. UTC
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(-)
  

Comments

Patrick Robb Nov. 1, 2024, 10:24 p.m. UTC | #1
This looks good, and I ran it and see that the dpdk.tar.gz.properties file
is indeed including the new meson test result. For reference, the
.properties file contents:

-------------------------------------

patchset_range=147864-147872
tags=core driver documentation
is_docs_only=False
applied_commit_id=03c845d7cf21b98a5ee8cad3f0850264eafa9658
tree=next-net-for-main
apply_error=False
meson_error=False
build_error=False

-------------------------------------------

Reviewed-by: Patrick Robb <probb@iol.unh.edu>
Tested-by: Patrick Robb <probb@iol.unh.edu>
  

Patch

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())