Skip to content

Commit

Permalink
fix: Making sure we skip all the pool unit tests. (#3315)
Browse files Browse the repository at this point in the history
* fix: Making sure we skip all the pool unit tests.

* chore: adding changelog file 3315.fixed.md

---------

Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
  • Loading branch information
germa89 and pyansys-ci-bot authored Jul 29, 2024
1 parent adbfa38 commit f186e30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/changelog.d/3315.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: Making sure we skip all the pool unit tests.
3 changes: 3 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,13 @@ def pytest_report_header(config, start_path, startdir):
for env_var in [
"PYMAPDL_START_INSTANCE",
"PYMAPDL_PORT",
"PYMAPDL_PORT2",
"PYMAPDL_DB_PORT",
"PYMAPDL_IP",
"PYMAPDL_IP2",
"DPF_PORT",
"DPF_START_SERVER",
"IGNORE_POOL",
]:
env_var_value = os.environ.get(env_var, None)
if env_var_value is not None:
Expand Down
8 changes: 7 additions & 1 deletion tests/test_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@
# skip entire module unless HAS_GRPC
pytestmark = requires("grpc")

# Check env var
IGNORE_POOL = os.environ.get("IGNORE_POOL", "").upper() == "TRUE"

# skipping if ON_STUDENT and ON_LOCAL because we cannot spawn that many instances.
if ON_STUDENT and ON_LOCAL:
pytest.skip(allow_module_level=True)


skip_if_ignore_pool = pytest.mark.skipif(
os.environ.get("IGNORE_POOL", "").upper() == "TRUE",
IGNORE_POOL,
reason="Ignoring Pool tests.",
)

Expand Down Expand Up @@ -140,6 +143,7 @@ def test_invalid_exec(self):
additional_switches=QUICK_LAUNCH_SWITCHES,
)

@skip_if_ignore_pool
def test_heal(self, pool):
pool_sz = len(pool)
pool_names = pool._names # copy pool names
Expand Down Expand Up @@ -362,6 +366,7 @@ def test_ip(self, monkeypatch):
assert args["ips"] == ips
assert args["ports"] == ports

@skip_if_ignore_pool
def test_next(self, pool):
# Check the instances are free
for each_instance in pool:
Expand All @@ -378,6 +383,7 @@ def test_next(self, pool):
assert not each_instance.locked
assert not each_instance._busy

@skip_if_ignore_pool
def test_next_with_returns_index(self, pool):
# Check the instances are free
for each_instance in pool:
Expand Down

0 comments on commit f186e30

Please sign in to comment.