Skip to content

Test Update Summary

Changes Made

1. Created Compatibility Layers

Created backward compatibility wrappers for the old phase execution API:

  • /nf/core/phased_execution.py - Provides PhaseExecutionPlan and CircularDependencyInfo wrappers
  • /nf/core/phase_models.py - Provides ExecutionPlan wrapper and re-exports from new phases module
  • /nf/core/phase_planner.py - Provides CircularDependencyPhasePlanner wrapper
  • /nf/core/phase_planner_v2.py - Provides OptimizedPhasePlanner wrapper

These wrappers ensure that tests using the old API will continue to work by translating calls to the new unified phases API.

2. API Changes Handled

The main API changes that were addressed:

  1. PhaseExecutionPlan.add_phase(description) - Now creates and returns a Phase object
  2. ExecutionPlan.add_phase(description, stack_id) - Similar but with stack_id parameter
  3. CircularDependencyInfo(cycle_path=...) - Maps old cycle_path to new cycle parameter
  4. Various phase planner methods mapped to new PhasePlanner implementation

Tests That May Need Removal/Update

1. Performance Comparison Tests (OUTDATED)

  • test_phase_optimization.py - Compares "original" vs "optimized" planners that are now both wrappers
  • test_phase_performance.py - Benchmarks that may not be meaningful with new implementation
  • test_parallel_phase_benchmarks.py - Similar performance comparisons

These tests were comparing different implementations that no longer exist. They now compare two wrappers around the same implementation.

2. Implementation-Specific Tests

  • Tests that check specific implementation details of the old phase planners
  • Tests for Tarjan's algorithm vs DFS (the new implementation may use different algorithms)
  • Cache-specific tests that rely on old caching mechanisms

3. Tests That Should Be Kept

  • test_phased_execution.py - Basic phased execution functionality
  • test_circular_dep_resolution.py - Core circular dependency handling
  • test_n_phase_circular_deps.py - Complex multi-phase scenarios
  • test_phased_resource_omission.py - Resource omission logic

Recommendations

  1. Remove purely performance comparison tests - They no longer test meaningful differences
  2. Keep functional tests - Tests that verify correct behavior should be retained
  3. Update implementation-specific tests - Rewrite to test the new implementation
  4. Add new tests - Create tests for the new unified phases API

Missing Dependencies

Note: There's a missing magic_codec dependency preventing tests from running. This needs to be resolved before tests can be executed.