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

Added support for tags #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Added support for tags #3

wants to merge 1 commit into from

Conversation

mhr3
Copy link

@mhr3 mhr3 commented Mar 26, 2021

I was getting a weird: code coverage conversion failed: open : no such file or directory error, after tracking it down, it turned out it was trying to find a file which was only built using a specific tag, so I added a flag to specify tags

Also turned the error into code coverage conversion failed: unable to determine file path for ${path}

Copy link

@sword-jin sword-jin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can merge.

@sword-jin
Copy link

nice feature

@kalzoo
Copy link

kalzoo commented Jul 23, 2021

Hey, ping @mhr3 , would you still be willing to merge this? Just ran into the same thing and thankful you already have the fix.

and @rrylee / @boumenot could you open up issues on the repo? Even if you don't want to be dealing with pseudo-customer-support, it's nice to be able to diagnose and solve issues with the help of the community for things that might not merit a PR. Now that this is the go-to fork for gocover-cobertura, it would be nice to have past issues to look through when problems pop up.

@mhr3
Copy link
Author

mhr3 commented Jul 23, 2021

Hey, ping @mhr3 , would you still be willing to merge this? Just ran into the same thing and thankful you already have the fix.

I don't have privileges to merge this, but fwiw you can use the GOFLAGS env var to set the tags, so this patch isn't strictly required.

@boumenot
Copy link
Owner

boumenot commented Aug 5, 2021

Sorry for the late response. I didn't expect anyone to submit PRs for this repo, and I don't pay attention to it.

fwiw you can use the GOFLAGS env var to set the tags, so this patch isn't strictly required.

If the same functionality can be achieved without a code change I would prefer that. Is there a reason to prefer code over an environment variable for this particular case?

@zapling
Copy link

zapling commented Mar 13, 2023

Ye this can be solved with

GOFLAGS="-tags=integration_test" gocover-cobertura < cover.out > coverage.xml

@cuthix
Copy link

cuthix commented Jun 1, 2023

Is there a reason to prefer code over an environment variable for this particular case?

We have case where we generate one merged cover profile from multiple OSes. We have coverage run in windows, darwin and linux machines and then merge that. Because the source files from other OSes are not included in pkgPkg the conversion fails with: code coverage conversion failed: open : no such file or directory

Using GOFLAGS="-tags=windows,darwin" would failed to run anything.

@vusalalishov
Copy link

Does it still make sense to keep this PR open?

@tehsphinx
Copy link

tehsphinx commented Oct 23, 2024

I stumbled over the same issue but wasn't able to find out what is happening from the error message. After doing the whole checkout, debug, and finally implementing tags support dance I wanted to open a PR and saw this PR 😅

I think we at least need an improved error message.

Another option would be to just skip files that are not found in the packages, but that would also mean parts of the coverage report is dropped.

Or implement -tags flag support. But still the error message needs improvement. There is no clear path from code coverage conversion failed: open : no such file or directory to setting some missing -tags on the command (or via GOFLAGS environment variable).

Note: My implementation would support setting the tags flag multiple times (e.g. -tags tag1 -tags tag2). If that is something you are interested in.

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

Successfully merging this pull request may close these issues.

8 participants