diff --git a/Cesium.IntegrationTests/Cesium.IntegrationTests.csproj b/Cesium.IntegrationTests/Cesium.IntegrationTests.csproj
index 1835defd..f6e249c3 100644
--- a/Cesium.IntegrationTests/Cesium.IntegrationTests.csproj
+++ b/Cesium.IntegrationTests/Cesium.IntegrationTests.csproj
@@ -8,26 +8,16 @@
-
- Always
-
-
- Always
-
-
-
-
+
+
+
-
-
-
-
-
+
diff --git a/Cesium.IntegrationTests/ExecUtil.cs b/Cesium.IntegrationTests/ExecUtil.cs
index 99019948..70cd6265 100644
--- a/Cesium.IntegrationTests/ExecUtil.cs
+++ b/Cesium.IntegrationTests/ExecUtil.cs
@@ -7,7 +7,7 @@ namespace Cesium.IntegrationTests;
internal static class ExecUtil
{
public static void RunToSuccess(
- ITestOutputHelper output,
+ ITestOutputHelper? output,
string executable,
string workingDirectory,
string[] args)
@@ -17,22 +17,22 @@ public static void RunToSuccess(
}
public static CommandResult Run(
- ITestOutputHelper output,
+ ITestOutputHelper? output,
string executable,
string workingDirectory,
string[] args)
{
- output.WriteLine($"$ {executable} {string.Join(" ", args)}");
+ output?.WriteLine($"$ {executable} {string.Join(" ", args)}");
var result = Command.Run(executable, args, o => o.WorkingDirectory(workingDirectory)).Result;
foreach (var s in result.StandardOutput.Split("\n"))
- output.WriteLine(s.TrimEnd());
+ output?.WriteLine(s.TrimEnd());
if (result.StandardError.Trim() != "")
{
foreach (var s in result.StandardError.Split("\n"))
- output.WriteLine($"[ERR] {s.TrimEnd()}");
+ output?.WriteLine($"[ERR] {s.TrimEnd()}");
}
- output.WriteLine($"Command exit code: {result.ExitCode}");
+ output?.WriteLine($"Command exit code: {result.ExitCode}");
return result;
}
}
diff --git a/Cesium.IntegrationTests/IntegrationTestContext.cs b/Cesium.IntegrationTests/IntegrationTestContext.cs
index 565d7a98..de7aee37 100644
--- a/Cesium.IntegrationTests/IntegrationTestContext.cs
+++ b/Cesium.IntegrationTests/IntegrationTestContext.cs
@@ -5,9 +5,9 @@
namespace Cesium.IntegrationTests;
[UsedImplicitly]
-public class IntegrationTestContext
+public class IntegrationTestContext : IDisposable
{
- public readonly string SolutionRootPath = GetSolutionRoot();
+ public static readonly string SolutionRootPath = GetSolutionRoot();
public const string BuildConfiguration = "Release";
private readonly object _lock = new();
private bool _initialized;
@@ -40,6 +40,15 @@ public void EnsureInitialized(ITestOutputHelper output)
}
}
+ public void Dispose()
+ {
+ ExecUtil.RunToSuccess(null, "dotnet", SolutionRootPath, new[]
+ {
+ "build-server",
+ "shutdown"
+ });
+ }
+
private static string GetSolutionRoot()
{
var assemblyDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
diff --git a/Cesium.IntegrationTests/IntegrationTestRunner.cs b/Cesium.IntegrationTests/IntegrationTestRunner.cs
index 3c422e8a..c2d3dd79 100644
--- a/Cesium.IntegrationTests/IntegrationTestRunner.cs
+++ b/Cesium.IntegrationTests/IntegrationTestRunner.cs
@@ -6,16 +6,24 @@ namespace Cesium.IntegrationTests;
public class IntegrationTestRunner : IClassFixture
{
private readonly ITestOutputHelper _output;
- private readonly string _solutionRootPath;
public IntegrationTestRunner(IntegrationTestContext context, ITestOutputHelper output)
{
_output = output;
context.EnsureInitialized(output);
- _solutionRootPath = context.SolutionRootPath;
+ }
+
+ public static IEnumerable