ci: use matrix for yocto-check-layer

Message ID 20220120163116.30501-1-jon.mason@arm.com
State New
Headers show
Series ci: use matrix for yocto-check-layer | expand

Commit Message

Jon Mason Jan. 20, 2022, 4:31 p.m. UTC
The check-layers task takes longer than any of the individual tests
running.  Split this up to take advantage of parallelism and speed up
the overall runs.

Signed-off-by: Jon Mason <jon.mason@arm.com>
---
 .gitlab-ci.yml      |  6 ++++--
 ci/check-layers.py  | 44 --------------------------------------------
 ci/check-layers.yml |  7 -------
 3 files changed, 4 insertions(+), 53 deletions(-)
 delete mode 100755 ci/check-layers.py
 delete mode 100644 ci/check-layers.yml

Comments

Jon Mason Jan. 20, 2022, 5:50 p.m. UTC | #1
On Thu, 20 Jan 2022 11:31:16 -0500, Jon Mason wrote:
> The check-layers task takes longer than any of the individual tests
> running.  Split this up to take advantage of parallelism and speed up
> the overall runs.

Applied, thanks!

[1/1] ci: use matrix for yocto-check-layer
      commit: 2766987583fc19ad1daeefb8138ac01b2d2b886f

Best regards,

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 266e086..9a60f67 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -77,10 +77,12 @@  machine-coverage:
 # Validate layers are Yocto Project Compatible
 check-layers:
   extends: .setup
-  coverage: '/Coverage: \d+/'
   script:
     - kas shell --update --force-checkout ci/base.yml:ci/meta-openembedded.yml --command \
-      "$CI_PROJECT_DIR/ci/check-layers.py $CI_PROJECT_DIR/ci/check-layers.yml $CI_PROJECT_DIR $KAS_WORK_DIR"
+      "yocto-check-layer-wrapper $CI_PROJECT_DIR/$LAYER --dependency $CI_PROJECT_DIR $KAS_WORK_DIR/meta-openembedded/meta-oe --no-auto-dependency"
+  parallel:
+    matrix:
+      - LAYER: [meta-arm, meta-arm-bsp, meta-arm-toolchain, meta-gem5]
 
 pending-updates:
   extends: .setup
diff --git a/ci/check-layers.py b/ci/check-layers.py
deleted file mode 100755
index 2aa7d9b..0000000
--- a/ci/check-layers.py
+++ /dev/null
@@ -1,44 +0,0 @@ 
-#! /usr/bin/env python3
-
-import argparse
-import pathlib
-import re
-import subprocess
-import sys
-
-import yaml
-
-if __name__ == "__main__":
-    parser = argparse.ArgumentParser()
-    parser.add_argument("config", type=argparse.FileType())
-    parser.add_argument("metaarm", type=pathlib.Path, help="Path to meta-arm")
-    parser.add_argument("others", type=pathlib.Path, help="Path to parent of dependencies")
-    args = parser.parse_args()
-
-    config = yaml.safe_load(args.config)
-    layers = config["layers"]
-    dependencies = config["dependencies"]
-
-    found_layers = [p for p in args.metaarm.glob("meta-*") if p.is_dir()]
-    print(f"Testing {len(layers)} layers: {', '.join(layers)}.")
-    print(f"Found {len(found_layers)} layers in meta-arm.")
-    print()
-
-    cli = ["yocto-check-layer-wrapper",]
-    cli.extend([args.metaarm / layer for layer in layers])
-    cli.append("--dependency")
-    cli.extend([args.others / layer for layer in dependencies])
-    cli.append("--no-auto-dependency")
-
-    passed = 0
-    process = subprocess.Popen(cli, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
-    while True:
-        line = process.stdout.readline()
-        if process.poll() is not None:
-            break
-        print(line.strip())
-        if re.search(r"meta-.+ PASS", line):
-            passed += 1
-
-    print(f"Coverage: {int(passed / len(found_layers) * 100)}%")
-    sys.exit(process.returncode)
diff --git a/ci/check-layers.yml b/ci/check-layers.yml
deleted file mode 100644
index 7d2820c..0000000
--- a/ci/check-layers.yml
+++ /dev/null
@@ -1,7 +0,0 @@ 
-layers:
-  - meta-arm
-  - meta-arm-bsp
-  - meta-arm-toolchain
-  - meta-gem5
-dependencies:
-  - meta-openembedded/meta-oe