Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/scripts/mark_skipped.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
r"validation error .* ctx",
]


def should_skip(msg: str) -> bool:
if not msg:
return False
Expand All @@ -38,6 +39,7 @@ def should_skip(msg: str) -> bool:
return True
return False


def summarize_counts(ts: ET.Element):
tests = 0
failures = 0
Expand All @@ -53,6 +55,7 @@ def summarize_counts(ts: ET.Element):
skipped += 1
return tests, failures, errors, skipped


def main(path: str) -> int:
if not os.path.exists(path):
print(f"[mark_skipped] No JUnit at {path}; nothing to do.")
Expand All @@ -79,7 +82,8 @@ def main(path: str) -> int:
for n in nodes:
msg = (n.get("message") or "") + "\n" + (n.text or "")
if should_skip(msg):
first_match_text = (n.text or "").strip() or first_match_text
first_match_text = (
n.text or "").strip() or first_match_text
to_skip = True
if to_skip:
for n in nodes:
Expand All @@ -98,12 +102,14 @@ def main(path: str) -> int:

if changed:
tree.write(path, encoding="utf-8", xml_declaration=True)
print(f"[mark_skipped] Updated {path}: converted environmental failures to skipped.")
print(
f"[mark_skipped] Updated {path}: converted environmental failures to skipped.")
else:
print(f"[mark_skipped] No environmental failures detected in {path}.")

return 0


if __name__ == "__main__":
target = (
sys.argv[1]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- major
default: patch
required: true

jobs:
bump:
name: "Bump version and tag"
Expand Down
Loading