- Implement ProofChainTestFixture for PostgreSQL-backed integration tests. - Create StellaOps.Integration.ProofChain project with necessary dependencies. - Add ReachabilityIntegrationTests to validate call graph extraction and reachability analysis. - Introduce ReachabilityTestFixture for managing corpus and fixture paths. - Establish StellaOps.Integration.Reachability project with required references. - Develop UnknownsWorkflowTests to cover the unknowns lifecycle: detection, ranking, escalation, and resolution. - Create StellaOps.Integration.Unknowns project with dependencies for unknowns workflow.
92 lines
2.9 KiB
C#
92 lines
2.9 KiB
C#
// -----------------------------------------------------------------------------
|
|
// ReachabilityTestFixture.cs
|
|
// Sprint: SPRINT_3500_0004_0003_integration_tests_corpus
|
|
// Task: T2 - Reachability Integration Tests
|
|
// Description: Test fixture for reachability integration tests
|
|
// -----------------------------------------------------------------------------
|
|
|
|
using System.Reflection;
|
|
|
|
namespace StellaOps.Integration.Reachability;
|
|
|
|
/// <summary>
|
|
/// Test fixture for reachability integration tests.
|
|
/// Provides access to corpus fixtures and test data.
|
|
/// </summary>
|
|
public sealed class ReachabilityTestFixture
|
|
{
|
|
private readonly string _corpusBasePath;
|
|
private readonly string _fixturesBasePath;
|
|
|
|
public ReachabilityTestFixture()
|
|
{
|
|
var assemblyLocation = Assembly.GetExecutingAssembly().Location;
|
|
var assemblyDirectory = Path.GetDirectoryName(assemblyLocation)!;
|
|
|
|
_corpusBasePath = Path.Combine(assemblyDirectory, "corpus");
|
|
_fixturesBasePath = Path.Combine(assemblyDirectory, "fixtures");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the path to a language-specific corpus directory.
|
|
/// </summary>
|
|
/// <param name="language">Language identifier (dotnet, java, python, etc.)</param>
|
|
/// <returns>Full path to the corpus directory</returns>
|
|
public string GetCorpusPath(string language)
|
|
{
|
|
var corpusPath = Path.Combine(_corpusBasePath, language);
|
|
|
|
if (!Directory.Exists(corpusPath))
|
|
{
|
|
throw new DirectoryNotFoundException(
|
|
$"Corpus directory not found for language '{language}' at: {corpusPath}");
|
|
}
|
|
|
|
return corpusPath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the path to a specific fixture directory.
|
|
/// </summary>
|
|
/// <param name="fixtureName">Name of the fixture</param>
|
|
/// <returns>Full path to the fixture directory</returns>
|
|
public string GetFixturePath(string fixtureName)
|
|
{
|
|
var fixturePath = Path.Combine(_fixturesBasePath, fixtureName);
|
|
|
|
if (!Directory.Exists(fixturePath))
|
|
{
|
|
throw new DirectoryNotFoundException(
|
|
$"Fixture directory not found: {fixturePath}");
|
|
}
|
|
|
|
return fixturePath;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Lists all available corpus languages.
|
|
/// </summary>
|
|
public IReadOnlyList<string> GetAvailableCorpusLanguages()
|
|
{
|
|
if (!Directory.Exists(_corpusBasePath))
|
|
{
|
|
return Array.Empty<string>();
|
|
}
|
|
|
|
return Directory.GetDirectories(_corpusBasePath)
|
|
.Select(Path.GetFileName)
|
|
.Where(name => !string.IsNullOrEmpty(name))
|
|
.Cast<string>()
|
|
.ToList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Checks if a corpus exists for the given language.
|
|
/// </summary>
|
|
public bool HasCorpus(string language)
|
|
{
|
|
var corpusPath = Path.Combine(_corpusBasePath, language);
|
|
return Directory.Exists(corpusPath);
|
|
}
|
|
}
|