changeset 47570:bc01b8ad6134

ci-windows: introduce manual windows CI 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. Differential Revision: https://phab.mercurial-scm.org/D11025
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 08 Jul 2021 17:13:18 +0200
parents 7a4ba68f2373
children e9c5c368be17
files contrib/heptapod-ci.yml
diffstat 1 files changed, 32 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/heptapod-ci.yml	Sun Jul 04 23:41:54 2021 +0200
+++ b/contrib/heptapod-ci.yml	Thu Jul 08 17:13:18 2021 +0200
@@ -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