git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git Test Coverage Report (Saturday, Oct 27)

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Oct 27, 2018, 19:10 UTC
Message-ID
<20181027191003.GG6119@genre.crustytoothpaste.net>
In-Reply-To
<5db6213b-b7d0-b995-de80-9671604416a5@gmail.com>
On Sat, Oct 27, 2018 at 09:27:21AM -0400, Derrick Stolee wrote:
Show 5 quoted lines
> In an effort to ensure new code is reasonably covered by the test suite, we
> now have contrib/coverage-diff.sh to combine the gcov output from 'make
> coverage-test ; make coverage-report' with the output from 'git diff A B' to
> discover _new_lines of code that are not covered. This report ignores lines
> including "BUG(".
Thanks for producing this.
Show 5 quoted lines
> Commits introducing uncovered code:
> brian m. carlson      2f90b9d9b: sha1-file: provide functions to look up
> hash algorithms
> brian m. carlson      b3a41547c: hex: introduce functions to print arbitrary
> hashes

These two are expected. One this series makes its way to master, I'll send patches that use it in a bunch more places, and these functions will be adequately covered by multiple code paths.

Show 5 quoted lines
> Uncovered in next not in master
> -------------------------------
> 
> apply.c
> eccb5a5f3d 4071) return get_oid_hex(p->old_oid_prefix, oid);

This one is just a name change. However, I think it's interesting that this code path isn't covered in the normal case (and presumably isn't covered before my patch). From the comment, this appears to be limited to the case where the index line in the patch contains the full object ID.

I'll try to see if I can come up with a test to cover this case.
Show 5 quoted lines
> builtin/repack.c
> 2f0c9e9a9b 239) die("repack: Expecting full hex object ID lines only from
> pack-objects.");
> 2f0c9e9a9b 411) die("repack: Expecting full hex object ID lines only from
> pack-objects.");

These are a change solely in text from what was there before. Considering that git pack-objects would have to be modified to produce invalid data in order to trigger these (as discussed in the series that changed them), I think it's okay that these are uncovered.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Derrick Stolee
Message 4 of 4 in “Git Test Coverage Report (Saturday, Oct 27)”
  1. Derrick StoleeOct 27, 2018
  2. Junio C HamanoOct 27, 2018
  3. Derrick StoleeOct 27, 2018
  4. brian m. carlsonOct 27, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.