Browse Source

Fix NullRef in Tye run when not specifying and projects to debug. (#180)

pull/181/head
Justin Kotalik 6 years ago
committed by GitHub
parent
commit
1d4479587c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Microsoft.Tye.Hosting/ProcessRunnerOptions.cs
  2. 20
      test/E2ETest/TyeRunTests.cs

2
src/Microsoft.Tye.Hosting/ProcessRunnerOptions.cs

@ -21,7 +21,7 @@ namespace Microsoft.Tye.Hosting
BuildProjects = !args.Contains("--no-build"),
DebugMode = args.Contains("--debug"),
ServicesToDebug = servicesToDebug,
DebugAllServices = servicesToDebug.Contains("*", StringComparer.OrdinalIgnoreCase)
DebugAllServices = servicesToDebug?.Contains("*", StringComparer.OrdinalIgnoreCase) ?? false
};
}
}

20
test/E2ETest/TyeRunTests.cs

@ -175,6 +175,26 @@ namespace E2ETest
}
}
[Fact]
public async Task NullDebugTargetsDoesNotThrow()
{
var projectDirectory = new DirectoryInfo(Path.Combine(TestHelpers.GetSolutionRootDirectory("tye"), "samples", "single-project", "test-project"));
using var tempDirectory = TempDirectory.Create();
DirectoryCopy.Copy(projectDirectory.FullName, tempDirectory.DirectoryPath);
var projectFile = new FileInfo(Path.Combine(tempDirectory.DirectoryPath, "test-project.csproj"));
// Debug targets can be null if not specified, so make sure calling host.Start does not throw.
using var host = new TyeHost(ConfigFactory.FromFile(projectFile).ToHostingApplication(), Array.Empty<string>(), null!)
{
Sink = sink,
};
await host.StartAsync();
await host.StopAsync();
}
private async Task CheckServiceIsUp(Microsoft.Tye.Hosting.Model.Application application, HttpClient client, string serviceName, Uri dashboardUri, TimeSpan? timeout = default)
{
// make sure backend is up before frontend

Loading…
Cancel
Save