From 89db1c68a9ff2b2b6f9a55ee98301131a808ac2a Mon Sep 17 00:00:00 2001 From: Allison Karlitskaya Date: Fri, 26 May 2023 10:17:05 +0200 Subject: [PATCH] tools: move make-bots, git-utils.sh to test/common This will allow our subprojects to benefit from the "full strength" implementation of 'get me bots/' with symlink and caching support. --- .github/workflows/npm-update-pf.yml | 2 +- .github/workflows/npm-update.yml | 2 +- .github/workflows/urls-check.yml | 1 - Makefile.am | 2 +- {tools => test/common}/git-utils.sh | 0 {tools => test/common}/make-bots | 4 ++-- test/common/parent.py | 2 +- test/run | 2 +- tools/node-modules | 6 +++--- 9 files changed, 10 insertions(+), 11 deletions(-) rename {tools => test/common}/git-utils.sh (100%) rename {tools => test/common}/make-bots (93%) diff --git a/.github/workflows/npm-update-pf.yml b/.github/workflows/npm-update-pf.yml index ee8fece2e..9d17d0433 100644 --- a/.github/workflows/npm-update-pf.yml +++ b/.github/workflows/npm-update-pf.yml @@ -18,7 +18,7 @@ jobs: - name: Run npm-update bot run: | - tools/make-bots + test/common/make-bots git config --global user.name "GitHub Workflow" git config --global user.email "cockpituous@cockpit-project.org" mkdir -p ~/.config/cockpit-dev diff --git a/.github/workflows/npm-update.yml b/.github/workflows/npm-update.yml index 1d52d16e7..78d941ef1 100644 --- a/.github/workflows/npm-update.yml +++ b/.github/workflows/npm-update.yml @@ -18,7 +18,7 @@ jobs: - name: Run npm-update bot run: | - tools/make-bots + test/common/make-bots git config --global user.name "GitHub Workflow" git config --global user.email "cockpituous@cockpit-project.org" mkdir -p ~/.config/cockpit-dev diff --git a/.github/workflows/urls-check.yml b/.github/workflows/urls-check.yml index bb2afbb85..cd47b4674 100644 --- a/.github/workflows/urls-check.yml +++ b/.github/workflows/urls-check.yml @@ -18,5 +18,4 @@ jobs: - name: Run urls-check action run: | - tools/make-bots tools/urls-check diff --git a/Makefile.am b/Makefile.am index 8f7978e67..7901fcc0d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -122,7 +122,7 @@ recheck-memory: # must be from main, as only that has current and existing images; but testvm.py API is stable # support CI testing against a bots change bots: - tools/make-bots + test/common/make-bots .PHONY: rsync RSYNC_HOST ?= c diff --git a/tools/git-utils.sh b/test/common/git-utils.sh similarity index 100% rename from tools/git-utils.sh rename to test/common/git-utils.sh diff --git a/tools/make-bots b/test/common/make-bots similarity index 93% rename from tools/make-bots rename to test/common/make-bots index e8209228b..10db11bd5 100755 --- a/tools/make-bots +++ b/test/common/make-bots @@ -9,8 +9,8 @@ SUBDIR='bots' V="${V-0}" # default to friendly messages set -eu -cd "${0%/*}/.." -. tools/git-utils.sh +cd "${0%/*}/../.." +. test/common/git-utils.sh if [ ! -e bots ]; then [ -n "${quiet}" ] || set -x diff --git a/test/common/parent.py b/test/common/parent.py index 53919e5f8..ed3ed71ff 100644 --- a/test/common/parent.py +++ b/test/common/parent.py @@ -14,5 +14,5 @@ sys.path.append(f'{BOTS_DIR}/machine') def ensure_bots(): if not os.path.isdir(BOTS_DIR): - subprocess.check_call([f'{BASE_DIR}/tools/make-bots']) + subprocess.check_call([f'{BASE_DIR}/test/common/make-bots']) importlib.invalidate_caches() diff --git a/test/run b/test/run index 90034af2b..c80d8ec93 100755 --- a/test/run +++ b/test/run @@ -5,7 +5,7 @@ set -eu -tools/make-bots +test/common/make-bots test/common/pixel-tests pull TEST_SCENARIO="${TEST_SCENARIO:-verify}" diff --git a/tools/node-modules b/tools/node-modules index 20f0e16e7..6acf8c79e 100755 --- a/tools/node-modules +++ b/tools/node-modules @@ -7,7 +7,7 @@ V="${V-0}" # default to friendly messages set -eu cd "${0%/*}/.." -. tools/git-utils.sh +. test/common/git-utils.sh cmd_remove() { # if we did this for ourselves the rm is enough, but it might be the case @@ -57,7 +57,7 @@ EOF } cmd_install() { - test -e bots || tools/make-bots + test -e bots || test/common/make-bots # We first read the result directly into the cache, then we unpack it. tree="$(bots/npm download < package.json | tar_to_cache)" @@ -82,7 +82,7 @@ cmd_push() { } cmd_verify() { - test -e bots || tools/make-bots + test -e bots || test/common/make-bots # Verifies that the package.json and node_modules of the given commit match. commit="$(git rev-parse "$1:node_modules")"