mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Allow forcing the package tests to run by the test:pkg
label
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
51e9fb6e71
commit
46103123e4
1 changed files with 27 additions and 3 deletions
24
tools/ci.py
24
tools/ci.py
|
@ -306,6 +306,23 @@ def define_jobs(
|
|||
)
|
||||
return
|
||||
|
||||
# This is a pull-request
|
||||
|
||||
labels: list[str] = []
|
||||
gh_event_path = os.environ.get("GITHUB_EVENT_PATH") or None
|
||||
if gh_event_path is not None:
|
||||
try:
|
||||
gh_event = json.loads(open(gh_event_path).read())
|
||||
except Exception as exc:
|
||||
ctx.error(
|
||||
f"Could not load the GH Event payload from {gh_event_path!r}:\n", exc
|
||||
)
|
||||
ctx.exit(1)
|
||||
|
||||
labels.extend(
|
||||
label[0] for label in _get_pr_test_labels_from_event_payload(gh_event)
|
||||
)
|
||||
|
||||
if not changed_files.exists():
|
||||
ctx.error(f"The '{changed_files}' file does not exist.")
|
||||
ctx.error(
|
||||
|
@ -355,6 +372,13 @@ def define_jobs(
|
|||
changed_files_contents["workflows"],
|
||||
}
|
||||
if jobs["test-pkg"] and required_pkg_test_changes == {"false"}:
|
||||
if "test:pkg" in labels:
|
||||
with open(github_step_summary, "a", encoding="utf-8") as wfh:
|
||||
wfh.write(
|
||||
"The 'test-pkg' job is forcefully selected by the use of the 'test:pkg' label.\n"
|
||||
)
|
||||
jobs["test-pkg"] = True
|
||||
else:
|
||||
with open(github_step_summary, "a", encoding="utf-8") as wfh:
|
||||
wfh.write("De-selecting the 'test-pkg' job.\n")
|
||||
jobs["test-pkg"] = False
|
||||
|
|
Loading…
Add table
Reference in a new issue