bug: connectivity test --junit-file emits malformed XML (duplicate failureMessage attribute)
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
Research direction
Start with cilium-cli/connectivity/internal/junit/junit.go, where the issue says failure attributes are assembled in more than one place. Reproduce with a connectivity test that has a failed action and parse out.xml using the provided Python ElementTree command. Done when the report is well-formed XML and parses successfully with failure details preserved.
Written by the indexing model from the issue text.
Description
Summary
The JUnit XML report written by cilium connectivity test --junit-file is
malformed: <failure> elements carry the failureMessage attribute twice,
so strict XML parsers reject the file and JUnit consumers cannot use it.
Environment
cilium-cli: v0.19.7 compiled with go1.26.5 on linux/amd64- server: Cilium chart 1.20.4 on single-node k3d (k3s v1.34.5+k3s1)
- command:
cilium connectivity test --single-node --junit-file out.xml
(any run with at least one failed action reproduces it; 132 testcases,
27 failed in the reporting run)
Reproduction
-
Run
cilium connectivity test --junit-file out.xmlon a setup where at
least one test action fails (e.g. single-node k3d, L7/TLS tests fail). -
Parse the report with a strict parser:
python3 -c "import xml.etree.ElementTree as ET; ET.parse('out.xml')"
Expected
Well-formed XML that any JUnit consumer can parse.
Actual
xml.etree.ElementTree.ParseError: duplicate attribute: line 8, column 405
The emitting element looks like
<failure message="..." failureMessage="..." failureMessage="...">
(the attribute appears twice with the full command text). Related work that
is NOT this bug: #40035 (export detailed failure messages, likely origin of
the second attribute), #46835 (atomic write), #46101 (remove partial file).
Additional Context
- Probable source:
cilium-cli/connectivity/internal/junit/junit.go
(failure attributes are assembled in more than one place since #40035). - Workaround for consumers: regex-extract
name/timeper testcase
instead of parsing the XML.
- Dominant language
- Makefile
- Stars
- 612
- Forks
- 228
- Avg merge
- 19h 55m
- Merged PRs (30d)
- 21
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from cilium/cilium-cli
-
kind/bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
cilium/cilium-cli#3340 ·
Maintainers usually reply within 1 day
-
Dependency DashboardOpen
Difficulty 5/5 Over a week Newbie friendliness 15/100
cilium/cilium-cli#1599 ·
Maintainers usually reply within 1 day
All issues in cilium/cilium-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
libracoder/kiri#749 ·
Maintainers usually reply within 1 day
-
bug status/accepted type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/apm#4925 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sagemathinc/sagebrush#1701 ·
Maintainers usually reply within 1 day
-
status/need-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google-gemini/gemini-cli#30412 · 1 comment ·
Maintainers usually reply within 1 day
-
bug triage:owned
Difficulty 1/5 Under an hour Newbie friendliness 82/100
Maintainers usually reply within 1 day