Skip to content

Commit d41e7fe

Browse files
committed
MAINT, TST: lxml optional skip
* discussed a bit with Shane--this allows the test suite to pass with a few skipped tests if a user doesn't have `lxml` installed--I think the 10 extra skips aren't so bad that all value is lost with the pared down testing in this case * if you run `python -m pytest --pyargs darshan -n 10 -rsx` without and with `lxml` present on this branch you'll get these results respectively: - `463 passed, 10 skipped, 2 xfailed in 109.11s (0:01:49)` - `473 passed, 2 xfailed in 109.02s (0:01:49)` The verbose output will show a bit more detail: ``` SKIPPED [3] ../home/tyler/python_310_darshan_venv/lib/python3.10/site-packages/darshan/tests/test_summary.py:347: Test requires lxml SKIPPED [7] ../home/tyler/python_310_darshan_venv/lib/python3.10/site-packages/darshan/tests/test_summary.py:459: Test requires lxml XFAIL tests/test_report.py::test_jobid_type_all_logs_repo_files[/home/tyler/python_310_darshan_venv/lib/python3.10/site-packages/darshan_logs/e3sm_io_heatmaps_and_dxt/e3sm_io_heatmap_and_dxt.darshan] reason: large memory requirements XFAIL tests/test_summary.py::test_main_all_logs_repo_files[/home/tyler/python_310_darshan_venv/lib/python3.10/site-packages/darshan_logs/e3sm_io_heatmaps_and_dxt/e3sm_io_heatmap_and_dxt.darshan] reason: large memory requirements ``` * one of the CI matrix entries (Python `3.8` will now uninstall lxml prior to testing--making it a sort of "minimal deps" testing scenario since Python `3.8` testing currently also lacks the logs repo (on purpose))
1 parent fb6bb27 commit d41e7fe

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.github/workflows/main_ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ jobs:
6565
name: Install darshan_logs package
6666
run: |
6767
python -m pip install git+https://github.com/darshan-hpc/darshan-logs.git@main
68+
- if: ${{matrix.python-version == 3.8}}
69+
name: Use minimal deps
70+
run: |
71+
# uninstall deps that are not absolute requirements
72+
# to make sure that i.e., tests skip appropriately
73+
python -m pip uninstall -y lxml
6874
- name: Test with pytest
6975
run: |
7076
export LD_LIBRARY_PATH=$PWD/darshan_install/lib

darshan-util/pydarshan/darshan/tests/test_summary.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
from darshan.log_utils import get_log_path, _provide_logs_repo_filepaths
1515
from darshan.experimental.plots.data_access_by_filesystem import plot_with_report
1616

17+
try:
18+
import lxml
19+
has_lxml = True
20+
except ImportError:
21+
has_lxml = False
22+
1723

1824
@pytest.mark.parametrize(
1925
"argv", [
@@ -337,6 +343,9 @@ def test_header_and_footer(self, log_name, expected_header):
337343
def test_metadata_table(self, log_path, expected_df):
338344
# regression test for `summary.ReportData.get_metadata_table()`
339345

346+
if not has_lxml:
347+
pytest.skip("Test requires lxml")
348+
340349
log_path = get_log_path(log_path)
341350
# generate the report data
342351
R = summary.ReportData(log_path=log_path)
@@ -446,6 +455,9 @@ def test_metadata_table(self, log_path, expected_df):
446455
def test_module_table(self, log_path, expected_df, expected_partial_flags):
447456
# regression test for `summary.ReportData.get_module_table()`
448457

458+
if not has_lxml:
459+
pytest.skip("Test requires lxml")
460+
449461
log_path = get_log_path(log_path)
450462
# collect the report data
451463
R = summary.ReportData(log_path=log_path)

darshan-util/pydarshan/mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ ignore_missing_imports = True
3737
[mypy-mako.*]
3838
ignore_missing_imports = True
3939

40+
[mypy-lxml]
41+
ignore_missing_imports = True
42+
4043
# pydarshan modules that lack types
4144
# or currently have errors
4245

0 commit comments

Comments
 (0)