Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

robust path management and package specification #31

Open
tpapp opened this issue Aug 21, 2022 · 8 comments
Open

robust path management and package specification #31

tpapp opened this issue Aug 21, 2022 · 8 comments

Comments

@tpapp
Copy link
Collaborator

tpapp commented Aug 21, 2022

Currently we map a package or a module to a path using undocumented internals (cf #30 which changes this).

I am not aware of a robust mechanism for doing this, other than calling internals. I wonder if we could just default to working on the current project.

It is still not clear how to query the path of the resulting cov files (again, other than hacks).

@kbarros
Copy link

kbarros commented Aug 21, 2022

Thanks for posting. Instead of

Base.locate_package(Base.PkgId("MyPackage"))

is it an option to use

pkgdir(MyPackage)

In other words, require an actual Module?

@tpapp
Copy link
Collaborator Author

tpapp commented Aug 26, 2022

I think it would be best to accept everything (including no argument), and just pass it on to Pkg.test, and have the call specify an output path for the coverage info. Currently the Pkg.test framework does not allow this, but after JuliaLang/Pkg.jl#3178 or a similar solution is merged it should work.

We could then save the location (or maybe the whole coverage info) in PackageCoverage, so the results would be decoupled from the filesystem. If this works, coverage generation would not litter the filesystem and would also work for read-only directories.

@tpapp
Copy link
Collaborator Author

tpapp commented Sep 30, 2022

Update: the above PR has been merged, so if that ends up in 1.9 then we can revisit this.

@BambOoxX
Copy link
Contributor

BambOoxX commented Jul 9, 2023

Hey @tpapp, I'm currently doing some CI job using LocalCoverage on a Gitlab self-hosted instance and after some thinking, it feels like the path written by LocalCoverage in the coverage files poses a problem with the display of covered lines in the merge request diff. Do you have any experience about this ?
This problem shows on a repo where I have several languages and my julia code is in a <git root>/julia subfolder.

@tpapp
Copy link
Collaborator Author

tpapp commented Jul 10, 2023

it feels like the path written by LocalCoverage in the coverage files poses a problem with the display of covered lines in the merge request diff. Do you have any experience about this ?

Can you describe the problem in detail? No, I do not recall seeing this.

On a related note, I will revisit this issue soon but currently I have very little time. PRs welcome.

@BambOoxX
Copy link
Contributor

I'll try to see if I can contribute.
About the GitLab related problem, maybe it is just related to my limited experience of how it should be displayed. Could you highlight that on your https://gitlab.com/tkpapp/GitlabJuliaDemo.jl?

@tpapp
Copy link
Collaborator Author

tpapp commented Jul 12, 2023

Unfortunately, that repo is somewhat outdated, I haven't used Gitlab for a while.

@BambOoxX
Copy link
Contributor

@tpapp So I tested modifications of the path w.r.t the repo path and now coverage diff display works. I achieved this using a bit of sed. Basically any path in the cobertura file should have its root in the repo base dir.
I'll try to find a way to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants