Skip to content

Commit

Permalink
add romancal to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Sep 23, 2024
1 parent dfbb0af commit 4bc5276
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ jobs:
with:
envs: |
- linux: rad
test_with_romancal:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
envs: |
- linux: with_romancal
21 changes: 21 additions & 0 deletions tests/test_open.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from pathlib import Path

import asdf
Expand Down Expand Up @@ -236,3 +237,23 @@ def test_rdm_open_non_datamodel():

with pytest.raises(TypeError, match=r"Unknown datamodel type: .*"):
rdm_open(Path(__file__).parent / "data" / "not_a_datamodel.asdf")


def test_open_asn(tmp_path):
romancal = pytest.importorskip("romancal")

fn = tmp_path / "test.asn"
asn = {
"product": [
{
"members": [],
"name": "foo",
}
],
}
with open(fn, "w") as f:
json.dump(asn, f)

lib = datamodels.open(fn)

assert isinstance(lib, romancal.datamodels.ModelLibrary)
12 changes: 12 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,15 @@ deps =
build
commands =
python -m build .

[testenv:with_romancal]
allowlist_externals =
git
bash
commands_pre =
bash -c "pip freeze -q | grep 'roman_datamodels @' > {env_tmp_dir}/requirements.txt"
pip install https://github.com/spacetelescope/romancal.git
pip install -r {env_tmp_dir}/requirements.txt
pip freeze
commands =
pytest tests/test_open.py::test_open_asn

0 comments on commit 4bc5276

Please sign in to comment.