# HG changeset patch # User Anton Shestakov # Date 1590107991 -28800 # Node ID efb8ae4419b289d534f68a2fb109caffdb956f4e # Parent 995ed7aac8a6c65a700ad46ae77857a28b6f6324 ci: use a template + variables for defining tests diff -r 995ed7aac8a6 -r efb8ae4419b2 .gitlab-ci.yml --- a/.gitlab-ci.yml Sun May 24 13:43:53 2020 +0800 +++ b/.gitlab-ci.yml Fri May 22 08:39:51 2020 +0800 @@ -13,37 +13,39 @@ - pytype -P /ci/repos/mercurial/:hgext3rd -k hgext3rd -x hgext3rd/evolve/thirdparty -j $jobs || true when: manual -tests-py2-cext: - image: octobus/ci-py2-hgext3rd - script: - - hg pull -R /ci/repos/mercurial/ - - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") - - hg -R /ci/repos/mercurial/ update "$hg_rev" - - (cd tests; /ci/repos/mercurial/tests/run-tests.py --color=always) +variables: + PY: py2 + PYTHON: python + RUNTEST_ARGS: "" -tests-py2-pure: - image: octobus/ci-py2-hgext3rd +.runtests_template: &runtests + image: octobus/ci-$PY-hgext3rd script: - hg pull -R /ci/repos/mercurial/ - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") - hg -R /ci/repos/mercurial/ update "$hg_rev" - - (cd tests; /ci/repos/mercurial/tests/run-tests.py --color=always --pure) + - (cd tests; "$PYTHON" /ci/repos/mercurial/tests/run-tests.py --color=always $RUNTEST_ARGS) + +tests-py2-cext: + <<: *runtests + +tests-py2-pure: + <<: *runtests + variables: + RUNTEST_ARGS: "--pure" tests-py3-cext: - image: octobus/ci-py3-hgext3rd - script: - - hg pull -R /ci/repos/mercurial/ - - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") - - hg -R /ci/repos/mercurial/ update "$hg_rev" - - (cd tests; python3 /ci/repos/mercurial/tests/run-tests.py --color=always) + <<: *runtests + variables: + PY: py3 + PYTHON: python3 tests-py3-pure: - image: octobus/ci-py3-hgext3rd - script: - - hg pull -R /ci/repos/mercurial/ - - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") - - hg -R /ci/repos/mercurial/ update "$hg_rev" - - (cd tests; python3 /ci/repos/mercurial/tests/run-tests.py --color=always --pure) + <<: *runtests + variables: + PY: py3 + PYTHON: python3 + RUNTEST_ARGS: "--pure" doc: image: octobus/ci-py2-evolve-doc