From 34b1edd96a73d2206f7587030307e20995c851ca Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Tue, 24 Dec 2024 14:58:23 +0200 Subject: [PATCH] Makefile: verify generated jobs --- Makefile | 3 +++ hack/make-rules/verify/all.sh | 6 ++++++ hack/make-rules/verify/generated-jobs.sh | 26 ++++++++++++++++++++++++ requirements3.txt | 1 + 4 files changed, 36 insertions(+) create mode 100755 hack/make-rules/verify/generated-jobs.sh diff --git a/Makefile b/Makefile index 46c97f1f0f78..1e47822d07df 100644 --- a/Makefile +++ b/Makefile @@ -129,4 +129,7 @@ verify-boilerplate: .PHONY: verify-yamllint verify-yamllint: hack/make-rules/verify/yamllint.sh +.PHONY: verify-generated-jobs +verify-generated-jobs: + hack/make-rules/verify/generated-jobs.sh ################################################################################# diff --git a/hack/make-rules/verify/all.sh b/hack/make-rules/verify/all.sh index ef1181bbc94b..2d16b4542e91 100755 --- a/hack/make-rules/verify/all.sh +++ b/hack/make-rules/verify/all.sh @@ -92,6 +92,12 @@ if [[ "${VERIFY_GO_DEPS:-true}" == "true" ]]; then hack/make-rules/verify/go-deps.sh || { FAILED+=($name); echo "ERROR: $name failed"; } cd "${REPO_ROOT}" fi +if [[ "${VERIFY_GENERATED_JOBS:-true}" == "true" ]]; then + name="generated jobs" + echo "verifying $name" + hack/make-rules/verify/generated-jobs.sh || { FAILED+=($name); echo "ERROR: $name failed"; } + cd "${REPO_ROOT}" +fi # exit based on verify scripts if [[ "${#FAILED[@]}" == 0 ]]; then diff --git a/hack/make-rules/verify/generated-jobs.sh b/hack/make-rules/verify/generated-jobs.sh new file mode 100755 index 000000000000..c20dd5167648 --- /dev/null +++ b/hack/make-rules/verify/generated-jobs.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -o errexit +set -o nounset +set -o pipefail + +echo "Installing requirements3.txt" +hack/run-in-python-container.sh \ + pip3 install -r requirements3.txt + +echo "Verifying generated jobs" +hack/run-in-python-container.sh \ + python3 hack/generate-jobs.py config/jobs/kubernetes/sig-node/*.conf --only-verify diff --git a/requirements3.txt b/requirements3.txt index f175e07cf907..6b257b702ad4 100644 --- a/requirements3.txt +++ b/requirements3.txt @@ -3,6 +3,7 @@ backports.functools_lru_cache==1.6.1 configparser==4.0.2 chardet==4.0.0 isort==4.3.21 +Jinja2==3.1.5 pylint==2.4.4 parameterized==0.7.4 PyYAML==5.3