Skip to content

Failing unit tests test_filesystem.py on NCI #158

Description

@truth-quark

Some unit tests in tests/filesystem/test_filesystem.py fail by default on NCI systems.
https://github.com/GeoscienceAustralia/sar-pipeline/blob/main/tests/filesystem/test_filesystem.py

For instance:

$ pwd
/g/data/yp75/<user-id>/projects/sar-pipeline
$
$ # ensure conda env is activated
(sar-pipeline) $  pytest tests/filesystem/test_filesystem.py
# ... remove most pytest output ...
# raise NCIMissingFilePathVariableError(
#     sar_pipeline.preparation.nci.scenes.NCIMissingFilePathVariableError: Path to Aus Cop Hub API filesystem on NCI is missing. Please provide the api_scene_directory argument Or set the NCI_API_SCENE_FILE_LOCATION environment variable.

If some required environment variables are specified:

(sar-pipeline) $  NCI_FILESYSTEM_FILE_LOCATION='/g/data/fj7/Copernicus/Sentinel-1/C-SAR/' \
                  PYGSSEARCH_CONDA_ENV='pygssearch-fake' \
                  pytest tests/filesystem/test_filesystem.py
# ... trim most pytest output ...
# collected 4 items
#
# tests/filesystem/test_filesystem.py ....    <---- 4/4 tests passed

At the very least, the project docs don't prompt users to set the env vars for testing. There is also the question of tests failing in the GitHub CI system.

  • Update the docs
  • Specify default environment variables for the test environment?
  • Fail fast with a clearer error message if the environment vars are not set?
  • Is pytest skip needed to bypass the NCI filesystem unit tests on non-NCI platforms?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions