From patchwork Thu Jul 8 15:53:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D11025: ci-windows: introduce manual windows CI From: phabricator X-Patchwork-Id: 49339 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Thu, 8 Jul 2021 15:53:23 +0000 Alphare created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Note: most of the foundational work of this commit was done by Matt Harbison, but enough has changed that I don't feel comfortable sending this patch as his. In our quest to remove Python 2 from Mercurial, we need to get Windows CI going to check that Python 3 support is up to an acceptable standard. This is the first step: adding a manual step to run a full Windows CI, with a certain definition of "full" since some things are not installed yet, like SVN. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D11025 AFFECTED FILES contrib/heptapod-ci.yml CHANGE DETAILS To: Alphare, #hg-reviewers Cc: mercurial-patches, mercurial-devel diff --git a/contrib/heptapod-ci.yml b/contrib/heptapod-ci.yml --- a/contrib/heptapod-ci.yml +++ b/contrib/heptapod-ci.yml @@ -139,3 +139,35 @@ RUNTEST_ARGS: " --allow-slow-tests tests/test-check-pytype.t" PYTHON: python3 TEST_HGMODULEPOLICY: "c" + +# `sh.exe --login` sets a couple of extra environment variables that are defined +# in the MinGW shell, but switches CWD to /home/$username. The previous value +# is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running +# run-tests.py- it is needed to make run-tests.py generate a `python3` script +# that satisfies the various shebang lines and delegates to `py -3`. +.window_runtests_template: &windows_runtests + stage: tests + before_script: + # Temporary until this is adjusted in the environment + - $Env:TEMP="C:/Temp" + - $Env:TMP="C:/Temp" + # TODO: find/install cvs, bzr, perforce, gpg, sqlite3 + + script: + - echo "Entering script section" + - echo "python used, $Env:PYTHON" + - Invoke-Expression "$Env:PYTHON -V" + - Invoke-Expression "$Env:PYTHON -m black --version" + - echo "$Env:RUNTEST_ARGS" + + - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" HGMODULEPOLICY="$TEST_HGMODULEPOLICY" $PYTHON tests/run-tests.py --color=always $RUNTEST_ARGS' + +windows-py3: + <<: *windows_runtests + when: manual + tags: + - windows + timeout: 2h + variables: + RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt" + PYTHON: py -3