Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions build/Build.Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ function Execute-Tests($version)
{
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release --framework "$framework" /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
if($LASTEXITCODE -ne 0) { throw "Build failed" }

choco install seq
$env:PATH="C:\Program Files\Seq;$env:PATH"

cd ./test/SeqCli.EndToEnd/
& dotnet run -f $framework
if ($LASTEXITCODE -ne 0)
{
cd ../..
exit 1
}
cd ../..
}

function Create-ArtifactDir
Expand Down
12 changes: 11 additions & 1 deletion src/SeqCli/Forwarder/Util/CaptiveProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;

namespace SeqCli.Forwarder.Util;
Expand All @@ -25,7 +26,8 @@ public static int Run(
string? args = null,
Action<string>? writeStdout = null,
Action<string>? writeStderr = null,
string? workingDirectory = null)
string? workingDirectory = null,
Dictionary<string, string>? environment = null)
{
if (fullExePath == null) throw new ArgumentNullException(nameof(fullExePath));

Expand All @@ -48,6 +50,14 @@ public static int Run(
if (!string.IsNullOrEmpty(workingDirectory))
startInfo.WorkingDirectory = workingDirectory;

if (environment != null)
{
foreach (var (k, v) in environment)
{
startInfo.EnvironmentVariables.Add(k, v);
}
}

using var process = Process.Start(startInfo)!;
using var outputComplete = new ManualResetEvent(false);
using var errorComplete = new ManualResetEvent(false);
Expand Down
2 changes: 1 addition & 1 deletion src/SeqCli/SeqCli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Seq.Api" Version="2025.2.0" />
<PackageReference Include="Seq.Api" Version="2025.2.2" />
<PackageReference Include="Serilog" Version="4.3.0" />
<PackageReference Include="Serilog.Expressions" Version="5.0.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="3.0.0" />
Expand Down
5 changes: 4 additions & 1 deletion test/SeqCli.EndToEnd/Support/TestConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public CaptiveProcess SpawnServerProcess(string storagePath)
return new CaptiveProcess(containerRuntime, $"run --name {containerName} -d -e ACCEPT_EULA=Y -e SEQ_FIRSTRUN_NOAUTHENTICATION=True -p {_serverListenPort}:80 datalust/seq:{imageTag}", stopCommandFullExePath: containerRuntime, stopCommandArgs: $"rm -f {containerName}");
}

return new CaptiveProcess("seq", commandWithArgs);
return new CaptiveProcess("seq", commandWithArgs, environment: new Dictionary<string, string>
{
{ "SEQ_FIRSTRUN_NOAUTHENTICATION", "True" }
});
}
}
Loading