Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 14 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,21 @@ on:
type: boolean

jobs:
test:
runs-on: ubuntu-24.04

steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Install dependencies
run: pip install pytest cwltool==3.1.20250110105449 cwl_utils==0.35 PyYAML pystac==1.15.2 maap-py requests
- name: Run tests
run: pytest tests

build_and_push:
needs: test

runs-on: ubuntu-latest

Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RUN pip install --no-cache-dir \
cwl_utils==0.35 \
PyYAML \
awscli \
pystac \
pystac==1.15.2 \
maap-py \
requests

Expand Down
2 changes: 1 addition & 1 deletion environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ dependencies:
- cwltool==3.1.20250110105449
- cwl_utils==0.35
- nodejs
- pystac
- pystac==1.15.2
- maap-py
13 changes: 7 additions & 6 deletions tests/test_stage_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,11 @@ def test_stac_extensions_preserved(self, mock_download, tmp_path):
parent_container = Mock()
result = _download_single_item(item_json, str(tmp_path), parent_container)

assert result.stac_extensions == [
"https://stac-extensions.github.io/eo/v1.0.0/schema.json",
"https://stac-extensions.github.io/sar/v0.9.0/schema.json"
]
# pystac may migrate extension schemas to newer versions on read,
# so check that each extension is preserved without pinning its version.
assert len(result.stac_extensions) == 2
assert any("/eo/" in ext for ext in result.stac_extensions)
assert any("/sar/" in ext for ext in result.stac_extensions)

@patch('stage_in.maap.downloadGranule')
def test_stac_extensions_empty_list_preserved(self, mock_download, tmp_path):
Expand Down Expand Up @@ -530,7 +531,7 @@ def test_links_cleared_and_self_href_reset(self, mock_download, tmp_path):

@patch('stage_in.maap.downloadGranule')
def test_self_href_set_to_local_path(self, mock_download, tmp_path):
"""Self href should be set to the resolved absolute path of <output_dir>/<item.id>."""
"""Self href should be the resolved absolute path of <output_dir>/<item.id>/<item.id>.json."""
mock_download.return_value = str(tmp_path / "test-item-meta" / "asset.tif")

item_json = {
Expand All @@ -549,7 +550,7 @@ def test_self_href_set_to_local_path(self, mock_download, tmp_path):
parent_container = Mock()
result = _download_single_item(item_json, str(tmp_path), parent_container)

expected_self_href = str((tmp_path / "test-item-meta").resolve())
expected_self_href = str((tmp_path / "test-item-meta" / "test-item-meta.json").resolve())
actual_self_href = result.get_self_href()
assert actual_self_href == expected_self_href

Expand Down