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

Re: [PATCH v2 8/8] test-lib: clear watchman watches at test completion

From
Derrick Stolee <stolee@gmail.com>
Date
Dec 10, 2019, 13:51 UTC
Message-ID
<dd8c14d3-21b6-731c-bd50-650d063d686f@gmail.com>
In-Reply-To
<xmqqo8wgsqnn.fsf@gitster-ct.c.googlers.com>
On 12/10/2019 12:20 AM, Junio C Hamano wrote:
Show 9 quoted lines
> Derrick Stolee <stolee@gmail.com> writes:
> 
>> Hm. That is a good point. Can we assume that our version of grep has
>> a "-F" or "--fixed-strings" option? ([1] seems to say that "-F" would
>> work.)
> 
> $ git grep "grep -F" -- \*.sh
> 
> is your friend ;-) 
Yes, of course I should have just looked for examples.
> And never use https://www.gnu.org/ manual as a yardstick---you will
> end up using GNUism that is not unavailable elsewhere pretty easily.

I tried to focus on the part that said "this is part of POSIX", but you are right that may not be the best place to look.

Show 31 quoted lines
>> [1] https://www.gnu.org/savannah-checkouts/gnu/grep/manual/grep.html#index-grep-programs
>>
>>> What are these stripping of ", and " about?  Could you tell readers
>>> how a typical output from the program we are reading from looks like
>>> perhaps in the log message or in-code comment around here?
>>
>> Watchman outputs its list of paths in JSON format. Luckily, it formats
>> the output so the path lines are on separate lines, each quoted.
>>
>> For example:
>>
>> {
>> 	"version": "4.9.0",
>> 	"roots": [
>> 		"<path1>",
>> 		"<path2>",
>> 		"<path3>"
>> 	]
>> }
> 
> Yeek; how is a dq in path represented?  by doubling?  by
> backslash-quoting (if so how is a backslash in path represented)?
> By something else?
> 
> It's OK at least for now to declare that our test repository does
> not contain any funny paths, but in the longer run does the above
> mean that we somehow need to be able to grok JSON reliably in our
> tests?  It may not be such a bad thing especially for longer term,
> as there are other parts of the system that may benefit from having
> JSON capable output readers in our tests (e.g. trace2 code can do
> JSON, right?)..

trace2 can _write_ JSON, not parse it. However, we have some parsing code (using a package) in the performance tests. I could try adapting that for this purpose. That package is not currently required by the test suite, so it causes some dependency issues when first running the perf suite. At least we wouldn't need the package unless running with GIT_TEST_FSMONITOR.

My guess is that this patch is going to be trouble, so I'll eject it in the next version and save the JSON parsing and everything for its own series. We only really need it when we are getting close to running watchman in CI on Windows.

Thanks, -Stolee

Previous: Junio C HamanoNext: Johannes Schindelin
Message 36 of 41 in “Improve testability with GIT_TEST_FSMONITOR”
  1. 00/11 Improve testability with GIT_TEST_FSMONITORDerrick Stolee via GitGitGadget, Nov 21, 2019
  2. 01/11 fsmonitor: disable in a bare repoDerrick Stolee via GitGitGadget, Nov 21, 2019
  3. Denton LiuNov 21, 2019
  4. Derrick StoleeNov 22, 2019
  5. 02/11 fsmonitor: do not output to stderr for testsDerrick Stolee via GitGitGadget, Nov 21, 2019
  6. 03/11 t1301-shared-repo.sh: disable FSMONITORDerrick Stolee via GitGitGadget, Nov 21, 2019
  7. 04/11 t1510-repo-setup.sh: disable fsmonitor if no .git dirDerrick Stolee via GitGitGadget, Nov 21, 2019
  8. 05/11 fsmonitor: disable fsmonitor with worktreesDerrick Stolee via GitGitGadget, Nov 21, 2019
  9. 07/11 t3600-rm.sh: disable fsmonitor when deleting populated submoduleDerrick Stolee via GitGitGadget, Nov 21, 2019
  10. 06/11 t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREEDerrick Stolee via GitGitGadget, Nov 21, 2019
  11. 09/11 t7063: disable fsmonitor with status cacheDerrick Stolee via GitGitGadget, Nov 21, 2019
  12. 08/11 tests: disable fsmonitor in submodule testsDerrick Stolee via GitGitGadget, Nov 21, 2019
  13. 11/11 test-lib: clear watchman watches at test completionDerrick Stolee via GitGitGadget, Nov 21, 2019
  14. SZEDER GáborNov 22, 2019
  15. Derrick StoleeDec 9, 2019
  16. SZEDER GáborDec 9, 2019
  17. Derrick StoleeDec 10, 2019
  18. 10/11 t7519: disable external GIT_TEST_FSMONITOR variableDerrick Stolee via GitGitGadget, Nov 21, 2019
  19. 0/8 Improve testability with GIT_TEST_FSMONITORDerrick Stolee via GitGitGadget, Dec 9, 2019
  20. 1/8 fsmonitor: disable in a bare repoDerrick Stolee via GitGitGadget, Dec 9, 2019
  21. SZEDER GáborDec 10, 2019
  22. 2/8 fsmonitor: do not output to stderr for testsDerrick Stolee via GitGitGadget, Dec 9, 2019
  23. 3/8 t1301-shared-repo.sh: disable FSMONITORDerrick Stolee via GitGitGadget, Dec 9, 2019
  24. SZEDER GáborDec 10, 2019
  25. 4/8 t3030-merge-recursive.sh: disable fsmonitor when tweaking GIT_WORK_TREEDerrick Stolee via GitGitGadget, Dec 9, 2019
  26. SZEDER GáborDec 10, 2019
  27. Derrick StoleeDec 10, 2019
  28. SZEDER GáborDec 10, 2019
  29. SZEDER GáborDec 10, 2019
  30. Derrick StoleeJan 23, 2020
  31. 7/8 t7519: disable external GIT_TEST_FSMONITOR variableDerrick Stolee via GitGitGadget, Dec 9, 2019
  32. 8/8 test-lib: clear watchman watches at test completionDerrick Stolee via GitGitGadget, Dec 9, 2019
  33. Junio C HamanoDec 9, 2019
  34. Derrick StoleeDec 10, 2019
  35. Junio C HamanoDec 10, 2019
  36. Derrick StoleeDec 10, 2019
  37. Johannes SchindelinDec 10, 2019
  38. 6/8 t7063: disable fsmonitor with status cacheDerrick Stolee via GitGitGadget, Dec 9, 2019
  39. 5/8 tests: disable fsmonitor in submodule testsDerrick Stolee via GitGitGadget, Dec 9, 2019
  40. SZEDER GáborDec 10, 2019
  41. Derrick StoleeDec 10, 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.