Skip to content

test: Generate coverage report without running tests - #28772

Closed
achow101 wants to merge 1 commit into
bitcoin:masterfrom
achow101:gen-cov-wo-test
Closed

achow101 wants to merge 1 commit into
bitcoin:masterfrom
achow101:gen-cov-wo-test

Conversation

@achow101

@achow101 achow101 commented Nov 1, 2023

Copy link
Copy Markdown
Member

When generating a coverage report, separate the testing from the generation of the coverage report. This is useful when checking the coverage of a small set of tests.

When generating a coverage report, separate the testing from the
generation of the coverage report. This is useful when checking the
coverage of a small set of tests.
@DrahtBot

DrahtBot commented Nov 1, 2023 •

Copy link
Copy Markdown
Contributor

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

@DrahtBot DrahtBot added the Tests label Nov 1, 2023
@maflcko

maflcko commented Nov 2, 2023

Copy link
Copy Markdown
Member

Is it still accurate to call the coverage report test_bitcoin when it may cover something else?

Do the docs need an update?

### Compiling for test coverage
etc ...

@achow101

Copy link
Copy Markdown
Member Author

Is it still accurate to call the coverage report test_bitcoin when it may cover something else?

Any suggestions?

Do the docs need an update?

I don't think so? (besides renaming, if we do that). The way I read the docs was that make check had to be run first, and separately. I hadn't expected make cov to run them for me.

@dergoegge

Copy link
Copy Markdown
Member

Should we do the same for make cov_fuzz? i.e. separate running the fuzz test runner from generating the coverage report.

@maflcko

maflcko commented Nov 14, 2023

Copy link
Copy Markdown
Member

I don't think so? (besides renaming, if we do that). The way I read the docs was that make check had to be run first, and separately. I hadn't expected make cov to run them for me.

The docs don't mention make check and the snippet similar to the docs may also used by external scripts. For example, https://github.com/maflcko/b-c-cov/blob/83bc0912e2a33cfac2195645ab3a12d092fa7ba3/.cirrus.yml#L46-L47

@achow101

Copy link
Copy Markdown
Member Author

The docs don't mention make check

Hmm? It's right there in the first sentence of that section:

LCOV can be used to generate a test coverage report based upon make check execution.

@dergoegge

Copy link
Copy Markdown
Member

Hmm? It's right there in the first sentence of that section:

LCOV can be used to generate a test coverage report based upon make check execution.

Isn't that just saying that the generated coverage report covers the code executed in make check, not that you have to invoke make check prior to make cov? (that's at least how i read it and how make cov currently works). Since there are multiple interpretations, it probably makes sense to clarify.

@maflcko

maflcko commented Nov 14, 2023

Copy link
Copy Markdown
Member

Right. I am saying this is certainly a behavior change. Previously one could just type ./configure ... && make && make cov to get the both reports. Now, something else is needed, likely a longer command, so it would be good to mention this in the documentation, or pull request description, or anywhere. Otherwise, everyone is left on their own to figure out the change in behavior.

@achow101 achow101 closed this Jan 25, 2024
@bitcoin bitcoin locked and limited conversation to collaborators Jan 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants