contrib/heptapod-ci.yml
author Manuel Jacob <me@manueljacob.de>
Tue, 30 Jun 2020 07:23:29 +0200
branchstable
changeset 45027 0ea9c86fac89
parent 44577 f8427841c8fc
child 44936 aa568b6c6a10
permissions -rw-r--r--
convert: handle percent-encoded bytes in file URLs like Subversion 75b59d221aa3 added most of the code that gets removed by this patch. It helped making progress on Python 3, but the reasoning was wrong in many ways. I tried to retract it while it was queued, but it was too late. Back then, I was asssuming that what happened on Python 2 (preserving bytes) is correct and my Python 3 change is a hack. However it turned out that Subversion interprets percent-encoded bytes as UTF-8. Accepting the same format as Subversion is a good idea. Consistency with urlreq.pathname2url() (as described in the removed comment) doesn’t matter because that function is only used for passing paths to urllib. This is not a backwards-incompatible change because before 5c0d5b48e58c, non-ASCII filenames didn’t work at all on Python 2. When the locale encoding is ISO-8859-15, `svn` accepts `file:///tmp/a%E2%82%AC` for `/tmp/a€`. Before this patch, this was the case for this extension on Python 3, but not on Python 2. This patch makes it work like with `svn` on both Python 2 and Python 3.

image: octobus/ci-mercurial-core

# The runner made a clone as root.
# We make a new clone owned by user used to run the step.
before_script:
    - hg clone . /tmp/mercurial-ci/ --noupdate
    - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
    - cd /tmp/mercurial-ci/
    - ls -1 tests/test-check-*.* > /tmp/check-tests.txt

variables:
    PYTHON: python
    TEST_HGMODULEPOLICY: "allow"

.runtests_template: &runtests
    script:
        - echo "python used, $PYTHON"
        - echo "$RUNTEST_ARGS"
        - HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS

checks-py2:
    <<: *runtests
    variables:
        RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"

checks-py3:
    <<: *runtests
    variables:
        RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
        PYTHON: python3

rust-cargo-test-py2: &rust_cargo_test
    script:
        - echo "python used, $PYTHON"
        - make rust-tests

rust-cargo-test-py3:
    <<: *rust_cargo_test
    variables:
        PYTHON: python3

test-py2:
    <<: *runtests
    variables:
        RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
        TEST_HGMODULEPOLICY: "c"

test-py3:
    <<: *runtests
    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"