Skip to content

Commit c5608d0

Browse files
committed
Fix CLI integration test run-path parsing
1 parent 0a32bc5 commit c5608d0

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

tests/FlowTime.Adapters.Synthetic.Tests/CliIntegrationTests.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using FlowTime.Adapters.Synthetic;
2+
using System.Linq;
23
using Xunit;
34

45
namespace FlowTime.Adapters.Synthetic.Tests;
@@ -40,10 +41,19 @@ public async Task CanReadCliProducedArtifacts()
4041
throw new Exception($"CLI failed: {error}");
4142
}
4243

43-
// Extract the run directory from output
44-
var outputLine = output.Trim();
45-
var runPath = outputLine.Replace("Wrote artifacts to ", "");
46-
44+
// Extract the run directory from output (ignore build warnings/noise)
45+
var outputLines = output
46+
.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries)
47+
.Select(line => line.Trim());
48+
49+
var runPathLine = outputLines.LastOrDefault(line => line.StartsWith("Wrote artifacts to "));
50+
if (string.IsNullOrWhiteSpace(runPathLine))
51+
{
52+
throw new Exception($"CLI output did not include run directory. STDOUT: {output}\nSTDERR: {error}");
53+
}
54+
55+
var runPath = runPathLine["Wrote artifacts to ".Length..].Trim();
56+
4757
try
4858
{
4959
// Use our adapter to read the CLI artifacts

0 commit comments

Comments
 (0)