Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test-run-wo-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,28 +66,28 @@ jobs:
FLUENT_IMAGE_TAG: v24.1.0

- name: 24.1 Unit Testing
run: make unittest-all-241
run: make unittest-all-241-no-codegen
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_START_INSTANCE: 0
FLUENT_IMAGE_TAG: v24.1.0

- name: 23.2 Unit Testing
run: make unittest-all-232
run: make unittest-all-232-no-codegen
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_START_INSTANCE: 0
FLUENT_IMAGE_TAG: v23.2.0

- name: 23.1 Unit Testing
run: make unittest-all-231
run: make unittest-all-231-no-codegen
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_START_INSTANCE: 0
FLUENT_IMAGE_TAG: v23.1.0

- name: 22.2 Unit Testing
run: make unittest-all-222
run: make unittest-all-222-no-codegen
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
PYFLUENT_START_INSTANCE: 0
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,48 @@ unittest-all-222:
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_222" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

unittest-all-222-no-codegen:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_222 and not codegen_required" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

unittest-all-231:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_231" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

unittest-all-231-no-codegen:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_231 and not codegen_required" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

unittest-all-241:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_241" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

unittest-all-241-no-codegen:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_241 and not codegen_required" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

unittest-all-232:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_232" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

unittest-all-232-no-codegen:
@sudo rm -rf /home/ansys/.local/share/ansys_fluent_core/examples/*
@echo "Running all unittests"
@pip install -r requirements/requirements_tests.txt
@python -m pytest -v -m "fluent_232 and not codegen_required" --cov=ansys.fluent --cov-report=xml:cov_xml.xml --cov-report=html --durations=0

api-codegen:
@echo "Running API codegen"
@python -m venv env
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ markers = [
"optislang: Test Optislang integration scenarios",
"dev: Tests that must be successful before PR merge, includes unmarked tests",
"nightly: Tests that run under nightly CI",
"codegen_required: Tests that requires codegen",
"fluent_222: Tests that run with Fluent 22.2",
"fluent_231: Tests that run with Fluent 23.1",
"fluent_232: Tests that run with Fluent 23.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

@pytest.mark.optislang
@pytest.mark.integration
@pytest.mark.codegen_required
def test_simple_solve(load_mixing_elbow_param_case_dat):
"""Use case 1: This optiSLang integration test performs these steps.

Expand Down Expand Up @@ -99,6 +100,7 @@ def test_simple_solve(load_mixing_elbow_param_case_dat):

@pytest.mark.optislang
@pytest.mark.integration
@pytest.mark.codegen_required
def test_generate_read_mesh(with_launching_container, mixing_elbow_geometry):
"""Use case 2: This optiSLang integration test performs these steps.

Expand Down
1 change: 1 addition & 0 deletions tests/test_cad_to_post_ftm.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@


@pytest.mark.nightly
@pytest.mark.codegen_required
def test_exhaust_system(new_fault_tolerant_workflow_session, exhaust_system_geometry):
meshing_session = new_fault_tolerant_workflow_session
workflow = meshing_session.workflow
Expand Down
1 change: 1 addition & 0 deletions tests/test_cad_to_post_wtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@


@pytest.mark.nightly
@pytest.mark.codegen_required
def test_mixing_elbow(new_watertight_workflow_session, mixing_elbow_geometry):
meshing_session = new_watertight_workflow_session
workflow = meshing_session.workflow
Expand Down
1 change: 1 addition & 0 deletions tests/test_data_model_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ def test_update_cache_internal_names_as_keys(
@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_get_cached_values_in_command_arguments(new_mesh_session):
new_mesh_session.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")
new_mesh_session.workflow.TaskObject["Import Geometry"].Arguments = dict(
Expand Down
10 changes: 10 additions & 0 deletions tests/test_datamodel_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_event_subscription(new_mesh_session):
session = new_mesh_session
session.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")
Expand Down Expand Up @@ -75,6 +76,7 @@ def test_event_subscription(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_add_on_child_created(new_mesh_session):
meshing = new_mesh_session
child_paths = []
Expand All @@ -94,6 +96,7 @@ def test_add_on_child_created(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_add_on_deleted(new_mesh_session):
meshing = new_mesh_session
meshing.workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")
Expand All @@ -109,6 +112,7 @@ def test_add_on_deleted(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_add_on_changed(new_mesh_session):
meshing = new_mesh_session
task_list = meshing.workflow.Workflow.TaskList
Expand All @@ -130,6 +134,7 @@ def test_add_on_changed(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_add_on_affected(new_mesh_session):
meshing = new_mesh_session
data = []
Expand All @@ -150,6 +155,7 @@ def test_add_on_affected(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_add_on_affected_at_type_path(new_mesh_session):
meshing = new_mesh_session
data = []
Expand All @@ -170,6 +176,7 @@ def test_add_on_affected_at_type_path(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_add_on_command_executed(new_mesh_session):
meshing = new_mesh_session
data = []
Expand Down Expand Up @@ -199,6 +206,7 @@ def disable_datamodel_cache(monkeypatch: pytest.MonkeyPatch):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_datamodel_streaming_full_diff_state(disable_datamodel_cache, new_mesh_session):
meshing = new_mesh_session
datamodel_service_se = meshing.datamodel_service_se
Expand Down Expand Up @@ -232,6 +240,7 @@ def cb(state, deleted_paths):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_datamodel_streaming_no_commands_diff_state(
disable_datamodel_cache, new_mesh_session
):
Expand Down Expand Up @@ -268,6 +277,7 @@ def cb(state, deleted_paths):

@pytest.mark.dev
@pytest.mark.fluent_232
@pytest.mark.codegen_required
def test_get_object_names_wtm(new_mesh_session):
meshing = new_mesh_session

Expand Down
1 change: 1 addition & 0 deletions tests/test_flobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ def test_accessor_methods_on_settings_object_types(load_static_mixer_case):

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_find_children_from_settings_root():
from ansys.fluent.core.solver.settings_231.setup import setup

Expand Down
11 changes: 11 additions & 0 deletions tests/test_meshing_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@


@pytest.mark.nightly
@pytest.mark.codegen_required
def test_mixing_elbow_meshing_workflow(
shared_watertight_workflow_session,
mixing_elbow_geometry,
Expand Down Expand Up @@ -121,6 +122,7 @@ def test_mixing_elbow_meshing_workflow(
meshing_session.tui.mesh.check_mesh()


@pytest.mark.codegen_required
def test_meshing_workflow_raises_exception_on_invalid_task_name(
shared_watertight_workflow,
):
Expand Down Expand Up @@ -185,6 +187,7 @@ def test_meshing_workflow_raises_exception_on_invalid_key_in_task_args_2(

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_command_args_datamodel_se(new_mesh_session):
session_new = new_mesh_session
w = session_new.workflow
Expand All @@ -197,6 +200,7 @@ def test_command_args_datamodel_se(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_command_args_including_task_object_datamodel_se(new_mesh_session):
session_new = new_mesh_session
w = session_new.workflow
Expand All @@ -210,6 +214,7 @@ def test_command_args_including_task_object_datamodel_se(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_meshing_object_commands(new_mesh_session, tmp_path=pyfluent.EXAMPLES_PATH):
session_new = new_mesh_session
file_path = os.path.join(tmp_path, "sample_py_journal.txt")
Expand All @@ -230,6 +235,7 @@ def test_meshing_object_commands(new_mesh_session, tmp_path=pyfluent.EXAMPLES_PA

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_attribute_query_list_types(new_mesh_session):
session_new = new_mesh_session
w = session_new.workflow
Expand All @@ -242,6 +248,7 @@ def test_attribute_query_list_types(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_accessors_for_argument_sub_items(new_mesh_session):
session_new = new_mesh_session

Expand Down Expand Up @@ -312,6 +319,7 @@ def test_accessors_for_argument_sub_items(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_read_only_behaviour_of_command_arguments(new_mesh_session):
session_new = new_mesh_session
w = session_new.workflow
Expand Down Expand Up @@ -343,6 +351,7 @@ def test_read_only_behaviour_of_command_arguments(new_mesh_session):

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_sample_use_of_command_arguments(new_mesh_session):
w = new_mesh_session.workflow

Expand All @@ -362,6 +371,7 @@ def test_sample_use_of_command_arguments(new_mesh_session):
assert w.task("Import Geometry").CommandArguments.LengthUnit() == "in"


@pytest.mark.codegen_required
def test_dummy_journal_data_model_methods(new_mesh_session):
session_new = new_mesh_session

Expand Down Expand Up @@ -605,6 +615,7 @@ def downstream_names(task):

@pytest.mark.dev
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_iterate_meshing_workflow_task_container(new_mesh_session):
workflow = new_mesh_session.workflow
workflow.InitializeWorkflow(WorkflowType="Watertight Geometry")
Expand Down
1 change: 1 addition & 0 deletions tests/test_meshingmode/test_meshing_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

@pytest.mark.mesh
@pytest.mark.fluent_231
@pytest.mark.codegen_required
def test_launch_pure_meshing(load_mixing_elbow_pure_meshing):
pure_meshing_session = load_mixing_elbow_pure_meshing
assert pure_meshing_session.health_check_service.is_serving
Expand Down
3 changes: 3 additions & 0 deletions tests/test_preferences.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import pytest
from util.meshing_workflow import new_mesh_session # noqa: F401
from util.solver_workflow import new_solver_session # noqa: F401


@pytest.mark.codegen_required
def test_solver_preferences(new_solver_session):
solver = new_solver_session

Expand Down Expand Up @@ -34,6 +36,7 @@ def test_solver_preferences(new_solver_session):
solver.exit()


@pytest.mark.codegen_required
def test_meshing_preferences(new_mesh_session):
meshing = new_mesh_session

Expand Down
4 changes: 4 additions & 0 deletions tests/test_pure_mesh_vs_mesh_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from ansys.fluent.core.examples import download_file


@pytest.mark.codegen_required
def test_pure_meshing_mode(load_mixing_elbow_pure_meshing):
pure_meshing_session = load_mixing_elbow_pure_meshing
# check a few dir elements
Expand All @@ -23,6 +24,7 @@ def test_pure_meshing_mode(load_mixing_elbow_pure_meshing):
pure_meshing_session.switch_to_solver()


@pytest.mark.codegen_required
def test_meshing_mode(load_mixing_elbow_meshing):
meshing_session = load_mixing_elbow_meshing
# check a few dir elements
Expand All @@ -37,6 +39,7 @@ def test_meshing_mode(load_mixing_elbow_meshing):
assert meshing_session.switch_to_solver()


@pytest.mark.codegen_required
def test_meshing_and_solver_mode_exit(load_mixing_elbow_meshing):
meshing_session = load_mixing_elbow_meshing
solver_session = meshing_session.switch_to_solver()
Expand All @@ -45,6 +48,7 @@ def test_meshing_and_solver_mode_exit(load_mixing_elbow_meshing):
solver_session.exit()


@pytest.mark.codegen_required
def test_meshing_mode_post_switching_to_solver(load_mixing_elbow_meshing):
meshing_session = load_mixing_elbow_meshing
meshing_session.switch_to_solver()
Expand Down
1 change: 1 addition & 0 deletions tests/test_solvermode/test_boundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

@pytest.mark.integration
@pytest.mark.setup
@pytest.mark.codegen_required
def test_boundaries_elbow(load_mixing_elbow_mesh):
solver_session = load_mixing_elbow_mesh
solver_session.setup.models.energy.enabled = True
Expand Down