Skip to content

Commit

Permalink
Update dragon default version to 0.10, add appropriate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ankona committed Oct 18, 2024
1 parent 4ffc569 commit 494d185
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
2 changes: 1 addition & 1 deletion smartsim/_core/_cli/scripts/dragon_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
logger = get_logger(__name__)

DEFAULT_DRAGON_REPO = "DragonHPC/dragon"
DEFAULT_DRAGON_VERSION = "0.9"
DEFAULT_DRAGON_VERSION = "0.10"
DEFAULT_DRAGON_VERSION_TAG = f"v{DEFAULT_DRAGON_VERSION}"
_GH_TOKEN = "SMARTSIM_DRAGON_TOKEN"

Expand Down
37 changes: 28 additions & 9 deletions tests/_legacy/test_dragon_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,34 @@ def test_install_package_no_wheel(test_dir: str, extraction_dir: pathlib.Path):
assert result != 0


def test_install_macos(monkeypatch: pytest.MonkeyPatch, extraction_dir: pathlib.Path):
"""Verify that installation exits cleanly if installing on unsupported platform"""
with monkeypatch.context() as ctx:
ctx.setattr(sys, "platform", "darwin")

request = DragonInstallRequest(extraction_dir)

result = install_dragon(request)
assert result == 1
@pytest.mark.parametrize(
"version, exp_result",
[
pytest.param("0.9", 2, id="0.9 DNE In Public Repo"),
pytest.param("0.91", 2, id="0.91 DNE In Public Repo"),
pytest.param("0.10", 0, id="0.10 Exists In Public Repo"),
pytest.param("0.19", 2, id="0.19 DNE In Public Repo"),
],
)
def test_install_specify_asset_version(
monkeypatch: pytest.MonkeyPatch,
extraction_dir: pathlib.Path,
version: str,
exp_result: int,
):
"""Verify that installation completes as expected when fed a variety of
version numbers that can or cannot be found on release assets of the
public dragon repository.
:param extraction_dir: file system path where the dragon package should
be downloaded and extracted
:param version: Dragon version number to attempt to install
:param exp_result: Expected return code from the call to `install_dragon`
"""
request = DragonInstallRequest(extraction_dir, version=version)

result = install_dragon(request)
assert result == exp_result


def test_create_dotenv(monkeypatch: pytest.MonkeyPatch, test_dir: str):
Expand Down

0 comments on commit 494d185

Please sign in to comment.