Skip to content

Commit

Permalink
[nnyeah] Optionally run integration test nnyeah in-process (#15049)
Browse files Browse the repository at this point in the history
  • Loading branch information
chamons authored May 17, 2022
1 parent 3207ba2 commit 2aae39d
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions tools/nnyeah/tests/integration/IntegrationExamples.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// #define NNYEAH_IN_PROCESS

using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -30,7 +32,7 @@ string GetLegacyPlatform (ApplePlatform platform)
}
}

string GetNETPlatform (ApplePlatform platform)
string GetNetPlatform (ApplePlatform platform)
{
switch (platform)
{
Expand All @@ -53,6 +55,18 @@ async Task AssertLegacyBuild (string project, ApplePlatform platform)
Assert.Zero (execution.ExitCode, $"Build Output: {execution.StandardOutput}");
}

async Task ExecuteNnyeah (string inputPath, string convertedPath, ApplePlatform platform)
{
#if NNYEAH_IN_PROCESS
Program.ProcessAssembly (GetLegacyPlatform(platform), GetNetPlatform(platform), inputPath, convertedPath, true, true, false);
#else
var args = new List<string> { Nnyeah, $"--input={inputPath}", $"--output={convertedPath}", $"--xamarin-assembly={GetLegacyPlatform(platform)}",
$"--microsoft-assembly={GetNetPlatform(platform)}", "--force-overwrite"};
Execution execution = await Execution.RunAsync (DotNet.Executable, args, null, mergeOutput: true);
Assert.Zero (execution.ExitCode, $"Nnyeah Output: {execution.StandardOutput}");
#endif
}

// [Test]
// [TestCase("API/macOSIntegration.csproj", "API/bin/Debug/macOSIntegration.dll", "Consumer/macOS/macOS.csproj", ApplePlatform.MacOSX)]
// [TestCase("API/iOSIntegration.csproj", "API/bin/Debug/iOSIntegration.dll", "Consumer/ios/ios.csproj", ApplePlatform.iOS)]
Expand All @@ -66,10 +80,7 @@ public async Task BuildAndRunSynthetic (string libraryProject, string libraryPat
string inputPath = Path.Combine (IntegrationRoot, libraryPath);
string convertedPath = Path.Combine (convertedDir, Path.GetFileName (libraryPath));

var args = new List<string> { Nnyeah, $"--input={inputPath}", $"--output={convertedPath}", $"--xamarin-assembly={GetLegacyPlatform(platform)}",
$"--microsoft-assembly={GetNETPlatform(platform)}", "--force-overwrite"};
Execution execution = await Execution.RunAsync (DotNet.Executable, args, null, mergeOutput: true);
Assert.Zero (execution.ExitCode, $"Nnyeah Output: {execution.StandardOutput}");
await ExecuteNnyeah (inputPath, convertedPath, platform);

DotNet.AssertBuild (Path.Combine (IntegrationRoot, consumerProject));
}
Expand All @@ -96,10 +107,7 @@ public async Task NugetExamples (string downloadUrl, string libraryPath, ApplePl

string convertedPath = Path.Combine (convertedDir, Path.GetFileName (libraryPath));

var args = new List<string> { Nnyeah, $"--input={nugetPath}", $"--output={convertedPath}", $"--xamarin-assembly={GetLegacyPlatform(platform)}",
$"--microsoft-assembly={GetNETPlatform(platform)}", "--force-overwrite"};
Execution execution = await Execution.RunAsync (DotNet.Executable, args, null, mergeOutput: true);
Assert.Zero (execution.ExitCode, $"Nnyeah Output: {execution.StandardOutput}");
await ExecuteNnyeah (nugetPath, convertedPath, platform);
}
}
}

5 comments on commit 2aae39d

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💻 [CI Build] Tests on macOS Mac Catalina (10.15) passed 💻

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 2aae39d8deff204743380c9a100df1d200c42307

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌

Failed tests are:

  • xammac_tests
  • monotouch-test

Pipeline on Agent
Hash: 2aae39d8deff204743380c9a100df1d200c42307

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 [CI Build] API Diff 📋

API diff (for current PR)

ℹ️ API Diff (from PR only) (please review changes)

API diff: vsdrops gist

Xamarin
.NET
Xamarin vs .NET
iOS vs Mac Catalyst (.NET)

API diff (vs stable)

✅ API Diff from stable

API diff: vsdrops gist

Xamarin
.NET
Xamarin vs .NET
iOS vs Mac Catalyst (.NET)

Generator diff

Generator Diff (no change)

Pipeline on Agent XAMMINI-058.Monterey'
Hash: 2aae39d8deff204743380c9a100df1d200c42307

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📚 [CI Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMMINI-063.Monterey'
Hash: 2aae39d8deff204743380c9a100df1d200c42307

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Tests failed catastrophically on VSTS: simulator tests iOS (no summary found). 🔥

Result file D:\a\1\s\Reports\TestSummary-simulator\TestSummary.md not found.

Pipeline on Agent XAMBOT-1033.Monterey'
[nnyeah] Optionally run integration test nnyeah in-process (#15049)

Please sign in to comment.