fix(ci): correct ElementTree truthiness bug in e2e summary script#1050
Merged
Conversation
Python's xml.etree.ElementTree evaluates elements as falsy when they
have no child elements, regardless of attributes or text. The expression
`tc.find("failure") or tc.find("error")` returned None for any
`<failure message="..."/>` node (no children), crashing the summary
step with AttributeError.
Replace with explicit `is not None` guards.
v1r3n
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
xml.etree.ElementTreeevaluates an element as falsy when it has no child elements, regardless of its attributes or text contenttc.find("failure") or tc.find("error")therefore returnedNonewhenever a test had a<failure message="..."/>node with no child elements, causingnode.get("message")to crash withAttributeErrororwith an explicitis not NoneguardRoot cause
This only triggers when an e2e test actually fails. Previous CI runs since #1031 landed all had clean e2e suites, so the bug path was never reached until now (surfaced by a flaky test in one of the #1025 parallel runners).
Python also emits a
DeprecationWarningfor this pattern: "Testing an element's truth value will raise an exception in future versions. Use specificlen(elem)orelem is not Nonetest instead." — the fix aligns with that guidance.User impact
Without this fix, any e2e run with a failing test causes the summary step to crash and the CI job to report failure even if the actual test results were fine.