Skip to content

Commit bf997c7

Browse files
committed
Stabilize CLI workflow checks across local and CI execution modes
The CLI DX work introduced end-to-end command coverage and preflight paths, but CI exposed two environment-sensitive gaps: tests assumed a Debug-only CLI binary path, and nested bridge builds were more fragile than necessary under runner process orchestration. This follow-up makes CLI tests resolve the built tool more robustly, strengthens the command coverage around manifest and preflight behavior, and keeps the bridge consistency checks observable through user-facing command output. Constraint: CI runs unit tests from Release outputs, so CLI integration tests cannot assume Debug-only binaries Constraint: Nested bridge builds must stay conservative to reduce MSBuild child-node instability on runners Rejected: Revert to helper-only coverage | would leave user-visible CLI paths under-tested Rejected: Keep `dotnet run --project` inside CLI tests | slower and less stable than executing the built tool dll directly Confidence: high Scope-risk: narrow Reversibility: clean Directive: CLI integration tests should discover the built tool by configuration rather than hardcoded output paths Directive: Keep `--preflight-only` and manifest assertions covered in both local and CI-like execution modes Tested: `dotnet test tests/Agibuild.Fulora.UnitTests/Agibuild.Fulora.UnitTests.csproj -v minimal` (2177 passed) Tested: `dotnet test tests/Agibuild.Fulora.UnitTests/Agibuild.Fulora.UnitTests.csproj --configuration Release -v minimal` (2177 passed) Not-tested: Fresh GitHub Actions result for this follow-up commit until remote CI completes Related: c2913dd
1 parent c2913dd commit bf997c7

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tests/Agibuild.Fulora.UnitTests/CliToolTests.cs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,19 @@ private static string GetCliProjectPath()
1717
private static string GetCliBinaryPath()
1818
{
1919
var repoRoot = FindRepoRoot();
20-
var path = Path.Combine(repoRoot, "src", "Agibuild.Fulora.Cli", "bin", "Debug", "net10.0", "Agibuild.Fulora.Cli.dll");
21-
if (!File.Exists(path))
22-
throw new FileNotFoundException($"CLI binary not found at {path}");
23-
return path;
20+
var binRoot = Path.Combine(repoRoot, "src", "Agibuild.Fulora.Cli", "bin");
21+
var candidates = new[]
22+
{
23+
Path.Combine(binRoot, "Release", "net10.0", "Agibuild.Fulora.Cli.dll"),
24+
Path.Combine(binRoot, "Debug", "net10.0", "Agibuild.Fulora.Cli.dll"),
25+
}
26+
.Where(File.Exists)
27+
.ToArray();
28+
29+
if (candidates.Length > 0)
30+
return candidates[0];
31+
32+
throw new FileNotFoundException($"CLI binary not found under {binRoot}");
2433
}
2534

2635
private static string FindRepoRoot()
@@ -366,13 +375,14 @@ public void Generate_types_command_can_round_trip_bridge_artifact_manifest()
366375

367376
GenerateCommand.WriteArtifactManifest(tempDir, manifest);
368377
var loaded = GenerateCommand.ReadArtifactManifest(tempDir);
378+
var buildIdentity = BridgeArtifactConsistency.ParseBuildIdentity(Assembly.GetExecutingAssembly().Location);
369379

370380
Assert.NotNull(loaded);
371381
Assert.Equal(1, loaded!.SchemaVersion);
372382
Assert.Equal("Agibuild.Fulora.UnitTests.csproj", loaded.BridgeProjectFileName);
373383
Assert.Equal(Path.GetFullPath(tempDir), loaded.ArtifactDirectory);
374-
Assert.Equal("Debug", loaded.BuildConfiguration);
375-
Assert.Equal("net10.0", loaded.TargetFramework);
384+
Assert.Equal(buildIdentity.BuildConfiguration, loaded.BuildConfiguration);
385+
Assert.Equal(buildIdentity.TargetFramework, loaded.TargetFramework);
376386
Assert.Equal(Path.GetFileName(Assembly.GetExecutingAssembly().Location), loaded.AssemblyFileName);
377387
Assert.Equal(3, loaded.Artifacts.Count);
378388
Assert.Contains("bridge.client.ts", loaded.Artifacts.Keys);

0 commit comments

Comments
 (0)