From 70e613b73e5f27e716b43df78f879b27291f10a2 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 16 Oct 2018 16:12:00 +0200 Subject: [PATCH 1/8] ci(mingw): speed up, by disabling the chain lint This is just a test balloon, to see how much it costs us. The main cost seems to be the subshell `(exit 117)`, which is expensive in the MSYS2 Bash due to the way `fork()` is emulated. Signed-off-by: Johannes Schindelin --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 52251a33315776..d41134b0d9a75c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -215,7 +215,7 @@ phases: . ci/lib.sh make -j10 DEVELOPER=1 NO_PERL=1 || exit 1 - NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || { + NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--no-chain-lint --quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || { NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"-i -v -x\" make -k -C t failed; exit 1 } From 834c6f193f0ae561ab3453b4a747f074be4d03e2 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 18 Oct 2018 10:58:52 +0200 Subject: [PATCH 2/8] TEST: disable non-Windows phases The main aim of this here patch is to allow quicker turnaround times testing several things to accelerate the test suite on Windows. Let's not bother with non-Windows phases for now, then. Signed-off-by: Johannes Schindelin --- azure-pipelines.yml | 243 -------------------------------------------- 1 file changed, 243 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d41134b0d9a75c..48ef282dc50483 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,163 +3,6 @@ resources: fetchDepth: 1 phases: -- phase: linux_clang - displayName: linux-clang - condition: succeeded() - queue: - name: Hosted Ubuntu 1604 - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - sudo apt-get update && - sudo rm /var/lib/apt/lists/lock && - sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin && - - export CC=clang || exit 1 - - ci/install-dependencies.sh - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 - displayName: 'ci/run-build-and-tests.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux-clang' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - -- phase: linux_gcc - displayName: linux-gcc - condition: succeeded() - queue: - name: Hosted Ubuntu 1604 - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - sudo apt-get update && - sudo rm /var/lib/apt/lists/lock && - sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev apache2-bin || exit 1 - - ci/install-dependencies.sh - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 - displayName: 'ci/run-build-and-tests.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux-gcc' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - -- phase: osx_clang - displayName: osx-clang - condition: succeeded() - queue: - name: Hosted macOS - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - export CC=clang - - ci/install-dependencies.sh - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1 - displayName: 'ci/run-build-and-tests.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'osx-clang' - platform: macOS - publishRunAttachments: false - condition: succeededOrFailed() - -- phase: osx_gcc - displayName: osx-gcc - condition: succeeded() - queue: - name: Hosted macOS - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - ci/install-dependencies.sh - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || umount "$HOME/test-cache" || exit 1 - displayName: 'ci/run-build-and-tests.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'osx-gcc' - platform: macOS - publishRunAttachments: false - condition: succeededOrFailed() - -- phase: gettext_poison - displayName: GETTEXT_POISON - condition: succeeded() - queue: - name: Hosted Ubuntu 1604 - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - sudo apt-get update && - sudo rm /var/lib/apt/lists/lock && - sudo apt-get -y install git gcc make libssl-dev libcurl4-openssl-dev libexpat-dev tcl tk gettext git-email zlib1g-dev && - - export jobname=GETTEXT_POISON || exit 1 - - ci/run-build-and-tests.sh || { - ci/print-test-failures.sh - exit 1 - } - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 - displayName: 'ci/run-build-and-tests.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'gettext-poison' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - - phase: windows displayName: Windows condition: succeeded() @@ -237,89 +80,3 @@ phases: platform: Windows publishRunAttachments: false condition: succeededOrFailed() - -- phase: linux32 - displayName: Linux32 - condition: succeeded() - queue: - name: Hosted Ubuntu 1604 - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - sudo apt-get update && - sudo rm /var/lib/apt/lists/lock && - sudo apt-get -y install \ - apt-transport-https \ - ca-certificates \ - curl \ - software-properties-common && - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && - sudo add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) \ - stable" && - sudo apt-get update && - sudo apt-get -y install docker-ce && - - sudo AGENT_OS="$AGENT_OS" BUILD_BUILDNUMBER="$BUILD_BUILDNUMBER" BUILD_REPOSITORY_URI="$BUILD_REPOSITORY_URI" BUILD_SOURCEBRANCH="$BUILD_SOURCEBRANCH" BUILD_SOURCEVERSION="$BUILD_SOURCEVERSION" SYSTEM_PHASENAME="$SYSTEM_PHASENAME" SYSTEM_TASKDEFINITIONSURI="$SYSTEM_TASKDEFINITIONSURI" SYSTEM_TEAMPROJECT="$SYSTEM_TEAMPROJECT" CC=$CC MAKEFLAGS=-j3 bash -lxc ci/run-linux32-docker.sh || exit 1 - - sudo chmod a+r t/out/TEST-*.xml - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 - displayName: 'ci/run-linux32-docker.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) - - task: PublishTestResults@2 - displayName: 'Publish Test Results **/TEST-*.xml' - inputs: - mergeTestResults: true - testRunTitle: 'linux32' - platform: Linux - publishRunAttachments: false - condition: succeededOrFailed() - -- phase: static_analysis - displayName: StaticAnalysis - condition: succeeded() - queue: - name: Hosted Ubuntu 1604 - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - sudo apt-get update && - sudo rm /var/lib/apt/lists/lock && - sudo apt-get install -y coccinelle && - - export jobname=StaticAnalysis && - - ci/run-static-analysis.sh || exit 1 - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 - displayName: 'ci/run-static-analysis.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) - -- phase: documentation - displayName: Documentation - condition: succeeded() - queue: - name: Hosted Ubuntu 1604 - steps: - - bash: | - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || ci/mount-fileshare.sh //gitfileshare.file.core.windows.net/test-cache gitfileshare "$GITFILESHAREPWD" "$HOME/test-cache" || exit 1 - - sudo apt-get update && - sudo rm /var/lib/apt/lists/lock && - sudo apt-get install -y asciidoc xmlto asciidoctor && - - export ALREADY_HAVE_ASCIIDOCTOR=yes. && - export jobname=Documentation && - - ci/test-documentation.sh || exit 1 - - test "$GITFILESHAREPWD" = '$(gitfileshare.pwd)' || sudo umount "$HOME/test-cache" || exit 1 - displayName: 'ci/test-documentation.sh' - env: - GITFILESHAREPWD: $(gitfileshare.pwd) From a913d718ee3ece96bc4d6d1c0aa8ac6dfcba4b2b Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 21 Jul 2017 22:17:20 +0200 Subject: [PATCH 3/8] tests: add t/helper/ to the PATH with --with-dashes We really need to be able to find the test helpers... Really. This change was forgotten when we moved the test helpers into t/helper/ Signed-off-by: Johannes Schindelin --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index bf90aa500c23ca..d1c7a1076bc5b4 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1082,7 +1082,7 @@ else # normal case, use ../bin-wrappers only unless $with_dashes: GIT_EXEC_PATH=$GIT_BUILD_DIR if test -n "$with_dashes" then - PATH="$GIT_BUILD_DIR$PATH_SEP$PATH" + PATH="$GIT_BUILD_DIR$PATH_SEP$GIT_BUILD_DIR/t/helper$PATH_SEP$PATH" fi fi GIT_TEMPLATE_DIR="$GIT_BUILD_DIR"/templates/blt From dd525676868c549160fd723b6f576a91f74d8ca2 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 18 Oct 2018 11:08:23 +0200 Subject: [PATCH 4/8] squash! tests: explicitly use `git.exe` on Windows For the same reason, we need to handle test-tool.exe the same way. Signed-off-by: Johannes Schindelin --- t/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index d1c7a1076bc5b4..5dbd94c60e8b7f 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1106,7 +1106,7 @@ test -d "$GIT_BUILD_DIR"/templates/blt || { error "You haven't built things yet, have you?" } -if ! test -x "$GIT_BUILD_DIR"/t/helper/test-tool +if ! test -x "$GIT_BUILD_DIR"/t/helper/test-tool$X then echo >&2 'You need to build test-tool:' echo >&2 'Run "make t/helper/test-tool" in the source (toplevel) directory' From e9d0c6b69ee580a6e2368fd72c318c31f3be35c0 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 16 Oct 2018 16:12:00 +0200 Subject: [PATCH 5/8] ci(mingw): speed up, by side-stepping bin-wrappers/ This is just a test balloon, to see how much it costs us. The main cost seems to be the shell that spawns just another .exe, which is expensive in the MSYS2 Bash due to the way `fork()` is emulated. Signed-off-by: Johannes Schindelin --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 48ef282dc50483..a54601ad440a27 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -58,7 +58,7 @@ phases: . ci/lib.sh make -j10 DEVELOPER=1 NO_PERL=1 || exit 1 - NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--no-chain-lint --quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || { + NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--no-chain-lint --with-dashes --quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || { NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"-i -v -x\" make -k -C t failed; exit 1 } From d65f9158a3ce3c5018db7f1ff4dc0fb5cfecbe04 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 18 Oct 2018 14:19:06 +0200 Subject: [PATCH 6/8] t0061: fix with --with-dashes and RUNTIME_PREFIX When building Git with RUNTIME_PREFIX and starting a test helper from t/helper/, it fails to detect the system prefix correctly. This is the reason that the warning RUNTIME_PREFIX requested, but prefix computation failed. [...] to be printed. In t0061, we did not expect that to happen, and it actually did not happen in the normal case, because bin-wrappers/test-tool specifically sets GIT_TEXTDOMAINDIR (and as a consequence, nothing in test-tool wants to know about the runtime prefix). However, with --with-dashes, bin-wrappers/test-tool is no longer called, but t/helper/test-tool is called directly. So let's just ignore the RUNTIME_PREFIX warning. Signed-off-by: Johannes Schindelin --- t/t0061-run-command.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/t/t0061-run-command.sh b/t/t0061-run-command.sh index 43ff4939adfb5f..0215c969444e98 100755 --- a/t/t0061-run-command.sh +++ b/t/t0061-run-command.sh @@ -148,7 +148,8 @@ test_trace () { expect="$1" shift GIT_TRACE=1 test-tool run-command "$@" run-command true 2>&1 >/dev/null | \ - sed -e 's/.* run_command: //' -e '/trace: .*/d' >actual && + sed -e 's/.* run_command: //' -e '/trace: .*/d' \ + -e '/RUNTIME_PREFIX requested/d' >actual && echo "$expect true" >expect && test_cmp expect actual } From b7ad7e9e2b2f5cb5d561dabcf038560ecef986f6 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Oct 2018 18:34:09 +0200 Subject: [PATCH 7/8] tests: optionally skip bin-wrappers/ This speeds up the tests by a bit on Windows, where running Unix shell scripts (and spawning processes) is not exactly a cheap operation. Signed-off-by: Johannes Schindelin --- t/README | 9 +++++++++ t/test-lib.sh | 19 +++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/t/README b/t/README index 9028b47d923ca0..31b0daed95525c 100644 --- a/t/README +++ b/t/README @@ -169,6 +169,15 @@ appropriately before running "make". implied by other options like --valgrind and GIT_TEST_INSTALLED. +--no-bin-wrappers:: + By default, the test suite uses the wrappers in + `../bin-wrappers/` to execute `git` and friends. With this option, + `../git` and friends are run directly. This is not recommended + in general, as the wrappers contain safeguards to ensure that no + files from an installed Git are used, but can speed up test runs + especially on platforms where running shell scripts is expensive + (most notably, Windows). + --root=:: Create "trash" directories used to store all temporary data during testing under , instead of the t/ directory. diff --git a/t/test-lib.sh b/t/test-lib.sh index 5dbd94c60e8b7f..72604ec4fb2e53 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -259,6 +259,8 @@ do test -z "$HARNESS_ACTIVE" && quiet=t; shift ;; --with-dashes) with_dashes=t; shift ;; + --no-bin-wrappers) + no_bin_wrappers=t; shift ;; --no-color) color=; shift ;; --va|--val|--valg|--valgr|--valgri|--valgrin|--valgrind) @@ -1069,16 +1071,21 @@ then PATH=$GIT_TEST_INSTALLED$PATH_SEP$GIT_BUILD_DIR/t/helper$PATH_SEP$PATH GIT_EXEC_PATH=${GIT_TEST_EXEC_PATH:-$GIT_EXEC_PATH} else # normal case, use ../bin-wrappers only unless $with_dashes: - git_bin_dir="$GIT_BUILD_DIR/bin-wrappers" - if ! test -x "$git_bin_dir/git" + if test -n "$no_bin_wrappers" then - if test -z "$with_dashes" + with_dashes=t + else + git_bin_dir="$GIT_BUILD_DIR/bin-wrappers" + if ! test -x "$git_bin_dir/git" then - say "$git_bin_dir/git is not executable; using GIT_EXEC_PATH" + if test -z "$with_dashes" + then + say "$git_bin_dir/git is not executable; using GIT_EXEC_PATH" + fi + with_dashes=t fi - with_dashes=t + PATH="$git_bin_dir$PATH_SEP$PATH" fi - PATH="$git_bin_dir$PATH_SEP$PATH" GIT_EXEC_PATH=$GIT_BUILD_DIR if test -n "$with_dashes" then From 4e38cef583586a4e9b6efe3cd013a1cf18d024fb Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Wed, 24 Oct 2018 18:43:09 +0200 Subject: [PATCH 8/8] fixup! ci(mingw): speed up, by side-stepping bin-wrappers/ Signed-off-by: Johannes Schindelin --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a54601ad440a27..014643655376d8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -58,7 +58,7 @@ phases: . ci/lib.sh make -j10 DEVELOPER=1 NO_PERL=1 || exit 1 - NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--no-chain-lint --with-dashes --quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || { + NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"--no-chain-lint --no-bin-wrappers --quiet --write-junit-xml\" time make -j15 -k DEVELOPER=1 test || { NO_PERL=1 NO_SVN_TESTS=1 GIT_TEST_OPTS=\"-i -v -x\" make -k -C t failed; exit 1 }