Skip to content

Commit

Permalink
Avoid checking for alloc_specs if it is not defined (#202)
Browse files Browse the repository at this point in the history
This PR fixes some issues when `alloc_specs` is not defined (or on systems where it cannot be defined). 
It also addresses a problem with protobuf versions, which made it impossible to build SmartSim.

[ committed by @al-rigazzi ]
[ reviewed by @ben-albrecht ]
  • Loading branch information
al-rigazzi authored Jun 3, 2022
1 parent 4bd5e23 commit 4299e7d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ redis==3.5.3
redis-py-cluster==2.1.3
tqdm>=4.50.2
filelock>=3.4.2
protobuf==3.20
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def has_ext_modules(_placeholder):
"redis==3.5.3",
"tqdm>=4.50.2",
"filelock>=3.4.2",
"click==8.0.2"
"protobuf==3.20"
]

# Add SmartRedis at specific version
Expand All @@ -154,6 +154,7 @@ def has_ext_modules(_placeholder):
"pylint>=2.6.0",
"pytest>=6.0.0",
"pytest-cov>=2.10.1"
"click==8.0.2",
],
# see smartsim/_core/_install/buildenv.py for more details
"ml": versions.ml_extras_required(),
Expand Down
11 changes: 11 additions & 0 deletions tests/full_wlm/test_wlm_helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
import smartsim.wlm as wlm
from smartsim.error.errors import LauncherError, SmartSimError, SSUnsupportedError

# alloc_specs can be specified by the user when testing, but it will
# require all WLM env variables to be populated. If alloc_specs is not
# defined, the tests in this file are skipped.

def test_get_hosts(alloc_specs):
if not alloc_specs:
pytest.skip("alloc_specs not defined")
def verify_output(output):
assert isinstance(output, list)
assert all(isinstance(host, str) for host in output)
Expand All @@ -34,6 +39,8 @@ def verify_output(output):


def test_get_queue(alloc_specs):
if not alloc_specs:
pytest.skip("alloc_specs not defined")
def verify_output(output):
assert isinstance(output, str)
if "queue" in alloc_specs:
Expand All @@ -59,6 +66,8 @@ def verify_output(output):


def test_get_tasks(alloc_specs):
if not alloc_specs:
pytest.skip("alloc_specs not defined")
def verify_output(output):
assert isinstance(output, int)
if "num_tasks" in alloc_specs:
Expand Down Expand Up @@ -87,6 +96,8 @@ def verify_output(output):


def test_get_tasks_per_node(alloc_specs):
if not alloc_specs:
pytest.skip("alloc_specs not defined")
def verify_output(output):
assert isinstance(output, dict)
assert all(
Expand Down

0 comments on commit 4299e7d

Please sign in to comment.