Skip to content

Commit 8e0e64f

Browse files
authored
Merge pull request #1016 from pariterre/timing_ci
be more lax on github action maximum time
2 parents b587414 + 3a662fe commit 8e0e64f

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

tests/shard3/test_global_getting_started.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import re
1010
import shutil
1111
import time
12+
import os
1213

1314
from bioptim import (
1415
InterpolationType,
@@ -2543,7 +2544,8 @@ def test_memory_and_execution_time():
25432544
# for key in ref.keys():
25442545
# print(f"{key} : [{test_memory[key][0]*10}, {test_memory[key][1]*10}, {test_memory[key][2]}]")
25452546

2547+
factor = 5 if os.getenv("GITHUB_ACTIONS") == "true" else 3
25462548
for key in ref.keys():
2547-
npt.assert_array_less(test_memory[key][0], ref[key][0] * 3)
2548-
npt.assert_array_less(test_memory[key][1], ref[key][1] * 3)
2549-
npt.assert_array_less(test_memory[key][2], ref[key][2] * 3)
2549+
npt.assert_array_less(test_memory[key][0], ref[key][0] * factor)
2550+
npt.assert_array_less(test_memory[key][1], ref[key][1] * factor)
2551+
npt.assert_array_less(test_memory[key][2], ref[key][2] * factor)

tests/shard3/test_passive_torque.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
394394
pytest.skip("These tests do not pass on Windows.")
395395

396396
if with_passive_torque:
397-
model_filename = "/examples/getting_started/models/pendulum_with_passive_torque.bioMod"
397+
model_filename = "/examples/torque_driven_ocp/models/pendulum_with_passive_torque.bioMod"
398398
else:
399399
model_filename = "/examples/getting_started/models/pendulum.bioMod"
400400

@@ -420,6 +420,9 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
420420
controls = sol.decision_controls(to_merge=SolutionMerge.NODES)
421421
q, qdot, tau = states["q"], states["qdot"], controls["tau"]
422422

423+
# Check if the solution converged
424+
assert sol.status == 0
425+
423426
if with_passive_torque:
424427
# initial and final position
425428
npt.assert_almost_equal(q[:, 0], np.array([0.0, 0.0]))
@@ -430,12 +433,12 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
430433
# initial and final controls
431434
npt.assert_almost_equal(
432435
tau[:, 0],
433-
np.array([97.717082, 0.0]),
436+
np.array([6.1617263058229215, 0.0]),
434437
decimal=6,
435438
)
436439
npt.assert_almost_equal(
437440
tau[:, -1],
438-
np.array([-37.470441, 0.0]),
441+
np.array([-11.820810710498906, 0.0]),
439442
decimal=6,
440443
)
441444

tests/shard6/test_vector_layout.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,9 +530,7 @@ def test_vector_layout_multiple_phases():
530530

531531
assert (
532532
output == expected_output
533-
), f"The output does not match what was expected.\nExpected:{
534-
expected_output
535-
}\nGot: {output}"
533+
), f"The output does not match what was expected.\nExpected:{expected_output}\nGot: {output}"
536534

537535
v_bounds = OptimizationVectorHelper.bounds_vectors(ocp)
538536

0 commit comments

Comments
 (0)