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

Re: [PATCH] travis-ci: build Git during the 'script' phase

From
Jeff King <peff@peff.net>
Date
Jan 13, 2018, 10:32 UTC
Message-ID
<20180113103255.GA31117@sigill.intra.peff.net>
In-Reply-To
<CAM0VKjnSzoc+E408ifKCg+qPTaGRNL3e3JVdRN573kdcBSzbHw@mail.gmail.com>
On Fri, Jan 12, 2018 at 02:32:54PM +0100, SZEDER Gábor wrote:
Show 5 quoted lines
> That's the just beginning of a looong list of executed test scripts in
> seemingly pseudo-random order.  IMHO that's very rarely the interesting
> part; I, for one, am only interested in that list in exceptional cases,
> e.g. while tweaking the build dependencies or the 'prove --state=...'
> options.

Aren't folds supposed to do this? I.e., record all the output but only show it to the user if the command exited non-zero.

According to:
  https://blog.travis-ci.com/2013-05-22-improving-build-visibility-log-folds

they auto-fold individual commands _except_ the ones in the script section. Is there a way to manually mark folds in the output?

Hmph. I could not find an answer from travis, but googling seems to turn up that something like this would work:

diff --git a/ci/lib-travisci.sh b/ci/lib-travisci.sh
index 07f27c7270..8c830aa3c0 100755
--- a/ci/lib-travisci.sh
+++ b/ci/lib-travisci.sh
@@ -77,6 +77,23 @@ check_unignored_build_artifacts ()
 	}
 }
 
+fold () {
+	printf 'travis_fold:start:%s\r' "$1"
+}
+
+unfold () {
+	printf 'travis_fold:end:%s\r' "$1"
+}
+
+fold_cmd () {
+	local name=$1; shift
+	fold "$name"
+	"$@"
+	local ret=$?
+	unfold "$name"
+	return $ret
+}
+
 # Set 'exit on error' for all CI scripts to let the caller know that
 # something went wrong.
 # Set tracing executed commands, primarily setting environment variables
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index d3a094603f..12b2590230 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -7,8 +7,8 @@
 
 ln -s $HOME/travis-cache/.prove t/.prove
 
-make --jobs=2
-make --quiet test
+fold_cmd compile make --jobs=2
+fold_cmd test make --quiet test
 
 check_unignored_build_artifacts
 

I've queued a CI job to see if this actually works. :)

-Peff
Previous: SZEDER GáborNext: Jeff King
Message 5 of 10 in “travis-ci: build Git during the 'script' phase”
  1. travis-ci: build Git during the 'script' phaseSZEDER Gábor, Jan 8, 2018
  2. Junio C HamanoJan 8, 2018
  3. Lars SchneiderJan 8, 2018
  4. SZEDER GáborJan 12, 2018
  5. Jeff KingJan 13, 2018
  6. Jeff KingJan 13, 2018
  7. SZEDER GáborJan 14, 2018
  8. Jeff KingJan 14, 2018
  9. SZEDER GáborJan 14, 2018
  10. Jeff KingJan 14, 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.