Commits:
-
67cfb4f1
by Beatriz Rizental at 2024-12-11T20:00:05+01:00
fixup! Add CI for Base Browser
Small refactor of file organization.
-
94bb2ef1
by Beatriz Rizental at 2024-12-11T20:00:06+01:00
fixup! Add CI for Tor Browser
Small refactor of file organization.
-
19a0c991
by Beatriz Rizental at 2024-12-12T05:00:14+01:00
fixup! Add CI for Tor Browser
Multi-platform startup test for nightly builds.
This commit is desktop only.
-
7dc11c34
by Beatriz Rizental at 2024-12-12T05:00:15+01:00
fixup! Add CI for Tor Browser
Disable Windows and MacOS startup tests.
These can only be enabled once we have Windows and MacOS
runners available.
Relates to: https://gitlab.torproject.org/tpo/tpa/team/-/issues/41829
11 changed files:
Changes:
.gitlab-ci.yml
|
1
|
1
|
stages:
|
|
2
|
2
|
- update-container-images
|
|
3
|
3
|
- lint
|
|
|
4
|
+ - startup-test
|
|
4
|
5
|
- update-translations
|
|
5
|
6
|
|
|
6
|
7
|
variables:
|
| ... |
... |
@@ -8,6 +9,8 @@ variables: |
|
8
|
9
|
LOCAL_REPO_PATH: /srv/apps-repos/tor-browser.git
|
|
9
|
10
|
|
|
10
|
11
|
include:
|
|
11
|
|
- - local: '.gitlab/ci/lint.yml'
|
|
12
|
|
- - local: '.gitlab/ci/update-containers.yml'
|
|
13
|
|
- - local: '.gitlab/ci/update-translations.yml' |
|
|
12
|
+ - local: '.gitlab/ci/mixins.yml'
|
|
|
13
|
+ - local: '.gitlab/ci/jobs/lint/lint.yml'
|
|
|
14
|
+ - local: '.gitlab/ci/jobs/startup-test/startup-test.yml'
|
|
|
15
|
+ - local: '.gitlab/ci/jobs/update-containers.yml'
|
|
|
16
|
+ - local: '.gitlab/ci/jobs/update-translations.yml' |
.gitlab/ci/scripts/helpers.py
→
.gitlab/ci/jobs/lint/helpers.py
.gitlab/ci/lint.yml
→
.gitlab/ci/jobs/lint/lint.yml
|
1
|
1
|
.base:
|
|
|
2
|
+ extends: .with-local-repo-bash
|
|
2
|
3
|
stage: lint
|
|
3
|
4
|
image: $IMAGE_PATH
|
|
4
|
5
|
interruptible: true
|
|
5
|
6
|
variables:
|
|
6
|
7
|
MOZBUILD_STATE_PATH: "$CI_PROJECT_DIR/.cache/mozbuild"
|
|
7
|
|
- # A copy of the repository already is available in the runner.
|
|
8
|
|
- GIT_STRATEGY: "none"
|
|
9
|
8
|
cache:
|
|
10
|
9
|
paths:
|
|
11
|
10
|
- node_modules
|
| ... |
... |
@@ -17,24 +16,11 @@ |
|
17
|
16
|
tags:
|
|
18
|
17
|
# Run these jobs in the browser dedicated runners.
|
|
19
|
18
|
- firefox
|
|
20
|
|
- before_script:
|
|
21
|
|
- - git init
|
|
22
|
|
- - git remote add local "$LOCAL_REPO_PATH"
|
|
23
|
|
- - git fetch --depth 500 local
|
|
24
|
|
- - git remote add origin "$CI_REPOSITORY_URL"
|
|
25
|
|
- - |
|
|
26
|
|
- if [ -z "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]; then
|
|
27
|
|
- echo "No branch specified. Stopping the pipeline."
|
|
28
|
|
- exit 1
|
|
29
|
|
- fi
|
|
30
|
|
- - echo "Fetching from remote branch ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
|
|
31
|
|
- - git fetch origin "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
|
|
32
|
|
- - git checkout origin/${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
|
|
33
|
19
|
|
|
34
|
20
|
eslint:
|
|
35
|
21
|
extends: .base
|
|
36
|
22
|
script:
|
|
37
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l eslint
|
|
|
23
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l eslint
|
|
38
|
24
|
rules:
|
|
39
|
25
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
40
|
26
|
changes:
|
| ... |
... |
@@ -63,7 +49,7 @@ eslint: |
|
63
|
49
|
stylelint:
|
|
64
|
50
|
extends: .base
|
|
65
|
51
|
script:
|
|
66
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l stylelint
|
|
|
52
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l stylelint
|
|
67
|
53
|
rules:
|
|
68
|
54
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
69
|
55
|
changes:
|
| ... |
... |
@@ -81,7 +67,7 @@ stylelint: |
|
81
|
67
|
py-black:
|
|
82
|
68
|
extends: .base
|
|
83
|
69
|
script:
|
|
84
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l black
|
|
|
70
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l black
|
|
85
|
71
|
rules:
|
|
86
|
72
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
87
|
73
|
changes:
|
| ... |
... |
@@ -100,7 +86,7 @@ py-black: |
|
100
|
86
|
py-ruff:
|
|
101
|
87
|
extends: .base
|
|
102
|
88
|
script:
|
|
103
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l ruff
|
|
|
89
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l ruff
|
|
104
|
90
|
rules:
|
|
105
|
91
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
106
|
92
|
changes:
|
| ... |
... |
@@ -119,7 +105,7 @@ py-ruff: |
|
119
|
105
|
yaml:
|
|
120
|
106
|
extends: .base
|
|
121
|
107
|
script:
|
|
122
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l yaml
|
|
|
108
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l yaml
|
|
123
|
109
|
rules:
|
|
124
|
110
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
125
|
111
|
changes:
|
| ... |
... |
@@ -134,7 +120,7 @@ yaml: |
|
134
|
120
|
shellcheck:
|
|
135
|
121
|
extends: .base
|
|
136
|
122
|
script:
|
|
137
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l shellcheck
|
|
|
123
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l shellcheck
|
|
138
|
124
|
rules:
|
|
139
|
125
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
140
|
126
|
changes:
|
| ... |
... |
@@ -149,7 +135,7 @@ clang-format: |
|
149
|
135
|
extends: .base
|
|
150
|
136
|
script:
|
|
151
|
137
|
- ./mach configure --without-wasm-sandboxed-libraries --with-base-browser-version=0.0.0
|
|
152
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l clang-format
|
|
|
138
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l clang-format
|
|
153
|
139
|
rules:
|
|
154
|
140
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
155
|
141
|
changes:
|
| ... |
... |
@@ -168,7 +154,7 @@ clang-format: |
|
168
|
154
|
rustfmt:
|
|
169
|
155
|
extends: .base
|
|
170
|
156
|
script:
|
|
171
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l rustfmt
|
|
|
157
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l rustfmt
|
|
172
|
158
|
rules:
|
|
173
|
159
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
174
|
160
|
changes:
|
| ... |
... |
@@ -182,7 +168,7 @@ rustfmt: |
|
182
|
168
|
fluent-lint:
|
|
183
|
169
|
extends: .base
|
|
184
|
170
|
script:
|
|
185
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l fluent-lint
|
|
|
171
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l fluent-lint
|
|
186
|
172
|
rules:
|
|
187
|
173
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
188
|
174
|
changes:
|
| ... |
... |
@@ -197,7 +183,7 @@ fluent-lint: |
|
197
|
183
|
localization:
|
|
198
|
184
|
extends: .base
|
|
199
|
185
|
script:
|
|
200
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l l10n
|
|
|
186
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l l10n
|
|
201
|
187
|
rules:
|
|
202
|
188
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
203
|
189
|
changes:
|
| ... |
... |
@@ -214,7 +200,7 @@ localization: |
|
214
|
200
|
mingw-capitalization:
|
|
215
|
201
|
extends: .base
|
|
216
|
202
|
script:
|
|
217
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mingw-capitalization
|
|
|
203
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mingw-capitalization
|
|
218
|
204
|
rules:
|
|
219
|
205
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
220
|
206
|
changes:
|
| ... |
... |
@@ -231,7 +217,7 @@ mingw-capitalization: |
|
231
|
217
|
mscom-init:
|
|
232
|
218
|
extends: .base
|
|
233
|
219
|
script:
|
|
234
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mscom-init
|
|
|
220
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l mscom-init
|
|
235
|
221
|
rules:
|
|
236
|
222
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
237
|
223
|
changes:
|
| ... |
... |
@@ -248,7 +234,7 @@ mscom-init: |
|
248
|
234
|
file-whitespace:
|
|
249
|
235
|
extends: .base
|
|
250
|
236
|
script:
|
|
251
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l file-whitespace
|
|
|
237
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l file-whitespace
|
|
252
|
238
|
rules:
|
|
253
|
239
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
254
|
240
|
changes:
|
| ... |
... |
@@ -278,7 +264,7 @@ file-whitespace: |
|
278
|
264
|
test-manifest:
|
|
279
|
265
|
extends: .base
|
|
280
|
266
|
script:
|
|
281
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if
|
|
|
267
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l test-manifest-alpha -l test-manifest-disable -l test-manifest-skip-if
|
|
282
|
268
|
rules:
|
|
283
|
269
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
284
|
270
|
changes:
|
| ... |
... |
@@ -293,7 +279,7 @@ test-manifest: |
|
293
|
279
|
trojan-source:
|
|
294
|
280
|
extends: .base
|
|
295
|
281
|
script:
|
|
296
|
|
- - .gitlab/ci/scripts/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l trojan-source
|
|
|
282
|
+ - .gitlab/ci/jobs/lint/helpers.py --get-changed-files | xargs -d '\n' ./mach lint -l trojan-source
|
|
297
|
283
|
rules:
|
|
298
|
284
|
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
|
|
299
|
285
|
changes:
|
.gitlab/ci/jobs/startup-test/startup-test.py
|
|
1
|
+#!/usr/bin/env python3
|
|
|
2
|
+
|
|
|
3
|
+import argparse
|
|
|
4
|
+import subprocess
|
|
|
5
|
+from datetime import datetime, timedelta
|
|
|
6
|
+
|
|
|
7
|
+PLATFORM_TO_ARCH = {
|
|
|
8
|
+ "linux": ["x86_64", "i686"],
|
|
|
9
|
+ "macos": ["x86_64", "aarch64"],
|
|
|
10
|
+ "windows": ["x86_64", "i686"],
|
|
|
11
|
+}
|
|
|
12
|
+
|
|
|
13
|
+
|
|
|
14
|
+class DynamicArchAction(argparse.Action):
|
|
|
15
|
+ def __call__(self, parser, namespace, values, option_string=None):
|
|
|
16
|
+ platform = getattr(namespace, "platform", None)
|
|
|
17
|
+ if not platform:
|
|
|
18
|
+ raise argparse.ArgumentError(
|
|
|
19
|
+ self, "The --platform argument must be provided before --arch."
|
|
|
20
|
+ )
|
|
|
21
|
+
|
|
|
22
|
+ valid_archs = PLATFORM_TO_ARCH.get(platform, [])
|
|
|
23
|
+ if values not in valid_archs:
|
|
|
24
|
+ raise argparse.ArgumentError(
|
|
|
25
|
+ self,
|
|
|
26
|
+ f"Invalid architecture '{values}' for platform '{platform}'. "
|
|
|
27
|
+ f"Valid options are: {', '.join(valid_archs)}",
|
|
|
28
|
+ )
|
|
|
29
|
+ setattr(namespace, self.dest, values)
|
|
|
30
|
+
|
|
|
31
|
+
|
|
|
32
|
+parser = argparse.ArgumentParser(
|
|
|
33
|
+ description="Downloads and executes yesterday's build of Tor or Mullvad browser nightly."
|
|
|
34
|
+)
|
|
|
35
|
+
|
|
|
36
|
+parser.add_argument(
|
|
|
37
|
+ "--platform",
|
|
|
38
|
+ required=True,
|
|
|
39
|
+ help="Specify the platform (linux, macos or windows). Must be provided before --arch.",
|
|
|
40
|
+ choices=PLATFORM_TO_ARCH.keys(),
|
|
|
41
|
+)
|
|
|
42
|
+parser.add_argument(
|
|
|
43
|
+ "--arch",
|
|
|
44
|
+ required=True,
|
|
|
45
|
+ help="Specify the architecture (validated dynamically based on --platform).",
|
|
|
46
|
+ action=DynamicArchAction,
|
|
|
47
|
+)
|
|
|
48
|
+parser.add_argument(
|
|
|
49
|
+ "--browser",
|
|
|
50
|
+ required=True,
|
|
|
51
|
+ choices=["tor", "mullvad"],
|
|
|
52
|
+ help="Specify the browser (tor or mullvad)",
|
|
|
53
|
+)
|
|
|
54
|
+
|
|
|
55
|
+args = parser.parse_args()
|
|
|
56
|
+arch = f"-{args.arch}"
|
|
|
57
|
+extra = ""
|
|
|
58
|
+
|
|
|
59
|
+if args.platform == "linux":
|
|
|
60
|
+ archive_extension = "tar.xz"
|
|
|
61
|
+ binary = f"Browser/start-{args.browser}-browser"
|
|
|
62
|
+elif args.platform == "macos":
|
|
|
63
|
+ archive_extension = "dmg"
|
|
|
64
|
+ # The URL doesn't include the architecture for MacOS,
|
|
|
65
|
+ # because it's a universal build.
|
|
|
66
|
+ arch = ""
|
|
|
67
|
+ if args.browser == "tor":
|
|
|
68
|
+ binary = "Contents/MacOS/firefox"
|
|
|
69
|
+ else:
|
|
|
70
|
+ binary = "Contents/MacOS/mullvadbrowser"
|
|
|
71
|
+elif args.platform == "windows":
|
|
|
72
|
+ archive_extension = "exe"
|
|
|
73
|
+
|
|
|
74
|
+ if args.browser == "tor":
|
|
|
75
|
+ extra = "-portable"
|
|
|
76
|
+ binary = "Browser/firefox.exe"
|
|
|
77
|
+ else:
|
|
|
78
|
+ binary = "mullvadbrowser.exe"
|
|
|
79
|
+
|
|
|
80
|
+yesterday = (datetime.now() - timedelta(days=1)).strftime("%Y.%m.%d")
|
|
|
81
|
+
|
|
|
82
|
+download_url_base = (
|
|
|
83
|
+ "https://nightlies.tbb.torproject.org/nightly-builds/tor-browser-builds"
|
|
|
84
|
+)
|
|
|
85
|
+if args.browser == "tor":
|
|
|
86
|
+ download_url = f"{download_url_base}/tbb-nightly.{yesterday}/nightly-{args.platform}{arch}/{args.browser}-browser-{args.platform}{arch}{extra}-tbb-nightly.{yesterday}.{archive_extension}"
|
|
|
87
|
+else:
|
|
|
88
|
+ download_url = f"{download_url_base}/tbb-nightly.{yesterday}/mullvadbrowser-nightly-{args.platform}{arch}/{args.browser}-browser-{args.platform}{arch}-tbb-nightly.{yesterday}.{archive_extension}"
|
|
|
89
|
+
|
|
|
90
|
+subprocess.run(
|
|
|
91
|
+ [
|
|
|
92
|
+ "python3",
|
|
|
93
|
+ "testing/mozharness/scripts/does_it_crash.py",
|
|
|
94
|
+ "--run-for",
|
|
|
95
|
+ "30",
|
|
|
96
|
+ "--thing-url",
|
|
|
97
|
+ download_url,
|
|
|
98
|
+ "--thing-to-run",
|
|
|
99
|
+ binary,
|
|
|
100
|
+ ]
|
|
|
101
|
+) |
.gitlab/ci/jobs/startup-test/startup-test.yml
|
|
1
|
+# startup-test-windows:
|
|
|
2
|
+# extends: .with-local-repo-pwsh
|
|
|
3
|
+# variables:
|
|
|
4
|
+# LOCAL_REPO_PATH: "C:\\Users\\windoes\\tor-browser.git"
|
|
|
5
|
+# stage: startup-test
|
|
|
6
|
+# interruptible: true
|
|
|
7
|
+# parallel:
|
|
|
8
|
+# matrix:
|
|
|
9
|
+# - BROWSER: ["tor", "mullvad"]
|
|
|
10
|
+# tags:
|
|
|
11
|
+# - x86-win11
|
|
|
12
|
+# script:
|
|
|
13
|
+# - ./mach python testing/mozbase/setup_development.py
|
|
|
14
|
+# - ./mach python .gitlab/ci/jobs/startup-test/startup-test.py --platform windows --arch x86_64 --browser tor
|
|
|
15
|
+# rules:
|
|
|
16
|
+# - if: $CI_PIPELINE_SOURCE == "schedule"
|
|
|
17
|
+
|
|
|
18
|
+# startup-test-macos:
|
|
|
19
|
+# extends: .with-local-repo-bash
|
|
|
20
|
+# variables:
|
|
|
21
|
+# LOCAL_REPO_PATH: "/Users/gitlab-runner/tor-browser.git"
|
|
|
22
|
+# stage: startup-test
|
|
|
23
|
+# interruptible: true
|
|
|
24
|
+# parallel:
|
|
|
25
|
+# matrix:
|
|
|
26
|
+# - BROWSER: ["tor", "mullvad"]
|
|
|
27
|
+# tags:
|
|
|
28
|
+# - x86-macos
|
|
|
29
|
+# script:
|
|
|
30
|
+# - ./mach python testing/mozbase/setup_development.py
|
|
|
31
|
+# - ./mach python .gitlab/ci/jobs/startup-test/startup-test.py --platform macos --arch x86_64 --browser tor
|
|
|
32
|
+# rules:
|
|
|
33
|
+# - if: $CI_PIPELINE_SOURCE == "schedule"
|
|
|
34
|
+
|
|
|
35
|
+startup-test-linux:
|
|
|
36
|
+ extends: .with-local-repo-bash
|
|
|
37
|
+ image: $IMAGE_PATH
|
|
|
38
|
+ stage: startup-test
|
|
|
39
|
+ interruptible: true
|
|
|
40
|
+ parallel:
|
|
|
41
|
+ matrix:
|
|
|
42
|
+ - BROWSER: ["tor", "mullvad"]
|
|
|
43
|
+ tags:
|
|
|
44
|
+ - firefox
|
|
|
45
|
+ script:
|
|
|
46
|
+ - Xvfb :99 -screen 0 1400x900x24 &
|
|
|
47
|
+ - export DISPLAY=:99
|
|
|
48
|
+ - ./mach python testing/mozbase/setup_development.py
|
|
|
49
|
+ - ./mach python .gitlab/ci/jobs/startup-test/startup-test.py --platform linux --arch x86_64 --browser tor
|
|
|
50
|
+ rules:
|
|
|
51
|
+ - if: $CI_PIPELINE_SOURCE == "schedule" |
.gitlab/ci/update-containers.yml
→
.gitlab/ci/jobs/update-containers.yml
.gitlab/ci/update-translations.yml
→
.gitlab/ci/jobs/update-translations.yml
.gitlab/ci/mixins.yml
|
|
1
|
+.with-local-repo-bash:
|
|
|
2
|
+ variables:
|
|
|
3
|
+ GIT_STRATEGY: "none"
|
|
|
4
|
+ before_script:
|
|
|
5
|
+ - git init
|
|
|
6
|
+ - git remote add local "$LOCAL_REPO_PATH"
|
|
|
7
|
+ - git fetch --depth 500 local
|
|
|
8
|
+ - git remote add origin "$CI_REPOSITORY_URL"
|
|
|
9
|
+ - |
|
|
|
10
|
+ if [ -z "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}" ]; then
|
|
|
11
|
+ echo "No branch specified. Stopping the pipeline."
|
|
|
12
|
+ exit 1
|
|
|
13
|
+ fi
|
|
|
14
|
+ - echo "Fetching from remote branch ${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
|
|
|
15
|
+ - git fetch origin "${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
|
|
|
16
|
+ - git checkout origin/${CI_COMMIT_BRANCH:-$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}
|
|
|
17
|
+
|
|
|
18
|
+.with-local-repo-pwsh:
|
|
|
19
|
+ variables:
|
|
|
20
|
+ GIT_STRATEGY: "none"
|
|
|
21
|
+ before_script:
|
|
|
22
|
+ - git init
|
|
|
23
|
+ - git remote add local $env:LOCAL_REPO_PATH
|
|
|
24
|
+ - git fetch --depth 500 local
|
|
|
25
|
+ - git remote add origin $env:CI_REPOSITORY_URL
|
|
|
26
|
+ - |
|
|
|
27
|
+ $branchName = $env:CI_COMMIT_BRANCH
|
|
|
28
|
+ if ([string]::IsNullOrEmpty($branchName)) {
|
|
|
29
|
+ $branchName = $env:CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
|
|
|
30
|
+ }
|
|
|
31
|
+ if ([string]::IsNullOrEmpty($branchName)) {
|
|
|
32
|
+ Write-Output "No branch specified. Stopping the pipeline."
|
|
|
33
|
+ exit 1
|
|
|
34
|
+ }
|
|
|
35
|
+ - Write-Output "Fetching from remote branch $branchName"
|
|
|
36
|
+ - git fetch origin $branchName
|
|
|
37
|
+ - git checkout origin/$branchName |
testing/mozbase/mozinstall/mozinstall/mozinstall.py
| ... |
... |
@@ -352,7 +352,8 @@ def _install_exe(src, dest): |
|
352
|
352
|
|
|
353
|
353
|
# possibly gets around UAC in vista (still need to run as administrator)
|
|
354
|
354
|
os.environ["__compat_layer"] = "RunAsInvoker"
|
|
355
|
|
- cmd = '"%s" /extractdir=%s' % (src, os.path.realpath(dest))
|
|
|
355
|
+ cmd = '"%s" /S /D=%s' % (src, os.path.realpath(dest))
|
|
|
356
|
+ # cmd = '"%s" /extractdir=%s' % (src, os.path.realpath(dest))
|
|
356
|
357
|
|
|
357
|
358
|
subprocess.check_call(cmd)
|
|
358
|
359
|
|
testing/mozbase/setup_development.py
| ... |
... |
@@ -267,23 +267,28 @@ def main(args=sys.argv[1:]): |
|
267
|
267
|
os.environ.get("PATH", "").strip(os.path.pathsep),
|
|
268
|
268
|
)
|
|
269
|
269
|
|
|
|
270
|
+ current_file_path = os.path.abspath(__file__)
|
|
|
271
|
+ topobjdir = os.path.dirname(os.path.dirname(os.path.dirname(current_file_path)))
|
|
|
272
|
+ mach = str(os.path.join(topobjdir, "mach"))
|
|
|
273
|
+
|
|
270
|
274
|
# install non-mozbase dependencies
|
|
271
|
275
|
# these need to be installed separately and the --no-deps flag
|
|
272
|
276
|
# subsequently used due to a bug in setuptools; see
|
|
273
|
277
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=759836
|
|
274
|
278
|
pypi_deps = dict([(i, j) for i, j in alldeps.items() if i not in unrolled])
|
|
275
|
279
|
for package, version in pypi_deps.items():
|
|
276
|
|
- # easy_install should be available since we rely on setuptools
|
|
277
|
|
- call(["easy_install", version])
|
|
|
280
|
+ # Originally, Mozilla used easy_install here.
|
|
|
281
|
+ # That tool is deprecated, therefore we swich to pip.
|
|
|
282
|
+ call([sys.executable, mach, "python", "-m", "pip", "install", version])
|
|
278
|
283
|
|
|
279
|
284
|
# install packages required for unit testing
|
|
280
|
285
|
for package in test_packages:
|
|
281
|
|
- call(["easy_install", package])
|
|
|
286
|
+ call([sys.executable, mach, "python", "-m", "pip", "install", package])
|
|
282
|
287
|
|
|
283
|
288
|
# install extra non-mozbase packages if desired
|
|
284
|
289
|
if options.extra:
|
|
285
|
290
|
for package in extra_packages:
|
|
286
|
|
- call(["easy_install", package])
|
|
|
291
|
+ call([sys.executable, mach, "python", "-m", "pip", "install", package])
|
|
287
|
292
|
|
|
288
|
293
|
|
|
289
|
294
|
if __name__ == "__main__":
|
testing/mozharness/scripts/does_it_crash.py
| ... |
... |
@@ -112,6 +112,13 @@ class DoesItCrash(BaseScript): |
|
112
|
112
|
for retry in range(3):
|
|
113
|
113
|
if is_win:
|
|
114
|
114
|
proc.send_signal(signal.CTRL_BREAK_EVENT)
|
|
|
115
|
+
|
|
|
116
|
+ # Manually kill all processes we spawned,
|
|
|
117
|
+ # not sure why this is required, but without it we hang forever.
|
|
|
118
|
+ process_name = self.config["thing_to_run"].split("/")[-1]
|
|
|
119
|
+ subprocess.run(
|
|
|
120
|
+ ["taskkill", "/T", "/F", "/IM", process_name], check=True
|
|
|
121
|
+ )
|
|
115
|
122
|
else:
|
|
116
|
123
|
os.killpg(proc.pid, signal.SIGKILL)
|
|
117
|
124
|
try:
|
|