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

Re: Git in Outreachy December 2019?

From
Jeff King <peff@peff.net>
Date
Oct 11, 2019, 06:34 UTC
Message-ID
<20191011063443.GB25741@sigill.intra.peff.net>
In-Reply-To
<20191009172551.GI29845@szeder.dev>
On Wed, Oct 09, 2019 at 07:25:51PM +0200, SZEDER Gábor wrote:
Show 11 quoted lines
> > Probably they'd be easy enough to fix (and they're out of tree anyway),
> > so I'm not really arguing against the escape hatch exactly. Mostly I'm
> > just surprised that if I introduced 3 cases (out of probably a dozen
> > scripts), I'm surprised that more contributors aren't accidentally doing
> > so upstream.
> 
> I see it a bit differently.  Over a decade we gathered about
> twenty-something such tests cases: that's about two cases per year.
> You added three such cases in about a year and a half: that's two
> cases per year.  The numbers add up perfectly, you singlehandedly took
> care of everything ;)

Those cases are actually much older than that. I just didn't bother to clean them up until recently. So my rate is even lower :)

Show 15 quoted lines
>   - Some shells do include file descriptor redirections in the trace
>     output, and it varies between implementations to which fd the
>     trace of the redirection goes.
>     
>       - 'ksh/ksh93' and NetBSD's /bin/sh send the trace of
>         redirections to the "wrong" fd, in the sense that e.g. the
>         trace of commands invoked in 'test_must_fail' goes to the
>         function's standard error, and checking its stderr with
>         'test_cmp' would then fail.
>  
>         (But 'ksh/ksh93' doesn't really matter, because they don't
>         support the 'local' keyword, so they fail a bunch of tests
>         even without '-x' anyway.)
> 
>         I don't think we can do anything about these shells.

Yeah, unless somebody is complaining, I don't know that it's worth worrying about too much. The test suite is certainly useful without being able to use "-x" on every single test run (you can still run it without "-x" obviously, or selectively use "-x" to debug a single test or script). So if it is only unreliable on a few tests on a few obscure shells, we can probably live with it until somebody demonstrates a real-world problem (e.g., that they're running automated CI on an obscure platform that is stuck with an old shell, and really want "-x --verbose-log" to get more verbose failures).

Show 9 quoted lines
>   - We do call 'test_have_prereq' from within test cases as well,
>     notably from the 'test_i18ngrep', 'test_i18ncmp' and
>     'test_ln_s_add' helper functions.  In those cases all trace output
>     from 'test_have_prereq' is included in the test case's trace
>     output, which means that during the first invocation:
> 
>       - there is lots of distracting and confusing trace output, as
>         the script evaluating the prereq is passed around to a bunch
>         of functions.
Yeah, I think this is probably an issue even with bash.
Show 6 quoted lines
>     As far as 'test_i18ngrep' is concerned, which accounts for the
>     majority of 'test_have_prereq' invocations within test cases, I
>     don't understand why it uses 'test_have_prereq' in the first place
>     instead of checking the GIT_TEST_GETTEXT_POISON environment
>     variable; and 6cdccfce1e (i18n: make GETTEXT_POISON a runtime
>     option, 2018-11-08) doesn't give me any insight.

I think it's just that checking the environment variable is non-trivial: we invoke env--helper to handle bool interpretation. So we'd prefer to cache the result (and not to run it at all if a test script doesn't use i18ngrep, though it's perhaps ubiquitous enough that we should just run it up front for every script).

>     I recall that some months ago we discussed the idea of how to
>     disable trace output from within test helper functions; that would
>     help with this 'test_have_prereq' issue as well, at least in case
>     of the more "common" shells.
That might be worth doing, though IIRC it got kind of hairy. :)
-Peff
Previous: SZEDER GáborNext: Jeff King
Message 35 of 63 in “Git in Outreachy December 2019?”
  1. Jeff KingAug 27, 2019
  2. Christian CouderAug 31, 2019
  3. Olga TelezhnayaAug 31, 2019
  4. Jeff KingSep 4, 2019
  5. Christian CouderSep 5, 2019
  6. Emily ShafferSep 5, 2019
  7. Carlo ArenasSep 6, 2019
  8. Jeff KingSep 7, 2019
  9. Carlo ArenasSep 7, 2019
  10. Jeff KingSep 7, 2019
  11. Pratyush YadavSep 8, 2019
  12. Jeff KingSep 9, 2019
  13. SZEDER GáborSep 23, 2019
  14. SZEDER GáborSep 26, 2019
  15. Johannes SchindelinSep 26, 2019
  16. SZEDER GáborSep 26, 2019
  17. Johannes SchindelinSep 26, 2019
  18. Jonathan TanSep 13, 2019
  19. Jeff KingSep 13, 2019
  20. Emily ShafferSep 16, 2019
  21. Eric WongSep 16, 2019
  22. SZEDER GáborSep 16, 2019
  23. Jonathan NiederSep 16, 2019
  24. Jeff KingSep 17, 2019
  25. Johannes SchindelinSep 17, 2019
  26. SZEDER GáborSep 17, 2019
  27. Johannes SchindelinSep 23, 2019
  28. SZEDER GáborSep 23, 2019
  29. Johannes SchindelinSep 26, 2019
  30. SZEDER GáborSep 26, 2019
  31. Johannes SchindelinSep 26, 2019
  32. SZEDER GáborSep 26, 2019
  33. Jeff KingSep 27, 2019
  34. SZEDER GáborOct 9, 2019
  35. Jeff KingOct 11, 2019
  36. Jeff KingSep 23, 2019
  37. Johannes SchindelinSep 24, 2019
  38. Christian CouderSep 17, 2019
  39. Johannes SchindelinSep 23, 2019
  40. Jeff KingSep 23, 2019
  41. Jeff KingSep 23, 2019
  42. Johannes SchindelinSep 24, 2019
  43. Jeff KingSep 24, 2019
  44. Junio C HamanoSep 28, 2019
  45. Eric WongSep 24, 2019
  46. Johannes SchindelinSep 26, 2019
  47. Eric WongSep 30, 2019
  48. Junio C HamanoSep 28, 2019
  49. Jonathan TanSep 20, 2019
  50. Emily ShafferSep 21, 2019
  51. Christian CouderSep 23, 2019
  52. Jeff KingSep 23, 2019
  53. Philip OakleySep 23, 2019
  54. Emily ShafferOct 22, 2019
  55. Christian CouderSep 23, 2019
  56. Jonathan TanSep 23, 2019
  57. Jeff KingSep 23, 2019
  58. Jonathan TanSep 23, 2019
  59. Jeff KingSep 23, 2019
  60. Jonathan TanSep 23, 2019
  61. Jeff KingSep 23, 2019
  62. Jonathan TanSep 24, 2019
  63. Jeff KingSep 26, 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.