Fix Cobertura XML DTD compliance + add path normalization#58
Fix Cobertura XML DTD compliance + add path normalization#58bdolewski-intellias wants to merge 2 commits intoa7ex:mainfrom
Conversation
|
Hi Bartosz, thanks for your contribution. Quite a bit to digest :-) |
|
@a7ex take your time :) |
a7ex
left a comment
There was a problem hiding this comment.
Terrific work, Bartosz, thank you. I struggled y bit with the Python unit tests, but that's just me being a swift head. As I understand that is a standard test and that is of course smart.
| - name: Test Individual File Validation | ||
| run: | | ||
| echo "🔍 Testing individual file validation..." | ||
| # Generate a test XML file |
There was a problem hiding this comment.
There is no .build/release/...
The built product is in:
.build/apple/Products/Release/$productName
| swift build -c release --disable-sandbox --arch arm64 --arch x86_64 | ||
|
|
||
| # Verify binary was created | ||
| if [[ ! -f .build/release/xcresultparser ]]; then |
There was a problem hiding this comment.
There is no .build/release/xcresultparser
The built product is in:
.build/apple/Products/Release/xcresultparser
| fi | ||
|
|
||
| echo "✅ Binary built successfully" | ||
| .build/release/xcresultparser --version || echo "Binary version check completed" |
|
|
||
| # Test --coverage-base-path flag | ||
| echo "Testing --coverage-base-path flag..." | ||
| .build/release/xcresultparser Tests/XcresultparserTests/TestAssets/test.xcresult \ |
|
|
||
| # Test --sources-root flag | ||
| echo "Testing --sources-root flag..." | ||
| .build/release/xcresultparser Tests/XcresultparserTests/TestAssets/test.xcresult \ |
|
|
||
| # Test backward compatibility with -p flag | ||
| echo "Testing backward compatibility (-p flag)..." | ||
| .build/release/xcresultparser Tests/XcresultparserTests/TestAssets/test.xcresult \ |
There was a problem hiding this comment.
Let's just pretend I made a comment everywhere, where you used ".build/release/xcresultparser"
After building on my machine, there is not symlink to ".build/apple/Products/Release/" we will need to figure out the correct build path here.
This PR fixes Cobertura XML output so it’s valid against the official
coverage-04.dtdand adds CLI flags for easier path handling in CI/CD environments.My last PR missed a few marks and I decided to spent my time making
xcresultparsercompliant with latest Cobertura DTD standard :)Too bad that Apple doesn't give the official support for it but I believe I managed to bridge that gap with the help from Claude 4 Sonnet.
The test workflows behave like "e2e" tests. Went with Python instead of XCTests or Swift Testing to let external tool run
xcresultparserand validate its output.TODO
Fixes
xcresultparser 1.9.30(not tracked)New CLI Flags
Example
Before ❌
After ✅
Testing
Notes
I've also tested it locally with my project to see if DataDog CLI likes it:
