a7ex / xcresultparser

Parse the binary xcresult bundle from Xcode builds and testruns
MIT License
83 stars 24 forks source link

"--project-root" seems to be case sensitive when used while generating coverage #13

Closed grant-mccarriagher closed 1 year ago

grant-mccarriagher commented 1 year ago

Our project repo has capital letters in it, and we're using $(pwd) to get the current path (and using the --project-root option to correct the file paths so SonarQube can ingest the xml files). Test execution output seems to work fine with this (the paths are properly turned into relative paths), but coverage output seems to require the exact case-sensitive path as the option for --project-root.

a7ex commented 1 year ago

Hi Grant, I am not sure, whether I understand the problem or what your question exactly is. ;-) Yes, it is indeed case sensitive. It uses components(separatedBy:) to split the path in base path and relative path. Can you provide an example where it breaks? pwd should give you the path in the correct case, doesn't it? Are the paths in the xcresult bundle in the "wrong case"? Is the file system case sensitive? I thought, that most of us MacOS users have use a case-insensitivity file format. So that might cause the problem? It should not be a big deal to make the tool work case insensitive, but first I need to fully understand the problem, so I know, where to fix it. Can you elaborate and maybe provide an example. Ideally you could provide me a xcresult bundle, so I can test and verify myself.

grant-mccarriagher commented 1 year ago

Sorry, found a workaround for this...pwd -P will properly capitalize the path. Not entirely sure how the shell gets into a state where it's seeing the wrong capitalization, but you can reproduce it like this:

> cd ~/documents
> pwd
/Users/me/documents
> cd ~/Documents
> pwd
/Users/me/Documents

Anyways, sorry for the non-issue. Thanks!

a7ex commented 1 year ago

That might really be a special case here with the "Documents" folder. There are some standard folders in every home directory. And "Documents" and "Desktop" are pretty special. I suppose they expect to be upper case, but if your disk is formatted case insensitive (standard on mac OS), then "documents" is the same as "Documents" and MacOS expects it to be upper case. Something along those lines...

grant-mccarriagher commented 1 year ago

I was just using that as an example, it seems to work the same if you have a repo with capital letters (our repo is named iOS).

a7ex commented 1 year ago

Good to know. Maybe I will change my code to be case insensitive then. :-)

On 3. May 2023, at 14:24, Grant McCarriagher @.***> wrote:

I was just using that as an example, it seems to work the same if you have a repo with capital letters (our repo is named iOS).

— Reply to this email directly, view it on GitHub https://github.com/a7ex/xcresultparser/issues/13#issuecomment-1532933115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANBA4UJD4M43LMINC3GG4TXEJFADANCNFSM6AAAAAAXTWQELE. You are receiving this because you commented.