This repository was archived by the owner on Apr 7, 2026. It is now read-only.
Description Description
Standardize temporary file creation, cleanup, and path management across all tests to prevent test artifacts and improve reliability.
Phase
Phase 0: Test Technical Debt Cleanup
Epic
Related to #202
Acceptance Criteria
Current Issues
Some tests use hardcoded temporary paths
Inconsistent cleanup of failed test artifacts
Potential file conflicts between parallel tests
Proposed Solution
public class TestFileManager : IDisposable
{
private readonly List < string > _tempPaths = new ( ) ;
public string CreateTempDirectory ( string prefix = "test" )
{
var path = Path . Combine ( Path . GetTempPath ( ) , $ "{ prefix } _{ Guid . NewGuid ( ) : N} ") ;
Directory . CreateDirectory ( path ) ;
_tempPaths . Add ( path ) ;
return path ;
}
public string CreateTempFile ( string extension = ".tmp" )
{
var path = Path . Combine ( Path . GetTempPath ( ) , $ "test_{ Guid . NewGuid ( ) : N} { extension } ") ;
_tempPaths . Add ( path ) ;
return path ;
}
public void Dispose ( )
{
foreach ( var path in _tempPaths )
{
try
{
if ( Directory . Exists ( path ) )
Directory . Delete ( path , true ) ;
else if ( File . Exists ( path ) )
File . Delete ( path ) ;
}
catch { /* Ignore cleanup failures */ }
}
}
}
Files to Review
Search for Path.GetTempPath() usage
Tests creating database files
Serialization tests
Integration tests with file I/O
Reactions are currently unavailable
Description
Standardize temporary file creation, cleanup, and path management across all tests to prevent test artifacts and improve reliability.
Phase
Phase 0: Test Technical Debt Cleanup
Epic
Related to #202
Acceptance Criteria
TestFileManagerutilityCurrent Issues
Proposed Solution
Files to Review
Path.GetTempPath()usage