Skip to content

Commit

Permalink
Merge branch 'development' into better-integration-test-workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisher87 authored Sep 26, 2024
2 parents 3436f01 + b7e07bf commit 73c1b28
Show file tree
Hide file tree
Showing 25 changed files with 344 additions and 287 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,7 @@ jobs:
EARTHDATA_PASSWORD: "${{ secrets.EARTHDATA_PASSWORD }}"
NSIDC_LOGIN: "${{ secrets.EARTHDATA_PASSWORD }}"
run: |
pytest icepyx/ --verbose --cov app \
icepyx/tests/test_behind_NSIDC_API_login.py \
icepyx/tests/test_auth.py
pytest icepyx/tests/integration --verbose --cov app
- name: "Upload coverage report"
uses: "codecov/[email protected]"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ jobs:
- name: "Run tests"
run: |
pytest icepyx/ --verbose --cov app \
--ignore=icepyx/tests/test_behind_NSIDC_API_login.py \
--ignore=icepyx/tests/test_auth.py
--ignore=icepyx/tests/integration
- name: "Upload coverage report"
uses: "codecov/[email protected]"
Expand Down
226 changes: 125 additions & 101 deletions doc/source/user_guide/documentation/classes_dev_uml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
172 changes: 98 additions & 74 deletions doc/source/user_guide/documentation/classes_user_uml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
192 changes: 99 additions & 93 deletions doc/source/user_guide/documentation/packages_user_uml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions icepyx/core/APIformatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,8 +448,6 @@ def build_params(self, **kwargs) -> None:
self._fmted_keys.update({key: kwargs[key]})
except KeyError:
self._fmted_keys.update({key: kwargs["product"]})
elif key == "version":
self._fmted_keys.update({key: kwargs["version"]})
elif key in kwargs:
self._fmted_keys.update({key: kwargs[key]})
elif key in defaults:
Expand Down
11 changes: 5 additions & 6 deletions icepyx/core/granules.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,13 @@ def place_order(
status = statuslist[0]
print("Initial status of your order request at NSIDC is: ", status)

loop_root = None
# If status is already finished without going into pending/processing
if status.startswith("complete"):
loop_response = self.session.get(statusURL)
loop_root = ET.fromstring(loop_response.content)

# Continue loop while request is still processing
loop_root = None
while status == "pending" or status == "processing":
print(
"Your order status is still ",
Expand All @@ -443,11 +443,10 @@ def place_order(
continue

if not isinstance(loop_root, ET.Element):
# The typechecker determined that loop_root could be unbound at this
# point. We know for sure this shouldn't be possible, though, because
# the while loop should run once.
# See: https://github.com/microsoft/pyright/discussions/2033
raise RuntimeError("Programmer error!")
# The typechecker needs help knowing that at this point loop_root is
# set, as it can't tell that the conditionals above are supposed to be
# exhaustive.
raise icepyx.core.exceptions.ExhaustiveTypeGuardException

# Order can either complete, complete_with_errors, or fail:
# Provide complete_with_errors error message:
Expand Down
Empty file removed icepyx/tests/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
import icepyx as ipx
import icepyx.core.is2ref as is2ref

# Skip the whole module. See:
# https://docs.pytest.org/en/stable/reference/reference.html#globalvar-pytestmark
pytestmark = pytest.mark.xfail(
reason=(
"The back-end API on which these tests depend, ECS/EGI/ESI, is scheduled for"
" shutdown in late 2024. At that point, these tests will begin failing."
)
)

# Misc notes and needed tests
# test avail data and subsetting success for each input type
# (kml, shp, list of coords, bbox)
Expand Down Expand Up @@ -40,7 +49,7 @@ def session(reg):

def test_get_custom_options_output(session):
obs = is2ref._get_custom_options(session, "ATL06", "006")
with open("./icepyx/tests/ATL06v06_options.json") as exp_json:
with open("./icepyx/tests/integration/ATL06v06_options.json") as exp_json:
exp = json.load(exp_json)
assert all(keys in obs for keys in exp)
assert all(obs[key] == exp[key] for key in exp)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions icepyx/tests/test_read.py → icepyx/tests/unit/test_read.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ def test_parse_source_no_files():
( # check list input
[
"./icepyx/core/is2ref.py",
"./icepyx/tests/test_is2class_query.py",
"./icepyx/tests/unit/test_is2class_query.py",
],
sorted(
[
"./icepyx/core/is2ref.py",
"./icepyx/tests/test_is2class_query.py",
"./icepyx/tests/unit/test_is2class_query.py",
]
),
),
Expand All @@ -49,8 +49,8 @@ def test_parse_source_no_files():
sorted(
[
"./icepyx/core/is2ref.py",
"./icepyx/tests/test_is2class_query.py",
"./icepyx/tests/test_is2ref.py",
"./icepyx/tests/unit/test_is2class_query.py",
"./icepyx/tests/unit/test_is2ref.py",
]
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def test_bad_poly_inputfile_name_throws_error():

def test_bad_poly_inputfile_type_throws_error():
with pytest.raises(TypeError):
spat.Spatial(str(Path("./icepyx/tests/test_read.py").resolve()))
spat.Spatial(str(Path("./icepyx/tests/unit/test_read.py").resolve()))


########## geodataframe ##########
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 73c1b28

Please sign in to comment.