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

Re: Git Test Coverage Report (Thurs. June 27)

From
Derrick Stolee <stolee@gmail.com>
Date
Jun 28, 2019, 12:39 UTC
Message-ID
<e9c14b58-2704-4750-9c37-7a7b15e596dc@gmail.com>
In-Reply-To
<CACsJy8C7Qr3JauRqUkB957ZDzVVZ0+wofzs7N2NzCbu+e00JnQ@mail.gmail.com>
On 6/28/2019 5:47 AM, Duy Nguyen wrote:
Show 27 quoted lines
> On Fri, Jun 28, 2019 at 12:35 AM Derrick Stolee <stolee@gmail.com> wrote:
>>> dir.c
>>> 3b2385cf 2840) static void jw_object_untracked_cache_dir(struct json_writer *jw,
>>> 3b2385cf 2845) jw_object_bool(jw, "valid", ucd->valid);
>>> 3b2385cf 2846) jw_object_bool(jw, "check-only", ucd->check_only);
>>> 3b2385cf 2847) jw_object_stat_data(jw, "stat", &ucd->stat_data);
>>> 3b2385cf 2848) jw_object_string(jw, "exclude-oid", oid_to_hex(&ucd->exclude_oid));
>>> 3b2385cf 2849) jw_object_inline_begin_array(jw, "untracked");
>>> 3b2385cf 2850) for (i = 0; i < ucd->untracked_nr; i++)
>>> 3b2385cf 2851) jw_array_string(jw, ucd->untracked[i]);
>>> 3b2385cf 2852) jw_end(jw);
>>> 3b2385cf 2854) jw_object_inline_begin_object(jw, "dirs");
>>> 3b2385cf 2855) for (i = 0; i < ucd->dirs_nr; i++) {
>>> 3b2385cf 2856) jw_object_inline_begin_object(jw, ucd->dirs[i]->name);
>>> 3b2385cf 2857) jw_object_untracked_cache_dir(jw, ucd->dirs[i]);
>>> 3b2385cf 2858) jw_end(jw);
>>> 3b2385cf 2860) jw_end(jw);
>>> 3b2385cf 2861) }
>>> 3b2385cf 2958) jw_object_inline_begin_object(jw, "root");
>>> 3b2385cf 2959) jw_object_untracked_cache_dir(jw, uc->root);
>>> 3b2385cf 2960) jw_end(jw);
>>
>> Duy: I know you were working on some tests for these options. This is specifically
>> in the "untracked cache" mode, so enabling the cache with at least one entry and
>> running --debug-json should be sufficient.
> 
> It's a bit more complicated than that, but I see your point.
It usually is. I don't mean to underestimate the effort here.
> I initially looked at the output and saw "something" and moved on. I
> should have examined the json output more carefully.
Thanks for taking a second look!
Show 18 quoted lines
>>> read-cache.c
>>> 8eeabe15 1752) ret = error(_("index uses %.4s extension, which we do not understand"),
>>> ee70c128 1754) if (advice_unknown_index_extension) {
>>> ee70c128 1755) warning(_("ignoring optional %.4s index extension"), ext);
>>> ee70c128 1756) advise(_("This is likely due to the file having been written by a newer\n"
>>> 272b3f2a 2026) jw_object_true(jw, "assume_unchanged");
>>> 272b3f2a 2030) jw_object_true(jw, "skip_worktree");
>>> 272b3f2a 2032) jw_object_intmax(jw, "stage", ce_stage(ce));
>>> f0f544da 2309) ieot = read_ieot_extension(istate, mmap, mmap_size, extension_offset);
>>> f0f544da 3651) static struct index_entry_offset_table *read_ieot_extension(
>>> f0f544da 3673) return do_read_ieot_extension(istate, index, extsize);
>>
>> Duy: more JSON output cases that could be interesting to cover.
> 
> This is because I changed the function signature, I think. Both IEOT
> and EOIE extensions, if I'm not mistaken, are never tested in the test
> suite. You need to set GIT_TEST_INDEX_THREADS, then the last three
> lines should be covered.

Thanks! Unfortunately, the threading is removed at compile-time in order to prevent race conditions with the gcov output. This means the report will never report the threading code as covered. :(

Does that same reasoning apply to the assume_unchanged, skip_worktree, and "stage" lines?

-Stolee
Previous: Duy NguyenNext: Christian Couder
Message 42 of 43 in “Git Test Coverage Report (Thurs. June 27)”
  1. Derrick StoleeJun 27, 2019
  2. Derrick StoleeJun 27, 2019
  3. Jeff KingJun 28, 2019
  4. 0/6 easy bulk commit creation in testsJeff King, Jun 28, 2019
  5. 1/6 test-lib: introduce test_commit_bulkJeff King, Jun 28, 2019
  6. Derrick StoleeJun 28, 2019
  7. Junio C HamanoJun 28, 2019
  8. Jeff KingJun 29, 2019
  9. Junio C HamanoJun 28, 2019
  10. Jeff KingJun 29, 2019
  11. Ævar Arnfjörð BjarmasonJun 28, 2019
  12. Jeff KingJun 29, 2019
  13. Eric SunshineJun 28, 2019
  14. SZEDER GáborJun 28, 2019
  15. Eric SunshineJun 28, 2019
  16. Jeff KingJun 29, 2019
  17. SZEDER GáborJun 29, 2019
  18. Junio C HamanoJul 1, 2019
  19. Jeff KingJun 29, 2019
  20. 2/6 t5310: increase the number of bitmapped commitsJeff King, Jun 28, 2019
  21. 3/6 t3311: use test_commit_bulkJeff King, Jun 28, 2019
  22. 4/6 t5702: use test_commit_bulkJeff King, Jun 28, 2019
  23. 5/6 t5703: use test_commit_bulkJeff King, Jun 28, 2019
  24. 6/6 t6200: use test_commit_bulkJeff King, Jun 28, 2019
  25. Johannes SchindelinJun 28, 2019
  26. Jeff KingJun 29, 2019
  27. Elijah NewrenJun 29, 2019
  28. Jeff KingJun 30, 2019
  29. Ævar Arnfjörð BjarmasonJun 28, 2019
  30. Jeff KingJun 29, 2019
  31. 1/6 test-lib: introduce test_commit_bulkJeff King, Jun 29, 2019
  32. Junio C HamanoJul 1, 2019
  33. Jeff KingJul 2, 2019
  34. Junio C HamanoJul 1, 2019
  35. Jeff KingJul 2, 2019
  36. Jeff KingJun 28, 2019
  37. Derrick StoleeJun 28, 2019
  38. Jeff KingJun 28, 2019
  39. Derrick StoleeJun 29, 2019
  40. Jeff KingJun 29, 2019
  41. Duy NguyenJun 28, 2019
  42. Derrick StoleeJun 28, 2019
  43. Christian CouderJun 28, 2019

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.