-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[nnyeah] Start testing #14913
[nnyeah] Start testing #14913
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss tomorrow, I think we can do Roslyn now if we really want to go down this path but I think we could discuss different alternatives.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't compile because it is not using dotnet 6 and the bots do not install .net framework
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enough to get keep momentum going. We can rework later if needed.
(Once we fix the build error obviously)
if (output is null) | ||
output = new StringBuilder (); | ||
|
||
if (env != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets be consistent
if (env != null) { | |
if (env is not null) { |
if (callingMethod is null) | ||
Assert.Fail ("unable to get calling test from stack frame."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can do:
if (callingMethod is null) | |
Assert.Fail ("unable to get calling test from stack frame."); | |
Assert.NotNull (callingMethod, "unable to get calling test from stack frame.); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could even ut an is and remove all those ! everywhere
public static void TestAndExecute (string libraryCode, string callingCode, string expectedOutput, | ||
string callingMethodName = "") | ||
{ | ||
var testName = GetInvokingTestName (out var nameSpace, callingMethodName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nameSpace is never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume that's for use later, this method is not finished.
string callingMethodName = "") | ||
{ | ||
var testName = GetInvokingTestName (out var nameSpace, callingMethodName); | ||
var testClassName = "NnyeahTest" + testName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
using var initialLibraryDir = new DisposableTempDirectory (); | ||
using var finalLibraryDir = new DisposableTempDirectory (); | ||
|
||
var libCompilerOutput = BuildLibrary (libraryCode, testName, initialLibraryDir.DirectoryPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, never used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
return callingMethodName; | ||
} | ||
|
||
public static void TestAndExecute (string libraryCode, string callingCode, string expectedOutput, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
callingCode and expectedOutput are not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto. I'm just going to leave these ununsed bits in case we wire in test execution.
This comment has been minimized.
This comment has been minimized.
@@ -4,6 +4,8 @@ | |||
using System.Runtime.InteropServices; | |||
using System.Threading; | |||
|
|||
#nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take care of this in a diff PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -16,6 +16,8 @@ | |||
using System.Threading; | |||
using System.Threading.Tasks; | |||
|
|||
#nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take care of this in a diff PR.
@@ -3,6 +3,8 @@ | |||
using System.Linq; | |||
using System.Text; | |||
|
|||
#nullable disable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take care of this in a diff PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done here #14944
{ | ||
var compilerArgs = BuildCompilerArgs (sourceFiles, outputFile, platformName, isLibrary); | ||
Execution execution = await Execution.RunAsync(MonoCompiler, compilerArgs, mergeOutput: true, workingDirectory: workingDirectory); | ||
return execution!.StandardOutput.ToString()!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix this need of ! in a follow up PR.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
📋 [PR Build] API Diff 📋API Current PR diff✅ API Diff (from PR only) (no change) View dotnet API diffView dotnet legacy API diffAPI diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffGenerator diff✅ Generator Diff (no change) Pipeline on Agent XAMBOT-1096.Monterey |
❌ [PR Build] Tests on macOS Mac Catalina (10.15) failed ❌Failed tests are:
Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
Failures are unrelated and they are network based. |
Added code to:
Added a single unit test of the smoke test variety.
This code is currently missing the process of running nnyeah on the output and compiling and running a .NET app and collecting the output.