Skip to content

Commit b98939b

Browse files
authored
Run pythoninfo on Emscripten (#690)
Add also PythonInfo step and use it in factories.
1 parent 3adcdab commit b98939b

File tree

2 files changed

+37
-54
lines changed

2 files changed

+37
-54
lines changed

master/custom/factories.py

Lines changed: 31 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
LockInstall,
1919
Uninstall,
2020
UploadTestResults,
21+
PythonInfo,
2122
)
2223

2324
# This (default) timeout is for each individual test file.
@@ -138,16 +139,11 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
138139
self.addStep(Compile(command=compile,
139140
env=self.compile_environ,
140141
**oot_kwargs))
141-
self.addStep(
142-
ShellCommand(
143-
name="pythoninfo",
144-
description="pythoninfo",
145-
command=["make", "pythoninfo"],
146-
warnOnFailure=True,
147-
env=self.test_environ,
148-
**oot_kwargs
149-
)
150-
)
142+
self.addStep(PythonInfo(
143+
command=["make", "pythoninfo"],
144+
env=self.test_environ,
145+
**oot_kwargs
146+
))
151147
self.addStep(Test(
152148
command=test,
153149
timeout=step_timeout(self.test_timeout),
@@ -237,14 +233,9 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
237233
self.addStep(Compile(command=compile))
238234
self.addStep(Install(command=install))
239235
self.addStep(LockInstall())
240-
self.addStep(
241-
ShellCommand(
242-
name="pythoninfo",
243-
description="pythoninfo",
244-
command=[installed_python, "-m", "test.pythoninfo"],
245-
warnOnFailure=True,
246-
)
247-
)
236+
self.addStep(PythonInfo(
237+
command=[installed_python, "-m", "test.pythoninfo"],
238+
))
248239
self.addStep(Test(
249240
command=test,
250241
timeout=step_timeout(self.test_timeout),
@@ -618,14 +609,9 @@ def setup(self, parallel, branch, **kwargs):
618609
if parallel:
619610
test_command.append(parallel)
620611
self.addStep(Compile(command=build_command))
621-
self.addStep(
622-
ShellCommand(
623-
name="pythoninfo",
624-
description="pythoninfo",
625-
command=self.python_command + ["-m", "test.pythoninfo"],
626-
warnOnFailure=True,
627-
)
628-
)
612+
self.addStep(PythonInfo(
613+
command=self.python_command + ["-m", "test.pythoninfo"],
614+
))
629615
test_command.extend(("--timeout", str(self.test_timeout)))
630616
self.addStep(Test(
631617
command=test_command,
@@ -852,16 +838,11 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
852838
)
853839
)
854840
if self.can_execute_python:
855-
self.addStep(
856-
ShellCommand(
857-
name="pythoninfo",
858-
description="pythoninfo",
859-
command=["make", "pythoninfo"],
860-
warnOnFailure=True,
861-
env=self.test_environ,
862-
workdir=oot_host_path,
863-
)
864-
)
841+
self.addStep(PythonInfo(
842+
command=["make", "pythoninfo"],
843+
env=self.test_environ,
844+
workdir=oot_host_path,
845+
))
865846
self.addStep(Test(
866847
command=test,
867848
timeout=step_timeout(self.test_timeout),
@@ -978,15 +959,10 @@ def setup(self, parallel, branch, test_with_PTY=False, **kwargs):
978959
)
979960
)
980961

981-
self.addStep(
982-
ShellCommand(
983-
name="pythoninfo",
984-
description="pythoninfo",
985-
command=["make", "pythoninfo"],
986-
warnOnFailure=True,
987-
workdir=host_path,
988-
)
989-
)
962+
self.addStep(PythonInfo(
963+
command=["make", "pythoninfo"],
964+
workdir=host_path,
965+
))
990966

991967
# Copied from UnixBuild.
992968
testopts = list(self.testFlags)
@@ -1307,15 +1283,10 @@ def setup(self, parallel, branch, **kwargs):
13071283

13081284
self.addStep(Compile(command=compile, env=self.compile_environ))
13091285

1310-
self.addStep(
1311-
ShellCommand(
1312-
name="pythoninfo",
1313-
description="pythoninfo",
1314-
command=["make", "pythoninfo"],
1315-
warnOnFailure=True,
1316-
env=self.test_environ,
1317-
)
1318-
)
1286+
self.addStep(PythonInfo(
1287+
command=["make", "pythoninfo"],
1288+
env=self.test_environ,
1289+
))
13191290

13201291
test = [
13211292
"valgrind",
@@ -1391,6 +1362,12 @@ def setup(self, **kwargs):
13911362
command=["python3", "Platforms/emscripten", "make-host"],
13921363
env=compile_environ,
13931364
),
1365+
PythonInfo(
1366+
command=[
1367+
"python3", "Platforms/emscripten", "run", "--pythoninfo",
1368+
],
1369+
env=compile_environ,
1370+
),
13941371
Test(
13951372
name="Node full test suite",
13961373
command=[

master/custom/steps.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ def evaluateCommand(self, cmd):
128128
return result
129129

130130

131+
class PythonInfo(ShellCommand):
132+
name = "pythoninfo"
133+
description = "Display build information"
134+
warnOnFailure = True
135+
136+
131137
class Clean(ShellCommand):
132138
name = "clean"
133139
flunkOnFailure = False

0 commit comments

Comments
 (0)