##// END OF EJS Templates
ci: add a "all" template to easily control "when" test run...
marmoute -
r49018:f6879956 stable
parent child Browse files
Show More
@@ -1,171 +1,178 b''
1 stages:
1 stages:
2 - tests
2 - tests
3 - phabricator
3 - phabricator
4
4
5 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
5 image: registry.heptapod.net/mercurial/ci-images/mercurial-core:$HG_CI_IMAGE_TAG
6
6
7 variables:
7 variables:
8 PYTHON: python
8 PYTHON: python
9 TEST_HGMODULEPOLICY: "allow"
9 TEST_HGMODULEPOLICY: "allow"
10 HG_CI_IMAGE_TAG: "latest"
10 HG_CI_IMAGE_TAG: "latest"
11 TEST_HGTESTS_ALLOW_NETIO: "0"
11 TEST_HGTESTS_ALLOW_NETIO: "0"
12
12
13 .all_template: &all
14 when: always
15
13 .runtests_template: &runtests
16 .runtests_template: &runtests
17 <<: *all
14 stage: tests
18 stage: tests
15 # The runner made a clone as root.
19 # The runner made a clone as root.
16 # We make a new clone owned by user used to run the step.
20 # We make a new clone owned by user used to run the step.
17 before_script:
21 before_script:
18 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
22 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
19 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
23 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
20 - cd /tmp/mercurial-ci/
24 - cd /tmp/mercurial-ci/
21 - ls -1 tests/test-check-*.* > /tmp/check-tests.txt
25 - ls -1 tests/test-check-*.* > /tmp/check-tests.txt
22 - black --version
26 - black --version
23 - clang-format --version
27 - clang-format --version
24 script:
28 script:
25 - echo "python used, $PYTHON"
29 - echo "python used, $PYTHON"
26 - echo "$RUNTEST_ARGS"
30 - echo "$RUNTEST_ARGS"
27 - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS
31 - HGTESTS_ALLOW_NETIO="$TEST_HGTESTS_ALLOW_NETIO" HGMODULEPOLICY="$TEST_HGMODULEPOLICY" "$PYTHON" tests/run-tests.py --color=always $RUNTEST_ARGS
28
32
29 checks-py2:
33 checks-py2:
30 <<: *runtests
34 <<: *runtests
31 variables:
35 variables:
32 RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
36 RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
33
37
34 checks-py3:
38 checks-py3:
35 <<: *runtests
39 <<: *runtests
36 variables:
40 variables:
37 RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
41 RUNTEST_ARGS: "--time --test-list /tmp/check-tests.txt"
38 PYTHON: python3
42 PYTHON: python3
39
43
40 rust-cargo-test-py2: &rust_cargo_test
44 rust-cargo-test-py2: &rust_cargo_test
45 <<: *all
41 stage: tests
46 stage: tests
42 script:
47 script:
43 - echo "python used, $PYTHON"
48 - echo "python used, $PYTHON"
44 - make rust-tests
49 - make rust-tests
45
50
46 rust-cargo-test-py3:
51 rust-cargo-test-py3:
47 stage: tests
52 stage: tests
48 <<: *rust_cargo_test
53 <<: *rust_cargo_test
49 variables:
54 variables:
50 PYTHON: python3
55 PYTHON: python3
51
56
52 phabricator-refresh:
57 phabricator-refresh:
58 <<: *all
53 stage: phabricator
59 stage: phabricator
54 variables:
60 variables:
55 DEFAULT_COMMENT: ":white_check_mark: refresh by Heptapod after a successful CI run (:octopus: :green_heart:)"
61 DEFAULT_COMMENT: ":white_check_mark: refresh by Heptapod after a successful CI run (:octopus: :green_heart:)"
56 STABLE_COMMENT: ":white_check_mark: refresh by Heptapod after a successful CI run (:octopus: :green_heart:)\n⚠ This patch is intended for stable ⚠\n{image https://media.giphy.com/media/nYI8SmmChYXK0/source.gif}"
62 STABLE_COMMENT: ":white_check_mark: refresh by Heptapod after a successful CI run (:octopus: :green_heart:)\n⚠ This patch is intended for stable ⚠\n{image https://media.giphy.com/media/nYI8SmmChYXK0/source.gif}"
57 script:
63 script:
58 - |
64 - |
59 if [ `hg branch` == "stable" ]; then
65 if [ `hg branch` == "stable" ]; then
60 ./contrib/phab-refresh-stack.sh --comment "$STABLE_COMMENT";
66 ./contrib/phab-refresh-stack.sh --comment "$STABLE_COMMENT";
61 else
67 else
62 ./contrib/phab-refresh-stack.sh --comment "$DEFAULT_COMMENT";
68 ./contrib/phab-refresh-stack.sh --comment "$DEFAULT_COMMENT";
63 fi
69 fi
64
70
65 test-py2:
71 test-py2:
66 <<: *runtests
72 <<: *runtests
67 variables:
73 variables:
68 RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
74 RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
69 TEST_HGMODULEPOLICY: "c"
75 TEST_HGMODULEPOLICY: "c"
70 TEST_HGTESTS_ALLOW_NETIO: "1"
76 TEST_HGTESTS_ALLOW_NETIO: "1"
71
77
72 test-py3:
78 test-py3:
73 <<: *runtests
79 <<: *runtests
74 variables:
80 variables:
75 RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
81 RUNTEST_ARGS: " --no-rust --blacklist /tmp/check-tests.txt"
76 PYTHON: python3
82 PYTHON: python3
77 TEST_HGMODULEPOLICY: "c"
83 TEST_HGMODULEPOLICY: "c"
78 TEST_HGTESTS_ALLOW_NETIO: "1"
84 TEST_HGTESTS_ALLOW_NETIO: "1"
79
85
80 test-py2-pure:
86 test-py2-pure:
81 <<: *runtests
87 <<: *runtests
82 variables:
88 variables:
83 RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
89 RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
84 TEST_HGMODULEPOLICY: "py"
90 TEST_HGMODULEPOLICY: "py"
85
91
86 test-py3-pure:
92 test-py3-pure:
87 <<: *runtests
93 <<: *runtests
88 variables:
94 variables:
89 RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
95 RUNTEST_ARGS: "--pure --blacklist /tmp/check-tests.txt"
90 PYTHON: python3
96 PYTHON: python3
91 TEST_HGMODULEPOLICY: "py"
97 TEST_HGMODULEPOLICY: "py"
92
98
93 test-py2-rust:
99 test-py2-rust:
94 <<: *runtests
100 <<: *runtests
95 variables:
101 variables:
96 HGWITHRUSTEXT: cpython
102 HGWITHRUSTEXT: cpython
97 RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
103 RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
98 TEST_HGMODULEPOLICY: "rust+c"
104 TEST_HGMODULEPOLICY: "rust+c"
99
105
100 test-py3-rust:
106 test-py3-rust:
101 <<: *runtests
107 <<: *runtests
102 variables:
108 variables:
103 HGWITHRUSTEXT: cpython
109 HGWITHRUSTEXT: cpython
104 RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
110 RUNTEST_ARGS: "--rust --blacklist /tmp/check-tests.txt"
105 PYTHON: python3
111 PYTHON: python3
106 TEST_HGMODULEPOLICY: "rust+c"
112 TEST_HGMODULEPOLICY: "rust+c"
107
113
108 test-py3-rhg:
114 test-py3-rhg:
109 <<: *runtests
115 <<: *runtests
110 variables:
116 variables:
111 HGWITHRUSTEXT: cpython
117 HGWITHRUSTEXT: cpython
112 RUNTEST_ARGS: "--rust --rhg --blacklist /tmp/check-tests.txt"
118 RUNTEST_ARGS: "--rust --rhg --blacklist /tmp/check-tests.txt"
113 PYTHON: python3
119 PYTHON: python3
114 TEST_HGMODULEPOLICY: "rust+c"
120 TEST_HGMODULEPOLICY: "rust+c"
115
121
116 test-py2-chg:
122 test-py2-chg:
117 <<: *runtests
123 <<: *runtests
118 variables:
124 variables:
119 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
125 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
120 TEST_HGMODULEPOLICY: "c"
126 TEST_HGMODULEPOLICY: "c"
121
127
122 test-py3-chg:
128 test-py3-chg:
123 <<: *runtests
129 <<: *runtests
124 variables:
130 variables:
125 PYTHON: python3
131 PYTHON: python3
126 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
132 RUNTEST_ARGS: "--blacklist /tmp/check-tests.txt --chg"
127 TEST_HGMODULEPOLICY: "c"
133 TEST_HGMODULEPOLICY: "c"
128
134
129 check-pytype-py3:
135 check-pytype-py3:
130 extends: .runtests_template
136 extends: .runtests_template
131 before_script:
137 before_script:
132 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
138 - hg clone . /tmp/mercurial-ci/ --noupdate --config phases.publish=no
133 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
139 - hg -R /tmp/mercurial-ci/ update `hg log --rev '.' --template '{node}'`
134 - cd /tmp/mercurial-ci/
140 - cd /tmp/mercurial-ci/
135 - make local PYTHON=$PYTHON
141 - make local PYTHON=$PYTHON
136 - $PYTHON -m pip install --user -U pytype==2021.04.15
142 - $PYTHON -m pip install --user -U pytype==2021.04.15
137 variables:
143 variables:
138 RUNTEST_ARGS: " --allow-slow-tests tests/test-check-pytype.t"
144 RUNTEST_ARGS: " --allow-slow-tests tests/test-check-pytype.t"
139 PYTHON: python3
145 PYTHON: python3
140 TEST_HGMODULEPOLICY: "c"
146 TEST_HGMODULEPOLICY: "c"
141
147
142 # `sh.exe --login` sets a couple of extra environment variables that are defined
148 # `sh.exe --login` sets a couple of extra environment variables that are defined
143 # in the MinGW shell, but switches CWD to /home/$username. The previous value
149 # in the MinGW shell, but switches CWD to /home/$username. The previous value
144 # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running
150 # is stored in OLDPWD. Of the added variables, MSYSTEM is crucial to running
145 # run-tests.py- it is needed to make run-tests.py generate a `python3` script
151 # run-tests.py- it is needed to make run-tests.py generate a `python3` script
146 # that satisfies the various shebang lines and delegates to `py -3`.
152 # that satisfies the various shebang lines and delegates to `py -3`.
147 .window_runtests_template: &windows_runtests
153 .window_runtests_template: &windows_runtests
154 <<: *all
148 stage: tests
155 stage: tests
149 before_script:
156 before_script:
150 - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > C:/Temp/check-tests.txt'
157 - C:/MinGW/msys/1.0/bin/sh.exe --login -c 'cd "$OLDPWD" && ls -1 tests/test-check-*.* > C:/Temp/check-tests.txt'
151 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
158 # TODO: find/install cvs, bzr, perforce, gpg, sqlite3
152
159
153 script:
160 script:
154 - echo "Entering script section"
161 - echo "Entering script section"
155 - echo "python used, $Env:PYTHON"
162 - echo "python used, $Env:PYTHON"
156 - Invoke-Expression "$Env:PYTHON -V"
163 - Invoke-Expression "$Env:PYTHON -V"
157 - Invoke-Expression "$Env:PYTHON -m black --version"
164 - Invoke-Expression "$Env:PYTHON -m black --version"
158 - echo "$Env:RUNTEST_ARGS"
165 - echo "$Env:RUNTEST_ARGS"
159 - echo "$Env:TMP"
166 - echo "$Env:TMP"
160 - echo "$Env:TEMP"
167 - echo "$Env:TEMP"
161
168
162 - 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'
169 - 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'
163
170
164 windows-py3:
171 windows-py3:
165 <<: *windows_runtests
172 <<: *windows_runtests
166 tags:
173 tags:
167 - windows
174 - windows
168 variables:
175 variables:
169 TEST_HGMODULEPOLICY: "c"
176 TEST_HGMODULEPOLICY: "c"
170 RUNTEST_ARGS: "--blacklist C:/Temp/check-tests.txt"
177 RUNTEST_ARGS: "--blacklist C:/Temp/check-tests.txt"
171 PYTHON: py -3
178 PYTHON: py -3
General Comments 0
You need to be logged in to leave comments. Login now