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

Re: [PATCH v1] travis-ci: build and test Git on Windows

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Mar 22, 2017, 15:49 UTC
Message-ID
<alpine.DEB.2.20.1703221641070.3767@virtualbox>
In-Reply-To
<20170322065612.18797-1-larsxschneider@gmail.com>
Hi Lars,
On Wed, 22 Mar 2017, Lars Schneider wrote:
Show 9 quoted lines
> Things, that might need to be done:
> * The Windows box can only process a single build at a time. A second
>   Windows build would need to wait until the first finishes. This
>   waiting time and the build time after the wait could exceed the 3h
>   threshold. If this is a problem, then it is likely to happen every day
>   as usually multiple branches are pushed at the same time (pu/next/
>   master/maint). I cannot test this as my TravisCI account has the 50min
>   timeout. One solution could be to limit the number of concurrent
>   TravisCI jobs [2].

There is another possibility, too, of course: I may be able to find more resources and add other VMs which could be used to build and run the tests.

Of course, if those tests would not spawn billions of POSIX processes, things would be faster, too, and we could afford to wait for a single build agent.

Show 33 quoted lines
> diff --git a/ci/run-windows-build.sh b/ci/run-windows-build.sh
> new file mode 100755
> index 0000000000..324a9ea4e6
> --- /dev/null
> +++ b/ci/run-windows-build.sh
> @@ -0,0 +1,55 @@
> +#!/usr/bin/env bash
> +#
> +# Script to trigger the a Git for Windows build and test run.
> +# Pass a token, the branch (only branches on https://github.com/git/git)
> +# are supported), and a commit hash.
> +#
> +
> +[ $# -eq 3 ] || (echo "Unexpected number of parameters" && exit 1)
> +
> +TOKEN=$1
> +BRANCH=$2
> +COMMIT=$3
> +
> +gfwci () {
> +	curl \
> +		-H "Authentication: Bearer $TOKEN" \
> +		--silent --retry 5 \
> +		"https://git-for-windows-ci.azurewebsites.net/api/TestNow?$1" |
> +	sed "$(printf '1s/^\xef\xbb\xbf//')"  # Remove the Byte Order Mark
> +}
> +
> +# Trigger build job
> +BUILD_ID=$(gfwci "action=trigger&branch=$BRANCH&commit=$COMMIT&skipTests=false")
> +
> +# Check if the $BUILD_ID contains a number
> +case $BUILD_ID in
> +	''|*[!0-9]*) echo $BUILD_ID && exit 1

Error messages are delivered that way, and they do not start with digits, true. But maybe there is an exit status to indicate to Travis that we cannot decide whether the build failed or succeeded in that case? The most common cause for an error here is that the VM I use for testing is down (which happens every once in a while to save on resources, and I have to manually restart it)...

> +echo "Visual Studio Team Services Build #${BUILD_ID}"
Nice plug, thanks! ;-)
Show 14 quoted lines
> +# Wait until build job finished
> +STATUS=
> +RESULT=
> +while true
> +do
> +	LAST_STATUS=$STATUS
> +	STATUS=$(gfwci "action=status&buildId=$BUILD_ID")
> +	[ "$STATUS" == "$LAST_STATUS" ] || printf "\nStatus: $STATUS "
> +	printf "."
> +
> +	case $STATUS in
> +		inProgress|postponed|notStarted) sleep 10                      ;; # continue
> +		         "completed: succeeded") RESULT="success";        break;; # success
> +		                              *) echo "Unknown: $STATUS"; break;; # failure

Well, there are more values for the status, and we know them, but we do not handle them. Maybe "Unhandled status:"?

Show 10 quoted lines
> +	esac
> +done
> +
> +# Print log
> +echo ""
> +echo ""
> +gfwci "action=log&buildId=$BUILD_ID" | cut -c 30-
> +
> +# Set exit code for TravisCI
> +[ "$RESULT" == "success" ]
Very nice. Thank you so much for keeping me working on this!

Ciao, Dscho

Previous: Lars SchneiderNext: Lars Schneider
Message 2 of 24 in “travis-ci: build and test Git on Windows”
  1. travis-ci: build and test Git on WindowsLars Schneider, Mar 22, 2017
  2. Johannes SchindelinMar 22, 2017
  3. Lars SchneiderMar 23, 2017
  4. Junio C HamanoMar 22, 2017
  5. Johannes SchindelinMar 23, 2017
  6. Jeff KingMar 23, 2017
  7. Junio C HamanoMar 23, 2017
  8. Jeff KingMar 23, 2017
  9. Lars SchneiderMar 23, 2017
  10. Junio C HamanoMar 23, 2017
  11. Lars SchneiderMar 23, 2017
  12. Junio C HamanoMar 23, 2017
  13. Jeff KingMar 23, 2017
  14. Lars SchneiderMar 23, 2017
  15. Jeff KingMar 23, 2017
  16. Junio C HamanoMar 23, 2017
  17. Jeff KingMar 23, 2017
  18. Lars SchneiderMar 23, 2017
  19. Jeff KingMar 23, 2017
  20. Johannes SchindelinMar 24, 2017
  21. Samuel LijinMar 23, 2017
  22. Junio C HamanoMar 23, 2017
  23. Lars SchneiderMar 23, 2017
  24. Junio C HamanoMar 23, 2017

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.