Comments (10)
Yes, it should be possible. Unfortunately the paths in the xcresult file are absolut and it is not easy to figure out the relative path names. Sonar however requires the relative paths.
In order for the xcresultparser to figure out how to convert to relative paths you need to pass the root directory as parameter. Then the paths can be converted.
from xcresultparser.
Oh maybe I remember wrong and mixed up requirements.
Read the chapter "About paths for the sonarqube scanner" at the end of the Readme. For me that works with sonarqube.
from xcresultparser.
I read the chapter but it is two different things to me.
- "The tools to get the data from the xcresult archive yield absolute path names." -> result will look like
<file path="Full/Path/LoggingTests.swift">
. - "the .xcresult bundle only lists the test by testclass, but not by file." -> result will look like
<file path="LoggingTests">
My case is 2. but you're saying 1.
For 1, I can use for sonarqube by replacing some path absolute->relative.
but For 2, I can't do anything about it because I don't have any info about directory.
Am I missing something? or my xcresult file is wrong?(I'm using XCode 14.3, MacOS 13.2)
from xcresultparser.
I will look into it, whether xcresult changed lately in this regard. We use the sonar scanner as well with our project and there we can see the tests.
I will see, what I can find out.
from xcresultparser.
The xcresult file only shows the class name of the test class. xcresultparser now uses grep
to find the file, where your test class is defined. It searches through all files in your "project root" folder for "class " and very naively uses the first matching file. If the string "class " appears more than once it might be the case, that the wrong file is found.
from xcresultparser.
from xcresultparser.
Yes, that's exactly what xcresultparser does. The xcresult file provides the name of the test class and xcresultparser greps in the provided project folder for swift files which contain the string 'class name-of-the-testclass'
(I just realised, that what I did in my last response got chopped by GitHub, where I used 'opening-bracket' name-of-test-class 'closing-bracket').
That is a rather "naive" approach and it will break easily, but as far as my research goes, it is the only tool, which converts xcresult files to expose the tests to SonarQube due to this "dirty trick".
from xcresultparser.
If you do not run the SonarQube command line tool in the source folder of your project, but rather only have the xcresult file, there is not much I can do about it. The sonarqube command line tool needs to run in the sources folder where the tests are, which created the xcresult. It needs to scan the test files themselves.
from xcresultparser.
I looked into the logic and found ActionTestableSummary
includes projectRelativePath
, ex. Module1/Domain1/Module1Domain1.xcodeproj.
I think this can optimize the grep logic by narrowing down the search scope. especially for multi-module project.
from xcresultparser.
Thanks for the hint. I will look into that.
from xcresultparser.
Related Issues (12)
- Ignore directories/files? HOT 5
- Binaries attached to releases HOT 15
- "--project-root" seems to be case sensitive when used while generating coverage HOT 5
- Json format output HOT 4
- Skipped tests shows as failed in txt results HOT 5
- Wrong calculation of failed tests in txt results HOT 2
- Corrupted data in txt results if run UI tests simultaneously on two devices HOT 5
- Why need to get the dtd file by visiting http://cobertura.sourceforge.net ? HOT 2
- Any chance of getting xcresultparser on brew? HOT 2
- Markdown formatting on github will display `<span>` tags HOT 1
- `xcresultparser` errors out with code 133 when executed HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xcresultparser.