Skip to content

Commit f5cb523

Browse files
authored
fix underlying problem (#516)
1 parent 8e3b6a9 commit f5cb523

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

collect_executables.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
"""Get the link to download Fx or Geckodriver, for any supported platform.
22
Use -g to get geckodriver, otherwise you will get Fx. Use -n to just get the Fx version number.
33
Set env var FX_CHANNEL to get non-beta, blank string for Release.
4-
Set env var FX_LOCALE to get a different locale build."""
4+
Set env var FX_LOCALE to get a different locale build.
5+
Set env var FX_PLATFORM to get a platform other than current system."""
56

7+
import logging
68
from os import environ
79
from platform import uname
810
from sys import argv, exit
911
from time import sleep
1012

1113
import requests
12-
import logging
1314
from bs4 import BeautifulSoup
1415

1516
GECKO_API_URL = "https://api.github.com/repos/mozilla/geckodriver/releases/latest"
@@ -19,13 +20,14 @@
1920

2021
def get_fx_platform():
2122
u = uname()
22-
if u.system == "Darwin":
23+
_system = environ.get("FX_PLATFORM") or u.system
24+
if _system == "Darwin":
2325
return "mac"
24-
if u.system == "Linux":
26+
if _system == "Linux":
2527
if "64" in u.machine:
2628
return "linux-x86_64"
2729
return "linux-i686"
28-
if u.system == "Windows":
30+
if _system == "Windows":
2931
if u.machine == "AMD64" and not environ.get("GITHUB_ACTIONS"):
3032
return "win64-aarch64"
3133
if "64" in u.machine:
@@ -35,25 +37,27 @@ def get_fx_platform():
3537

3638
def get_fx_executable_extension():
3739
u = uname()
38-
if u.system == "Darwin":
40+
_system = environ.get("FX_PLATFORM") or u.system
41+
if _system == "Darwin":
3942
return "dmg"
40-
if u.system == "Linux":
43+
if _system == "Linux":
4144
return "xz"
42-
if u.system == "Windows":
45+
if _system == "Windows":
4346
return "exe"
4447

4548

4649
def get_gd_platform():
4750
u = uname()
48-
if u.system == "Darwin":
51+
_system = environ.get("FX_PLATFORM") or u.system
52+
if _system == "Darwin":
4953
return "macos"
50-
if u.system == "Linux":
54+
if _system == "Linux":
5155
if u.machine == "AMD64":
5256
return "linux-aarch64"
5357
if "64" in u.machine:
5458
return "linux64"
5559
return "linux32"
56-
if u.system == "Windows":
60+
if _system == "Windows":
5761
if u.machine == "AMD64" and not environ.get("GITHUB_ACTIONS"):
5862
return "win-aarch64"
5963
if "64" in u.machine:

modules/testrail_integration.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ def reportable(platform_to_test=None):
8989
return True
9090

9191
# Find the correct test plan
92-
sys_platform = platform.system()
92+
sys_platform = platform_to_test or platform.system()
93+
if platform_to_test:
94+
os.environ["FX_PLATFORM"] = platform_to_test
9395
version = (
9496
subprocess.check_output([sys.executable, "./collect_executables.py", "-n"])
9597
.strip()

0 commit comments

Comments
 (0)