Skip to content

Commit 32d12ce

Browse files
sakrutclaude
andcommitted
fix: make CliCommandTests configuration-aware for CI builds
The tests were hard-coded to look for the CLI DLL in bin/Debug/, but CI builds in Release mode. This caused all CLI command tests to fail in CI with "Could not execute because the specified command or file was not found." Now uses preprocessor directives to detect the build configuration and look in the correct bin directory. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4d48079 commit 32d12ce

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

AiCodeGraph.Tests/CliCommandTests.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ namespace AiCodeGraph.Tests;
66

77
public class CliCommandTests : TempDirectoryFixture
88
{
9+
#if DEBUG
10+
private const string BuildConfiguration = "Debug";
11+
#else
12+
private const string BuildConfiguration = "Release";
13+
#endif
14+
915
private static readonly string CliDll = Path.GetFullPath(
10-
Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "AiCodeGraph.Cli", "bin", "Debug", "net8.0", "AiCodeGraph.Cli.dll"));
16+
Path.Combine(AppContext.BaseDirectory, "..", "..", "..", "..", "AiCodeGraph.Cli", "bin", BuildConfiguration, "net8.0", "AiCodeGraph.Cli.dll"));
1117

1218
public CliCommandTests() : base("cli-test") { }
1319

0 commit comments

Comments
 (0)