Skip to content

Commit e8538e0

Browse files
author
Alexandre Lissy
committed
FELT: Adding basics tests for all platforms
This ensures that the produced builds at least exists, and it is able to start. Browses to about:support and about:buildconfig to make sure things are OK.
1 parent b1850f2 commit e8538e0

File tree

5 files changed

+527
-0
lines changed

5 files changed

+527
-0
lines changed

.github/workflows/enterprise.yml

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,58 @@ jobs:
7373
gcp_credentials: "${{ secrets.GCP_CREDENTIALS }}"
7474
github_runner_token: "${{ secrets.GH_RUNNER_TOKEN }}"
7575

76+
linux-test-vm:
77+
runs-on: ubuntu-24.04
78+
environment: Credentials
79+
needs: [ linux-build-opt ]
80+
outputs:
81+
instance_name: ${{ steps.create_vm.outputs.instance_name }}
82+
83+
permissions:
84+
contents: 'read'
85+
id-token: 'write'
86+
87+
steps:
88+
- uses: actions/checkout@v5
89+
with:
90+
sparse-checkout: |
91+
.github/actions/
92+
sparse-checkout-cone-mode: false
93+
94+
- id: create_vm
95+
uses: ./.github/actions/create-vm
96+
with:
97+
instance_kind: "linux-test"
98+
gcp_machine_type: "c4d-standard-2"
99+
gcp_provisioning_model: "STANDARD"
100+
extra_labels: "test,LinuxNative"
101+
gcp_credentials: "${{ secrets.GCP_CREDENTIALS }}"
102+
github_runner_token: "${{ secrets.GH_RUNNER_TOKEN }}"
103+
104+
linux-test-vm-clean:
105+
runs-on: ubuntu-24.04
106+
environment: Credentials
107+
needs: [ linux-test-vm, linux-test ]
108+
if: "always()"
109+
110+
permissions:
111+
contents: 'read'
112+
id-token: 'write'
113+
114+
steps:
115+
- uses: actions/checkout@v5
116+
with:
117+
sparse-checkout: |
118+
.github/actions/
119+
sparse-checkout-cone-mode: false
120+
121+
- id: delete_vm
122+
uses: ./.github/actions/delete-vm
123+
with:
124+
instance_name: ${{ needs.linux-test-vm.outputs.instance_name }}
125+
gcp_credentials: "${{ secrets.GCP_CREDENTIALS }}"
126+
github_runner_token: "${{ secrets.GH_RUNNER_TOKEN }}"
127+
76128
linux-build-opt:
77129
runs-on: [ self-hosted, LinuxNative, X64 ]
78130
needs: linux-build-vm
@@ -103,6 +155,46 @@ jobs:
103155
path: obj-*/dist/firefox-*.tar*
104156
compression-level: 0
105157

158+
linux-test:
159+
runs-on: [self-hosted, LinuxNative, X64]
160+
needs: [ linux-test-vm, package-tests ]
161+
162+
steps:
163+
- name: "download firefox build"
164+
uses: actions/download-artifact@v5
165+
with:
166+
name: firefox-linux-amd64
167+
168+
- name: "download enterprise tests"
169+
uses: actions/download-artifact@v5
170+
with:
171+
name: enterprise-tests
172+
173+
- name: "unpack firefox build"
174+
id: unpack
175+
run: |
176+
tar xf ./obj-*/dist/firefox-*.tar*
177+
RUNTIME_PATH=$(find . -type f -name "firefox")
178+
echo "runtime_path=$RUNTIME_PATH" >> "$GITHUB_OUTPUT"
179+
180+
- name: "install python"
181+
run: |
182+
python3 -m venv venv_tests
183+
184+
- name: "install deps"
185+
run: |
186+
curl -sSL https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-linux64.tar.gz | tar -zxf -
187+
. venv_tests/bin/activate
188+
pip3 install -r requirements.txt
189+
190+
- name: "run tests"
191+
run: |
192+
RUNTIME_VERSION=$(${{ steps.unpack.outputs.runtime_path }} --version | awk '{ print $3 }')
193+
sed -e "s/#RUNTIME_VERSION#/${RUNTIME_VERSION}/g" < expectations.json.in > expectations.json
194+
mkdir -p ./profiles/
195+
. venv_tests/bin/activate
196+
python3 test_firefox_start.py expectations.json ${{ steps.unpack.outputs.runtime_path }} $PWD/geckodriver $PWD/profiles/
197+
106198
windows-build-vm:
107199
runs-on: ubuntu-24.04
108200
environment: Credentials
@@ -152,6 +244,61 @@ jobs:
152244
gcp_credentials: "${{ secrets.GCP_CREDENTIALS }}"
153245
github_runner_token: "${{ secrets.GH_RUNNER_TOKEN }}"
154246

247+
windows-test-vm:
248+
runs-on: ubuntu-24.04
249+
environment: Credentials
250+
needs: [ windows-build-opt ]
251+
outputs:
252+
instance_name: ${{ steps.create_vm.outputs.instance_name }}
253+
254+
permissions:
255+
contents: 'read'
256+
id-token: 'write'
257+
258+
steps:
259+
- uses: actions/checkout@v5
260+
with:
261+
sparse-checkout: |
262+
.github/actions/
263+
sparse-checkout-cone-mode: false
264+
265+
- id: create_vm
266+
uses: ./.github/actions/create-vm
267+
with:
268+
instance_kind: "windows-test"
269+
gcp_machine_type: "c4d-standard-2"
270+
gcp_provisioning_model: "STANDARD"
271+
gcp_disk_size: "100"
272+
gcp_disk_source: "disk-2025-dc-v20250813-20250902102015"
273+
gcp_metadata_startup: "--metadata-from-file=windows-startup-script-ps1=./repo-checkout/.github/workflows/windows-startup.ps1"
274+
extra_labels: "test,WinNative"
275+
gcp_credentials: "${{ secrets.GCP_CREDENTIALS }}"
276+
github_runner_token: "${{ secrets.GH_RUNNER_TOKEN }}"
277+
278+
windows-test-vm-clean:
279+
runs-on: ubuntu-24.04
280+
environment: Credentials
281+
needs: [ windows-test-vm, windows-test ]
282+
if: "always()"
283+
284+
permissions:
285+
contents: 'read'
286+
id-token: 'write'
287+
288+
steps:
289+
- uses: actions/checkout@v5
290+
with:
291+
sparse-checkout: |
292+
.github/actions/
293+
sparse-checkout-cone-mode: false
294+
295+
- id: delete_vm
296+
uses: ./.github/actions/delete-vm
297+
with:
298+
instance_name: ${{ needs.windows-test-vm.outputs.instance_name }}
299+
gcp_credentials: "${{ secrets.GCP_CREDENTIALS }}"
300+
github_runner_token: "${{ secrets.GH_RUNNER_TOKEN }}"
301+
155302
windows-build-opt:
156303
runs-on: [ self-hosted, WinCross, X64 ]
157304
needs: windows-build-vm
@@ -185,6 +332,45 @@ jobs:
185332
path: obj-*/dist/firefox-*.en-US.win64.zip
186333
compression-level: 0
187334

335+
windows-test:
336+
runs-on: [self-hosted, WinNative, X64]
337+
needs: [ windows-test-vm, package-tests ]
338+
339+
steps:
340+
- name: "download firefox build"
341+
uses: actions/download-artifact@v5
342+
with:
343+
name: firefox-windows-amd64
344+
345+
- name: "download enterprise tests"
346+
uses: actions/download-artifact@v5
347+
with:
348+
name: enterprise-tests
349+
350+
- name: "unpack firefox build"
351+
id: unpack
352+
run: |
353+
C:\mozilla-build\bin\unzip.exe ./obj-*/dist/firefox-*.win64.zip
354+
355+
- name: "install python"
356+
run: |
357+
python3 -m venv venv_tests
358+
359+
- name: "install deps"
360+
run: |
361+
Invoke-WebRequest -Uri https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-win32.zip -OutFile geckodriver-v0.36.0-win32.zip
362+
C:\mozilla-build\bin\unzip.exe geckodriver-v0.36.0-win32.zip
363+
. venv_tests\Scripts\activate
364+
pip3 install -r requirements.txt
365+
366+
- name: "run tests"
367+
run: |
368+
RUNTIME_VERSION=$(./obj-*/dist/firefox --version | awk '{ print $3 }')
369+
sed -e "s/#RUNTIME_VERSION#/${RUNTIME_VERSION}/g" < expectations.json.in > expectations.json
370+
mkdir -p ./profiles/
371+
. venv_tests\Scripts\activate
372+
python3 test_firefox_start.py expectations.json ./obj-*/dist/firefox $PWD/geckodriver $PWD/profiles/
373+
188374
macOS-build-vm:
189375
runs-on: ubuntu-24.04
190376
environment: Credentials
@@ -269,3 +455,50 @@ jobs:
269455
name: firefox-macOS-aarch64
270456
path: obj-*/dist/firefox-*.dmg*
271457
compression-level: 0
458+
459+
macOS-test:
460+
runs-on: [self-hosted, MacNative, ARM64]
461+
needs: [ macOS-build-opt, package-tests ]
462+
463+
steps:
464+
- name: "download firefox build"
465+
uses: actions/download-artifact@v5
466+
with:
467+
name: firefox-macOS-aarch64
468+
469+
- name: "download enterprise tests"
470+
uses: actions/download-artifact@v5
471+
with:
472+
name: enterprise-tests
473+
474+
- name: "attach"
475+
id: attach
476+
run: |
477+
MOUNT_DIR=$(hdiutil attach ./obj-aarch64-apple-darwin/dist/firefox-144.0a1.en-US.mac.dmg | grep "/Volumes" | sed -e "s/.*\/Volumes/\/Volumes/g")
478+
ls -hal "${MOUNT_DIR}"/Firefox.app/Contents/MacOS/firefox
479+
echo "mount_dir='${MOUNT_DIR}'" >> "$GITHUB_OUTPUT"
480+
RUNTIME_PATH=$(find "${MOUNT_DIR}" -type f -name "firefox")
481+
echo "runtime_path=$RUNTIME_PATH" >> "$GITHUB_OUTPUT"
482+
483+
- name: "install python"
484+
run: |
485+
python3 -m venv venv_tests
486+
487+
- name: "install deps"
488+
run: |
489+
curl -sSL https://github.com/mozilla/geckodriver/releases/download/v0.36.0/geckodriver-v0.36.0-macos-aarch64.tar.gz | tar -xf -
490+
. venv_tests/bin/activate
491+
pip3 install -r requirements.txt
492+
493+
- name: "run tests"
494+
run: |
495+
RUNTIME_VERSION=$(${{ steps.attach.outputs.runtime_path }} --version | awk '{ print $3 }')
496+
sed -e "s/#RUNTIME_VERSION#/${RUNTIME_VERSION}/g" < expectations.json.in > expectations.json
497+
mkdir -p ./profiles/
498+
. venv_tests/bin/activate
499+
python3 test_firefox_start.py expectations.json ${{ steps.attach.outputs.runtime_path }} $PWD/geckodriver $PWD/profiles/
500+
501+
- name: "detach"
502+
if: "always()"
503+
run: |
504+
hdiutil unmount ${{ steps.attach.outputs.mount_dir }}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"test_about_support": {
3+
"version_box": "#RUNTIME_VERSION#"
4+
},
5+
"test_about_buildconfig": {
6+
"official": "--with-branding=browser/branding/official"
7+
}
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
attrs==23.1.0
2+
blessed==1.20.0
3+
certifi==2023.7.22
4+
exceptiongroup==1.1.3
5+
h11==0.14.0
6+
idna==3.4
7+
mozfile==3.0.0
8+
mozlog==8.0.0
9+
mozterm==1.0.0
10+
outcome==1.2.0
11+
pillow==11.2.1
12+
pixelmatch==0.3.0
13+
PySocks==1.7.1
14+
PyYAML==6.0.1
15+
selenium==4.12.0
16+
six==1.16.0
17+
sniffio==1.3.0
18+
sortedcontainers==2.4.0
19+
trio==0.22.2
20+
trio-websocket==0.10.4
21+
urllib3==2.0.5
22+
wcwidth==0.2.13
23+
wsproto==1.2.0

0 commit comments

Comments
 (0)