-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,7 +142,8 @@ let getExpectoTests (ast: ParsedInput) : TestAdapterEntry<range> list = | |
visitExpr entry expr2 | ||
| Case, SynExpr.ComputationExpr _ | ||
| Case, SynExpr.Lambda _ | ||
| Case, SynExpr.Paren(SynExpr.Lambda _, _, _, _) -> | ||
| Case, SynExpr.Paren(expr = SynExpr.App(argExpr = SynExpr.ComputationExpr _)) | ||
| Case, SynExpr.Paren(expr = (SynExpr.Lambda _)) -> | ||
Comment on lines
+145
to
+146
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated Pattern matching to find There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! |
||
ident <- ident + 1 | ||
|
||
let entry = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -539,11 +539,15 @@ let inline expectExitCodeZero (r: BufferedCommandResult) = | |
0 | ||
$"Expected exit code zero but was %i{r.ExitCode}.\nStdOut: %s{r.StandardOutput}\nStdErr: %s{r.StandardError}" | ||
|
||
let dotnetRestore dir = | ||
runProcess dir "dotnet" "restore" |> Async.map expectExitCodeZero | ||
|
||
let dotnetToolRestore dir = | ||
runProcess dir "dotnet" "tool restore" |> Async.map expectExitCodeZero | ||
let dotnetRestore dir = async { | ||
let! r = runProcess (DirectoryInfo(dir).FullName) "dotnet" "restore -v d" | ||
return expectExitCodeZero r | ||
} | ||
Comment on lines
+542
to
+545
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This was throwing on debug attaching for some reason. I was getting:
|
||
|
||
let dotnetToolRestore dir = async { | ||
let! r = runProcess (DirectoryInfo(dir).FullName) "dotnet" "tool restore" | ||
return expectExitCodeZero r | ||
} | ||
|
||
let serverInitialize path (config: FSharpConfigDto) createServer = | ||
async { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -245,14 +245,13 @@ let main args = | |
|
||
let cts = new CancellationTokenSource(testTimeout) | ||
|
||
let config = | ||
{ defaultConfig with | ||
// failOnFocusedTests = true | ||
printer = Expecto.Impl.TestPrinters.summaryWithLocationPrinter defaultConfig.printer | ||
verbosity = logLevel | ||
// runInParallel = false | ||
} | ||
|
||
runTestsWithArgsAndCancel cts.Token config fixedUpArgs tests | ||
let args = | ||
[ | ||
CLIArguments.Printer (Expecto.Impl.TestPrinters.summaryWithLocationPrinter defaultConfig.printer) | ||
CLIArguments.Verbosity logLevel | ||
// CLIArguments.Parallel | ||
] | ||
|
||
runTestsWithCLIArgsAndCancel cts.Token args fixedUpArgs tests | ||
Comment on lines
+248
to
+255
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mechanical shift to new API. |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 |
||
serverTestList "dir with project and no analyzers" state noAnalyzersConfig projectDir (fun server -> [ | ||
testCaseAsync "can load file in project" (async { | ||
let! (doc, diags) = server |> Server.openDocument "Other.fs" | ||
|
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