From 3f07dedbb050535471671b1d8cabdd19d9b4a50b Mon Sep 17 00:00:00 2001 From: Anurag Kulshrestha Date: Wed, 31 Aug 2022 18:16:16 +0530 Subject: [PATCH 1/2] Skip unsupported tests from 22.2 runs --- tests/test_solvermode/test_controls.py | 4 +++- tests/test_solvermode/test_general.py | 4 ++++ tests/test_solvermode/test_initialization.py | 4 ++++ tests/test_solvermode/test_materials.py | 3 +++ tests/test_solvermode/test_methods.py | 3 +++ tests/test_solvermode/test_models.py | 4 ++++ tests/test_solvermode/test_named_expressions.py | 3 +++ 7 files changed, 24 insertions(+), 1 deletion(-) diff --git a/tests/test_solvermode/test_controls.py b/tests/test_solvermode/test_controls.py index 892caadb37b5..6308baf1f9b2 100644 --- a/tests/test_solvermode/test_controls.py +++ b/tests/test_solvermode/test_controls.py @@ -1,9 +1,11 @@ +import os + import pytest -@pytest.mark.integration @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_controls(load_mixing_elbow_mesh): solver = load_mixing_elbow_mesh solver.setup.models.multiphase.models = "vof" diff --git a/tests/test_solvermode/test_general.py b/tests/test_solvermode/test_general.py index c47f4b8cb237..0d90fd6f0946 100644 --- a/tests/test_solvermode/test_general.py +++ b/tests/test_solvermode/test_general.py @@ -1,8 +1,11 @@ +import os + import pytest @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_solver_import_mixingelbow(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh assert solver_session._root.get_attr("active?") @@ -44,6 +47,7 @@ def test_solver_import_mixingelbow(load_mixing_elbow_mesh): @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_disk_2d_setup(load_disk_mesh): session = load_disk_mesh assert session._root.get_attr("active?") diff --git a/tests/test_solvermode/test_initialization.py b/tests/test_solvermode/test_initialization.py index 6b0fc51c7a27..ee11c122565f 100644 --- a/tests/test_solvermode/test_initialization.py +++ b/tests/test_solvermode/test_initialization.py @@ -1,9 +1,12 @@ +import os + import pytest from util.fixture_fluent import download_input_file @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_initialize(launch_fluent_solver_3ddp_t2): solver = launch_fluent_solver_3ddp_t2 input_type, input_name = download_input_file("pyfluent/wigley_hull", "wigley.msh") @@ -56,6 +59,7 @@ def test_initialize(launch_fluent_solver_3ddp_t2): @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_fmg_initialize(launch_fluent_solver_3ddp_t2): solver = launch_fluent_solver_3ddp_t2 input_type, input_name = download_input_file( diff --git a/tests/test_solvermode/test_materials.py b/tests/test_solvermode/test_materials.py index 55d83df96659..8c12a708f0a9 100644 --- a/tests/test_solvermode/test_materials.py +++ b/tests/test_solvermode/test_materials.py @@ -1,3 +1,5 @@ +import os + import pytest from util.solver import copy_database_material @@ -5,6 +7,7 @@ @pytest.mark.integration @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_solver_material(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh copy_database_material( diff --git a/tests/test_solvermode/test_methods.py b/tests/test_solvermode/test_methods.py index f89bee4174e0..39a2651c5b2e 100644 --- a/tests/test_solvermode/test_methods.py +++ b/tests/test_solvermode/test_methods.py @@ -1,8 +1,11 @@ +import os + import pytest @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_methods(load_mixing_elbow_mesh): solver = load_mixing_elbow_mesh solver.setup.models.multiphase.models = "vof" diff --git a/tests/test_solvermode/test_models.py b/tests/test_solvermode/test_models.py index 83ae7d062dd0..881f9df3b409 100644 --- a/tests/test_solvermode/test_models.py +++ b/tests/test_solvermode/test_models.py @@ -1,9 +1,12 @@ +import os + import pytest @pytest.mark.integration @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_solver_models(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh assert not solver_session.setup.models.energy.enabled() @@ -24,6 +27,7 @@ def test_solver_models(load_mixing_elbow_mesh): @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_disk_2d_models(load_disk_mesh): solver_session = load_disk_mesh solver_session.setup.general.solver.two_dim_space = "axisymmetric" diff --git a/tests/test_solvermode/test_named_expressions.py b/tests/test_solvermode/test_named_expressions.py index a06144f36805..d0617602382d 100644 --- a/tests/test_solvermode/test_named_expressions.py +++ b/tests/test_solvermode/test_named_expressions.py @@ -1,8 +1,11 @@ +import os + import pytest @pytest.mark.quick @pytest.mark.setup +@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") def test_expression(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh solver_session.setup.models.energy.enabled = True From 16f0d41cc841a3efc176311135e1ad1e64f80df6 Mon Sep 17 00:00:00 2001 From: Anurag Kulshrestha Date: Thu, 1 Sep 2022 15:11:55 +0530 Subject: [PATCH 2/2] Updated the tests to use new skip marker instead of environment variable --- pytest.ini | 1 - tests/test_solvermode/test_controls.py | 4 +--- tests/test_solvermode/test_general.py | 6 ++---- tests/test_solvermode/test_initialization.py | 6 ++---- tests/test_solvermode/test_materials.py | 5 +---- tests/test_solvermode/test_methods.py | 4 +--- tests/test_solvermode/test_models.py | 6 ++---- tests/test_solvermode/test_named_expressions.py | 4 +--- 8 files changed, 10 insertions(+), 26 deletions(-) diff --git a/pytest.ini b/pytest.ini index d302e2eafa0d..6aa9343fedb9 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,4 @@ [pytest] -addopts = -m "dev and not fluent_231" markers = integration:Short-running tests which read a simple input file and check the exposure and values of various setting objects quick:Run the quick tests diff --git a/tests/test_solvermode/test_controls.py b/tests/test_solvermode/test_controls.py index 6308baf1f9b2..cba298c1ad84 100644 --- a/tests/test_solvermode/test_controls.py +++ b/tests/test_solvermode/test_controls.py @@ -1,11 +1,9 @@ -import os - import pytest @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_controls(load_mixing_elbow_mesh): solver = load_mixing_elbow_mesh solver.setup.models.multiphase.models = "vof" diff --git a/tests/test_solvermode/test_general.py b/tests/test_solvermode/test_general.py index 0d90fd6f0946..f705576f4553 100644 --- a/tests/test_solvermode/test_general.py +++ b/tests/test_solvermode/test_general.py @@ -1,11 +1,9 @@ -import os - import pytest @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_solver_import_mixingelbow(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh assert solver_session._root.get_attr("active?") @@ -47,7 +45,7 @@ def test_solver_import_mixingelbow(load_mixing_elbow_mesh): @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_disk_2d_setup(load_disk_mesh): session = load_disk_mesh assert session._root.get_attr("active?") diff --git a/tests/test_solvermode/test_initialization.py b/tests/test_solvermode/test_initialization.py index ee11c122565f..91c04372c511 100644 --- a/tests/test_solvermode/test_initialization.py +++ b/tests/test_solvermode/test_initialization.py @@ -1,12 +1,10 @@ -import os - import pytest from util.fixture_fluent import download_input_file @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_initialize(launch_fluent_solver_3ddp_t2): solver = launch_fluent_solver_3ddp_t2 input_type, input_name = download_input_file("pyfluent/wigley_hull", "wigley.msh") @@ -59,7 +57,7 @@ def test_initialize(launch_fluent_solver_3ddp_t2): @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_fmg_initialize(launch_fluent_solver_3ddp_t2): solver = launch_fluent_solver_3ddp_t2 input_type, input_name = download_input_file( diff --git a/tests/test_solvermode/test_materials.py b/tests/test_solvermode/test_materials.py index 8c12a708f0a9..2aa4f7da4ef3 100644 --- a/tests/test_solvermode/test_materials.py +++ b/tests/test_solvermode/test_materials.py @@ -1,13 +1,10 @@ -import os - import pytest from util.solver import copy_database_material -@pytest.mark.integration @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_solver_material(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh copy_database_material( diff --git a/tests/test_solvermode/test_methods.py b/tests/test_solvermode/test_methods.py index 39a2651c5b2e..52095472a77b 100644 --- a/tests/test_solvermode/test_methods.py +++ b/tests/test_solvermode/test_methods.py @@ -1,11 +1,9 @@ -import os - import pytest @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_methods(load_mixing_elbow_mesh): solver = load_mixing_elbow_mesh solver.setup.models.multiphase.models = "vof" diff --git a/tests/test_solvermode/test_models.py b/tests/test_solvermode/test_models.py index 881f9df3b409..78a0dac5f2a4 100644 --- a/tests/test_solvermode/test_models.py +++ b/tests/test_solvermode/test_models.py @@ -1,12 +1,10 @@ -import os - import pytest @pytest.mark.integration @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_solver_models(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh assert not solver_session.setup.models.energy.enabled() @@ -27,7 +25,7 @@ def test_solver_models(load_mixing_elbow_mesh): @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_disk_2d_models(load_disk_mesh): solver_session = load_disk_mesh solver_session.setup.general.solver.two_dim_space = "axisymmetric" diff --git a/tests/test_solvermode/test_named_expressions.py b/tests/test_solvermode/test_named_expressions.py index d0617602382d..30d267335918 100644 --- a/tests/test_solvermode/test_named_expressions.py +++ b/tests/test_solvermode/test_named_expressions.py @@ -1,11 +1,9 @@ -import os - import pytest @pytest.mark.quick @pytest.mark.setup -@pytest.mark.skipif(os.getenv("FLUENT_IMAGE_TAG") == "v22.2.0", reason="Skip on 22.2") +@pytest.mark.fluent_231 def test_expression(load_mixing_elbow_mesh): solver_session = load_mixing_elbow_mesh solver_session.setup.models.energy.enabled = True