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

Re: [PATCH v2 1/1] contrib: add coverage-diff script

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 13, 2018, 17:54 UTC
Message-ID
<CAPig+cQeA9UhVEAz-4TgMD4K6FsFk5tL0AH_uSjXApt888q25g@mail.gmail.com>
In-Reply-To
<7714b0659e3210e34d0904b3347473427546d15c.1536850601.git.gitgitgadget@gmail.com>

On Thu, Sep 13, 2018 at 10:56 AM Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 5 quoted lines
> There have been a few bugs in recent patches what would have been caught
> if the test suite covered those blocks (including a few of mine). I want
> to work towards a "sensible" amount of coverage on new topics. In my opinion,
> this means that any logic should be covered, but the 'die()' blocks in error
> cases do not need to be covered.

The bit about die() blocks is perhaps a bit too general. While it's true that some die()'s signal very unlikely (or near-impossible) conditions, others are merely reporting invalid user or other input to the program. The latter category is often very much worth testing, as the number of test_must_fail() invocations in the test suite shows. 68a6b3a1bd (worktree: teach 'move' to override lock when --force given twice, 2018-08-28), which was highlighted in your cover letter, provides a good example of legitimately testing that a die() is covered. So, perhaps the above can be toned-down a bit by saying something like:

    ...but die() blocks covering very unlikely (or near-impossible)
    situations may not warrant coverage.
> It is important to not measure the coverage of the codebase by what old code
> is not covered.
Previous: Derrick StoleeNext: Derrick Stolee via GitGitGadget
Message 14 of 22 in “contrib: Add script to show uncovered "new" lines”
  1. 0/1 contrib: Add script to show uncovered "new" linesDerrick Stolee via GitGitGadget, Sep 12, 2018
  2. 1/1 contrib: add coverage-diff scriptDerrick Stolee via GitGitGadget, Sep 12, 2018
  3. Junio C HamanoSep 12, 2018
  4. Junio C HamanoSep 12, 2018
  5. Derrick StoleeSep 13, 2018
  6. Junio C HamanoSep 13, 2018
  7. Derrick StoleeSep 12, 2018
  8. Ben PeartSep 12, 2018
  9. Junio C HamanoSep 12, 2018
  10. 0/1 contrib: Add script to show uncovered "new" linesDerrick Stolee via GitGitGadget, Sep 13, 2018
  11. 1/1 contrib: add coverage-diff scriptDerrick Stolee via GitGitGadget, Sep 13, 2018
  12. Junio C HamanoSep 13, 2018
  13. Derrick StoleeSep 13, 2018
  14. Eric SunshineSep 13, 2018
  15. 0/1 contrib: Add script to show uncovered "new" linesDerrick Stolee via GitGitGadget, Sep 21, 2018
  16. 1/1 contrib: add coverage-diff scriptDerrick Stolee via GitGitGadget, Sep 21, 2018
  17. Junio C HamanoSep 25, 2018
  18. Derrick StoleeSep 21, 2018
  19. 0/1 contrib: Add script to show uncovered "new" linesDerrick Stolee via GitGitGadget, Oct 8, 2018
  20. 1/1 contrib: add coverage-diff scriptDerrick Stolee via GitGitGadget, Oct 8, 2018
  21. Junio C HamanoOct 12, 2018
  22. Derrick StoleeOct 12, 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.