Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Making sure we skip all the pool unit tests. #3315

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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
Loading