Skip to content

Commit

Permalink
Fix a few issues with test
Browse files Browse the repository at this point in the history
- With 3.1.102 I need to list pipelines explicitly
- Copy test assets to a temp directory (arcade needs it)
- Use .dll on *nix instead of the executable. I'm not seeing the
  the executable created on macos. Older versions of tye successful
  use the .dll.
  • Loading branch information
Ryan Nowak authored and rynowak committed Mar 6, 2020
1 parent b8bdbbc commit 23e725e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Tye.Hosting/ProcessRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private static string GetExePath(string projectFilePath)
{
// TODO: Use msbuild to get the target path

var outputFileName = Path.GetFileNameWithoutExtension(projectFilePath) + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : "");
var outputFileName = Path.GetFileNameWithoutExtension(projectFilePath) + (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".exe" : ".dll");

var debugOutputPath = Path.Combine(Path.GetDirectoryName(projectFilePath)!, "bin", "Debug");

Expand Down
1 change: 1 addition & 0 deletions src/Tye.Hosting/Tye.Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<PackageReference Include="Serilog.Extensions.Hosting" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Sln" Version="0.3.0" />
<PackageReference Include="System.IO.Pipelines" Version="4.7.0" />
<PackageReference Include="YamlDotNet" Version="8.0.0" />
<PackageReference Include="System.Reactive" Version="4.3.2" />
</ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions test/E2ETest/E2ETest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\src\tye\TempDirectory.cs" Link="TempDirectory.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
<PackageReference Include="xunit" Version="2.4.0" />
Expand Down
11 changes: 9 additions & 2 deletions test/E2ETest/TyeRunTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Tye;
using Tye.ConfigModel;
using Tye.Hosting;
using Xunit;
Expand All @@ -19,8 +20,14 @@ public class TyeRunTest
[Fact]
public async Task SingleProjectTest()
{
var application = ConfigFactory.FromFile(new FileInfo(Path.Combine(GetSolutionRootDirectory("tye"), "samples", "single-project", "test-project", "test-project.csproj")));
var host = new TyeHost(application.ToHostingApplication(), new string[0]);
var projectDirectory = new DirectoryInfo(Path.Combine(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"));

var application = ConfigFactory.FromFile(projectFile);
var host = new TyeHost(application.ToHostingApplication(), Array.Empty<string>());
await host.StartAsync();
try
{
Expand Down

0 comments on commit 23e725e

Please sign in to comment.