Skip to content

Tests do not clean up after themselves #41

@bjarketol

Description

@bjarketol

Problem

Tests in the WIFA project create output directories and files that persist after test runs, leading to:

  1. Disk space accumulation - Multiple test runs create output_pywake_4wts/, output_test_foxes/, output_test_wayve/, output_test_* directories that are never deleted
  2. Potential test interference - Leftover files from previous runs could affect subsequent test results
  3. Global state leakage - FOXES tests share a single global engine instance that only resets on errors, not on success
  4. No centralized test configuration - Missing conftest.py means no standardized fixtures or cleanup mechanisms

Current State

  • No conftest.py file exists
  • Tests create hardcoded output directories (output_pywake_4wts/, output_test_foxes/, etc.)
  • FOXES tests use a global engine variable with manual exception-based cleanup
  • No pytest fixtures for resource management
  • Output directories are in .gitignore but never actually cleaned up

Files Affected

  • tests/test_foxes.py - Global engine state, hardcoded output path
  • tests/test_pywake.py - Hardcoded output paths
  • tests/test_cs.py - Hardcoded output paths
  • tests/test_wayve.py - Hardcoded output path

Expected Behavior

  • Tests should clean up their output directories after successful runs
  • Failed test outputs should be preserved for debugging
  • Each test should have isolated state (no global engine sharing)
  • Leftover output directories from previous runs should be cleaned at session start

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