-
Notifications
You must be signed in to change notification settings - Fork 156
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
Make test explorer work with fsac tests and fix an expecto test detection #1165
Make test explorer work with fsac tests and fix an expecto test detection #1165
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.
Did self review.
cc @farlee2121 so you can see how awesome this is.
Expecto (>= 9.0 < 10.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1)) | ||
FSharp.Core (>= 4.6.2) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1)) | ||
System.Collections.Immutable (>= 6.0) - restriction: || (== net6.0) (== net7.0) (&& (== netstandard2.0) (>= netcoreapp3.1)) (&& (== netstandard2.1) (>= netcoreapp3.1)) | ||
YoloDev.Expecto.TestSdk (0.14.2) |
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.
Expecto Test SDK added support for Filter Expressions in 0.14.2
@@ -33,15 +33,15 @@ let tests state = | |||
[ | |||
testCaseAsync | |||
"no parsing/checking errors" | |||
(async { | |||
<| async { |
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 dotnetRestore dir = async { | ||
let! r = runProcess (DirectoryInfo(dir).FullName) "dotnet" "restore -v d" | ||
return expectExitCodeZero r | ||
} |
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.
Async.map
actually makes it hard to get correct stack tracing.
This was throwing on debug attaching for some reason. I was getting:
Assembly loaded during TaskRun (NuGet.Build.Tasks.GetRestoreSettingsTask): System.Diagnostics.StackTrace, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (location: C:\\Program Files\\dotnet\\shared\\Microsoft.NETCore.App\\7.0.11\\System.Diagnostics.StackTrace.dll, MVID: a66c8790-3b61-402e-b635-09e18e1fbd38, AppDomain: [Default])
System.ArgumentNullException: Value cannot be null. (Parameter 'path1')
at System.ArgumentNullException.Throw(String paramName)
at System.IO.Path.Combine(String path1, String path2)
at NuGet.Common.NuGetEnvironment.GetFolderPath(NuGetFolderPath folder)
at NuGet.Configuration.XPlatMachineWideSetting..ctor()
at NuGet.Build.Tasks.GetRestoreSettingsTask.<>c.<.cctor>b__85_0()
at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy`1.CreateValue()
at NuGet.Build.Tasks.RestoreSettingsUtils.ReadSettings(String solutionDirectory, String restoreDirectory, String restoreConfigFile, Lazy`1 machineWideSettings, SettingsLoadingContext settingsLoadContext)
at NuGet.Build.Tasks.GetRestoreSettingsTask.Execute()
Done executing task \"GetRestoreSettingsTask\" -- FAILED.
let args = | ||
[ | ||
CLIArguments.Printer (Expecto.Impl.TestPrinters.summaryWithLocationPrinter defaultConfig.printer) | ||
CLIArguments.Verbosity logLevel | ||
// CLIArguments.Parallel | ||
] | ||
|
||
runTestsWithCLIArgsAndCancel cts.Token args fixedUpArgs tests |
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.
Mechanical shift to new API.
@@ -276,7 +276,6 @@ let tests state = testList (nameof(Server)) [ | |||
|
|||
testSequenced <| testList "contesting" [ | |||
let projectDir = inTestCases "Project" | |||
dotnetRestore projectDir.Value |> Async.RunSynchronously |
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 was causing using the new debug feature to fail. Guessing this was here before we started doing restores in the serverInit
functions.
76c32f5
to
36e4c5c
Compare
| Case, SynExpr.Paren(expr = SynExpr.App(argExpr = SynExpr.ComputationExpr _)) | ||
| Case, SynExpr.Paren(expr = (SynExpr.Lambda _)) -> |
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.
Updated Pattern matching to find testCaseAsync "test paren" (async { ... })
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 catch!
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 goooo
Tangent: I've noticed mac builds failing on so many repositories, makes me think they're busted for dotnet right now. |
…tion (ionide#1165) * update Expecto to use FilterExpression * fix ability to debug some tests * unset yolodev dependency restriction * expand expecto test detection
WHAT
🤖 Generated by Copilot at 841c093
This pull request improves the test suite for the LSP features of FsAutoComplete by fixing a build error, reformatting a test file, and enhancing the test setup and runner functions. It also updates the
paket.dependencies
file and removes a redundant call todotnetRestore
in one of the test files.🤖 Generated by Copilot at 841c093
📦🛠️🧹
WHY
Project work to make Test Run Debugger usable in FSAC.
debug-test-from-ionide2.mp4
HOW
🤖 Generated by Copilot at 841c093
YoloDev.Expecto.TestSdk
to 0.14.2 inpaket.dependencies
(link)runTestsWithCLIArgsAndCancel
function inProgram.fs
(link)DirectoryInfo
type and the-v d
option for thedotnet restore
command inHelpers.fs
(link)dotnetRestore
inServer.Tests.fs
(link)EmptyFileTests.fs
to use the<|
operator and remove extra blank lines for readability and consistency (link, link, link, link)