aboutsummaryrefslogtreecommitdiffstats
path: root/ci
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2019-01-29 06:19:28 -0800
committerJunio C Hamano <gitster@pobox.com>2019-01-29 09:26:46 -0800
commit6141a2edc9aa137d7c44a24791e50221c2ed8a5e (patch)
treeff8fc0c09a519182108bc719df8a2ccd793eca66 /ci
parent222319081515f9f6a4c699bd3a406f181a6ddc3b (diff)
downloadgit-6141a2edc9aa137d7c44a24791e50221c2ed8a5e.tar.gz
ci/lib.sh: add support for Azure Pipelines
This patch introduces a conditional arm that defines some environment variables and a function that displays the URL given the job id (to identify previous runs for known-good trees). Because Azure Pipeline's macOS agents already have git-lfs and gettext installed, we can leave `BREW_INSTALL_PACKAGES` empty (unlike in Travis' case). Note: this patch does not introduce an Azure Pipelines definition yet; That is left for the next patch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'ci')
-rwxr-xr-xci/lib.sh25
-rwxr-xr-xci/print-test-failures.sh5
2 files changed, 30 insertions, 0 deletions
diff --git a/ci/lib.sh b/ci/lib.sh
index 32a28fd209..5505776876 100755
--- a/ci/lib.sh
+++ b/ci/lib.sh
@@ -102,6 +102,31 @@ then
export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
export GIT_TEST_OPTS="--verbose-log -x --immediate"
export MAKEFLAGS="--jobs=2"
+elif test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI"
+then
+ CI_TYPE=azure-pipelines
+ # We are running in Azure Pipelines
+ CI_BRANCH="$BUILD_SOURCEBRANCH"
+ CI_COMMIT="$BUILD_SOURCEVERSION"
+ CI_JOB_ID="$BUILD_BUILDID"
+ CI_JOB_NUMBER="$BUILD_BUILDNUMBER"
+ CI_OS_NAME="$(echo "$AGENT_OS" | tr A-Z a-z)"
+ test darwin != "$CI_OS_NAME" || CI_OS_NAME=osx
+ CI_REPO_SLUG="$(expr "$BUILD_REPOSITORY_URI" : '.*/\([^/]*/[^/]*\)$')"
+ CC="${CC:-gcc}"
+
+ # use a subdirectory of the cache dir (because the file share is shared
+ # among *all* phases)
+ cache_dir="$HOME/test-cache/$SYSTEM_PHASENAME"
+
+ url_for_job_id () {
+ echo "$SYSTEM_TASKDEFINITIONSURI$SYSTEM_TEAMPROJECT/_build/results?buildId=$1"
+ }
+
+ BREW_INSTALL_PACKAGES=
+ export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
+ export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
+ export MAKEFLAGS="--jobs=10"
else
echo "Could not identify CI type" >&2
exit 1
diff --git a/ci/print-test-failures.sh b/ci/print-test-failures.sh
index cf321b474d..e688a26f0d 100755
--- a/ci/print-test-failures.sh
+++ b/ci/print-test-failures.sh
@@ -41,6 +41,11 @@ do
case "$CI_TYPE" in
travis)
;;
+ azure-pipelines)
+ mkdir -p failed-test-artifacts
+ mv "$trash_dir" failed-test-artifacts
+ continue
+ ;;
*)
echo "Unhandled CI type: $CI_TYPE" >&2
exit 1