Skip to content

Commit 3767d06

Browse files
Add pytest-xdist to improve CI speed (#755)
* Fix v1 unit test * Add pytest-xdist and update CI workflow * Tune worker parameters * Revert "Tune worker parameters" This reverts commit 25287c6. * Update lock * Attempt to fix unit test * fix format --------- Co-authored-by: Ben <106089368+benflexcompute@users.noreply.github.com> Co-authored-by: benflexcompute <ben@flexcompute.com>
1 parent 54472ce commit 3767d06

File tree

5 files changed

+50
-7
lines changed

5 files changed

+50
-7
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
poetry install
4949
5050
- name: Run simulation_params tests
51-
run: poetry run pytest -rA tests/simulation -vv
52-
51+
run: poetry run pytest -n logical -rA tests/simulation -vv
5352
- name: Run flow360_params tests
54-
run: poetry run pytest -rA --ignore tests/simulation -vv
53+
run: poetry run pytest -n logical -rA --ignore tests/simulation -vv

poetry.lock

Lines changed: 39 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ numexpr = "^2.10.1"
6363
sphinxcontrib-mermaid = {version="*", optional = true}
6464
pylatex = "^1.4.2"
6565
prettyprinttree = "^2.0.1"
66+
pytest-xdist = {extras = ["psutil"], version = "^3.6.1"}
6667

6768

6869
[tool.poetry.group.dev.dependencies]

tests/simulation/params/test_automated_farfield.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
UserDefinedField,
3030
)
3131
from flow360.component.simulation.primitives import Surface
32+
from flow360.component.simulation.services import clear_context
3233
from flow360.component.simulation.simulation_params import SimulationParams
3334
from flow360.component.simulation.unit_system import SI_unit_system
3435
from flow360.component.surface_mesh_v2 import SurfaceMeshMetaV2, SurfaceMeshV2
@@ -39,6 +40,11 @@ def change_test_dir(request, monkeypatch):
3940
monkeypatch.chdir(request.fspath.dirname)
4041

4142

43+
@pytest.fixture(autouse=True)
44+
def reset_context():
45+
clear_context()
46+
47+
4248
def test_automated_farfield_surface_usage():
4349
# Test use of GhostSurface in meshing
4450
with pytest.raises(

tests/v1/test_examples.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def test_om6_release_22_3_3_0_example():
3333
def test_cylinder_example():
3434
Cylinder2D.get_files()
3535
assert os.path.exists(Cylinder2D.case_json)
36-
assert os.path.exists(OM6wing.mesh_json)
37-
assert os.path.exists(OM6wing.mesh_filename)
36+
assert os.path.exists(Cylinder2D.mesh_json)
37+
assert os.path.exists(Cylinder2D.mesh_filename)
3838

3939

4040
def test_airplane_example():

0 commit comments

Comments
 (0)