Skip to content

test: add app test harness and fix the tests #207

Closed

Description

@uniqueg

Why?

proTES's unit tests cannot be collected (they import _create_mongo_client from FOCA and calculate_distance and exceptions that no longer exist, #168) and are not run in CI. The Celery task has no tests (#149). CI only runs integration tests against Docker Compose, which submit real tasks to public TES instances of the network, so CI depends on, and loads, production nodes. cloud-registry's test setup is the template (elixir-cloud-aai/cloud-registry#90, elixir-cloud-aai/cloud-registry#164).

How?

  1. tests/ mirroring the package, with a conftest.py app harness as in cloud-registry: test app from the config plus a test overlay, mongomock by default, a real MongoDB when MONGODB_TEST_URI is set.
  2. Rewrite the broken unit tests (fix: unit tests #168); mock py-tes for the relay to backends.
  3. Tests for the Celery task task__track_task_progress (test: unit test for tasks module #149): state updates, polling, retries, final update of logs and outputs.
  4. Regression test that the incoming task (task_original) is stored once and never changed by middlewares or later updates (Enforce immutability for incoming task document #142).
  5. CI: test job (pytest) and a job running all tests against MongoDB 7.0 (service container), as in cloud-registry; a Compose smoke test (docker compose up --wait, checks of the API) against a local fake TES instead of public nodes. Remove tests/test_integration once covered.

Acceptance criteria

  • pytest passes locally and in CI, with mongomock and with a real MongoDB.
  • No test or CI job contacts external TES instances.
  • The Celery task and the immutability of task_original are tested.

Closes #142, #149, #168.

Activity

  1. added
    priority: high
    status: blocked
    type: testing
    workload: days
    on Oct 22, 2026
  2. added
    status: in progress
    and removed
    status: blocked
    on Oct 22, 2026
  3. removed
    status: in progress
    on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: hightype: testingworkload: days

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions