[Buildroot] [PATCH 1/3] support/scripts/generate-gitlab-ci-yml: allow multiple tests in one pipeline
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Date: 2021-10-09 19:11:16
Subsystem:
the rest · Maintainer:
Linus Torvalds
The current Gitlab CI mechanism allows to trigger all tests in a CI pipeline by pushing a branch named <something>-runtime-tests, or to trigger a single test in a CI pipeline by pushing a branch name <something>-tests.<name of test>. However, there are cases where it is useful to run a suite of tests, for example to run all tests in tests.init.test_busybox. This commit makes that possible by extending the current semantic of <something>-tests.<name of test> to not expect a complete test name, but instead to accept all tests that starts with the given pattern. This allows to do: git push gitlab HEAD:foobar-tests.init.test_busybox.TestInitSystemBusyboxRo like it was the case before. But it now also allows to do: git push gitlab HEAD:foobar-tests.init.test_busybox to run all Busybox tests. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> --- docs/manual/contribute.txt | 18 ++++++++++++++++-- support/scripts/generate-gitlab-ci-yml | 6 +++++- 2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/docs/manual/contribute.txt b/docs/manual/contribute.txt
index 14ecdbd66c..eff80e514e 100644
--- a/docs/manual/contribute.txt
+++ b/docs/manual/contribute.txt@@ -677,9 +677,23 @@ string you choose to identify this specific job being created. $ git push gitlab HEAD:<name>-runtime-tests --------------------- -* to trigger one test case job, a specific branch naming string is used that -includes the full test case name. +* to trigger one or several test case jobs, a specific branch naming +string is used that includes either the full test case name, or the +beginning of a series of tests to run: --------------------- $ git push gitlab HEAD:<name>-<test case name> --------------------- + +Example to run one test: + +--------------------- + $ git push gitlab HEAD:foo-tests.init.test_busybox.TestInitSystemBusyboxRo +--------------------- + +Examples to run several tests part of the same group: + +--------------------- + $ git push gitlab HEAD:foo-tests.init.test_busybox + $ git push gitlab HEAD:foo-tests.init +---------------------
diff --git a/support/scripts/generate-gitlab-ci-yml b/support/scripts/generate-gitlab-ci-yml
index 063c5081da..7d09279bbd 100755
--- a/support/scripts/generate-gitlab-ci-yml
+++ b/support/scripts/generate-gitlab-ci-yml@@ -71,7 +71,11 @@ gen_tests() { do_runtime=true ;; (*-tests.*) - runtimes=( "${CI_COMMIT_REF_NAME##*-}" ) + runtimes=( $(./support/testing/run-tests -l 2>&1 \ + | sed -r -e '/^test_run \((.*)\).*/!d; s//\1/' \ + | LC_ALL=C sort \ + | grep "^${CI_COMMIT_REF_NAME##*-}") + ) do_runtime=true ;; esac
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot