Skip to content

Various problems executing tests #273

Open
@captaincoordinates

Description

@captaincoordinates

While configuring a local development environment I encountered a number of problems executing tests. I have fixes for each of these problems, PR here.

  1. poetry install fails on macOS (Apple Silicon) and Debian (AMD) with an error message citing "AttributeError: cython_sources". Fixed with poetry update --lock.
  2. poetry run python admin.py build --tests fails due to httpx dependency cgi not existing. fixed with poetry update --lock.
  3. development.md documentation does not mention that poetry run python admin.py build --tests must be executed prior to ./run-tests.sh, as the test process assumes that test files are included in the build directory. Fixed with documentation update.
  4. ./run-tests.sh returns a 0 exit code when tests fail, potentially misleading developers expecting a non-0 exit code. Fixed by returning non-0 if present.
  5. Race condition observed in test_stac_api_client_functions.py due to the Flask mock API server starting in a separate process without a mechanism to wait for the server before executing tests in the main process. Test failures were unpredictable and somewhat random. Fixed with a function that polls the mock API server before returning or raising an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions