Patchwork D9726: ci: use parallel matrices

login
register
mail settings
Submitter phabricator
Date Jan. 12, 2021, 12:08 p.m.
Message ID <differential-rev-PHID-DREV-sw6sd3oce3ir4tzgs3hp-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48037/
State New
Headers show

Comments

phabricator - Jan. 12, 2021, 12:08 p.m.
danchr created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9726

AFFECTED FILES
  contrib/heptapod-ci.yml

CHANGE DETAILS




To: danchr, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/contrib/heptapod-ci.yml b/contrib/heptapod-ci.yml
--- a/contrib/heptapod-ci.yml
+++ b/contrib/heptapod-ci.yml
@@ -9,7 +9,7 @@ 
     PYTHON: python
     TEST_HGMODULEPOLICY: "allow"
 
-.runtests_template: &runtests
+.runtests_template:
     stage: tests
     # The runner made a clone as root.
     # We make a new clone owned by user used to run the step.
@@ -34,102 +34,56 @@ 
         reports:
             junit: ${CI_JOB_ID}.xml
 
-checks-py2:
-    <<: *runtests
+checks:
+    extends: .runtests_template
     variables:
         RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
+    parallel:
+        matrix:
+            - PYTHON: [python2, python3]
 
-checks-py3:
-    <<: *runtests
-    variables:
-        RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
-        PYTHON: python3
-
-rust-cargo-test-py2: &rust_cargo_test
+rust-cargo-test:
     stage: tests
     script:
         - echo "python used, $PYTHON"
         - make rust-tests
-
-rust-cargo-test-py3:
-    stage: tests
-    <<: *rust_cargo_test
-    variables:
-        PYTHON: python3
+    parallel:
+        matrix:
+            - PYTHON: [python2, python3]
+            - {PYTHON: [python3], HG_RUST_FEATURES: [dirstate-tree]}
 
 phabricator-refresh:
     stage: phabricator
     script:
       - "./contrib/phab-refresh-stack.sh --comment \":white_check_mark: refresh by Heptapod after a successful CI run (:octopus: :green_heart:)\""
 
-rust-cargo-test-py3-dirstate-tree:
-    <<: *rust_cargo_test
-    variables:
-        PYTHON: python3
-        HG_RUST_FEATURES: dirstate-tree
-
-test-py2:
-    <<: *runtests
-    variables:
-        RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
-        TEST_HGMODULEPOLICY: "c"
-
-test-py3:
-    <<: *runtests
+test:
+    extends: .runtests_template
     variables:
         RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
-        PYTHON: python3
-        TEST_HGMODULEPOLICY: "c"
-
-test-py2-pure:
-    <<: *runtests
-    variables:
-        RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
-        TEST_HGMODULEPOLICY: "py"
-
-test-py3-pure:
-    <<: *runtests
-    variables:
-        RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
-        PYTHON: python3
-        TEST_HGMODULEPOLICY: "py"
-
-test-py2-rust:
-    <<: *runtests
-    variables:
-        HGWITHRUSTEXT: cpython
-        RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
-        TEST_HGMODULEPOLICY: "rust+c"
-
-test-py3-rust:
-    <<: *runtests
-    variables:
-        HGWITHRUSTEXT: cpython
-        RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
-        PYTHON: python3
-        TEST_HGMODULEPOLICY: "rust+c"
-
-test-py3-rust-dirstate-tree:
-    <<: *runtests
-    variables:
-        HGWITHRUSTEXT: cpython
-        RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
-        PYTHON: python3
-        TEST_HGMODULEPOLICY: "rust+c"
-        HG_RUST_FEATURES: "dirstate-tree"
-
-test-py2-chg:
-    <<: *runtests
-    variables:
-        RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
-        TEST_HGMODULEPOLICY: "c"
-
-test-py3-chg:
-    <<: *runtests
-    variables:
-        PYTHON: python3
-        RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
-        TEST_HGMODULEPOLICY: "c"
+    parallel:
+        matrix:
+            - PYTHON:
+                - python2
+                - python3
+              TEST_HGMODULEPOLICY:
+                - c
+                - py
+            - PYTHON:
+                - python2
+                - python3
+              RUNTEST_ARGS:
+                - " --no-rust --blacklist /tmp/check-tests.txt --chg"
+            - PYTHON:
+                - python2
+                - python3
+              TEST_HGMODULEPOLICY:
+                - rust+c
+              HGWITHRUSTEXT:
+                - cpython
+              HG_RUST_FEATURES:
+                - dirstate-tree
+                - ""
 
 build-wheels-x86:
     stage: packages