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

[RFC/PATCH 0/4] Add submodule test harness

From
Jens Lehmann <jens.lehmann@web.de>
Date
Mar 25, 2014, 17:03 UTC
Message-ID
<5331B6F6.60501@web.de>

So here is my proposal for a single test harness for submodule updates. It is intended to be easily applicable to all work tree manipulating commands. The current version tests the status quo (and it documents two bugs in current Git). This framework will be extended to cover recursive submodule update too in a later series.

The first patch adds a simple helper function to the test lib which makes it easier to test for an empty submodule directory.

The second patch contains the heavy lifting, it adds the test framework for switching submodules. Currently only transitions without merge conflicts are tested for, I intend to add others producing merge conflicts in a follow-up series.

The third and forth patch show how to apply this framework to a simple command (checkout) and a more complicated case where a helper function is used to execute a preparing command (diff) which produces the input for the then to-be-tested command (apply).

I'm currently working on adding this harness to more commands. read-tree and reset are finished, merge and pull still show some oddities when used with the --no-ff option, also cherry-pick and checkout-index are not working as expected yet. And then there are am, apply, bisect, rebase, revert & stash apply which still need to be covered.

Jens Lehmann (4):
  test-lib: add test_dir_is_empty()
  Submodules: Add the lib-submodule-update.sh test library
  checkout: call the new submodule update test framework
  apply: add t4137 for submodule updates
 t/lib-submodule-update.sh     | 627 ++++++++++++++++++++++++++++++++++++++++++
 t/t2013-checkout-submodule.sh |   5 +
 t/t4137-apply-submodule.sh    |  20 ++
 t/test-lib-functions.sh       |  11 +
 4 files changed, 663 insertions(+)
 create mode 100755 t/lib-submodule-update.sh
 create mode 100755 t/t4137-apply-submodule.sh
-- 
1.9.1.327.g3d8d896
Next: Jens Lehmann
Message 1 of 17 in “Add submodule test harness”
  1. 0/4 Add submodule test harnessJens Lehmann, Mar 25, 2014
  2. 1/4 test-lib: add test_dir_is_empty()Jens Lehmann, Mar 25, 2014
  3. Junio C HamanoMar 25, 2014
  4. David KastrupMar 25, 2014
  5. Jens LehmannMar 26, 2014
  6. Michael HaggertyMar 26, 2014
  7. Jens LehmannMar 26, 2014
  8. 2/4 Submodules: Add the lib-submodule-update.sh test libraryJens Lehmann, Mar 25, 2014
  9. W. Trevor KingApr 17, 2014
  10. Junio C HamanoApr 17, 2014
  11. Jens LehmannApr 17, 2014
  12. Heiko VoigtApr 18, 2014
  13. Jens LehmannApr 17, 2014
  14. W. Trevor KingApr 17, 2014
  15. Jens LehmannApr 18, 2014
  16. 3/4 checkout: call the new submodule update test frameworkJens Lehmann, Mar 25, 2014
  17. 4/4 apply: add t4137 for submodule updatesJens Lehmann, Mar 25, 2014

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.