Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fc1943s committed Jul 6, 2024
1 parent 523a55f commit c075634
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 10 deletions.
13 changes: 12 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,16 @@
"seccomp=unconfined",
"--env-file",
"${localWorkspaceFolder}/.devcontainer/.env"
]
],
"customizations": {
"vscode": {
"extensions": [
"i574n.spiral-lang-vscode-i574n",
"i574n.dotnet-interactive-vscode-i574n"
],
"settings": {
"notebook.lineNumbers": "on"
}
}
}
}
4 changes: 2 additions & 2 deletions apps/spiral/Eval.dib
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ let prepareSpiral rawCellCode lines =
let lastTopLevelIndex, _ =
(lines |> Array.indexed, (None, false))
||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->
trace Verbose (fun () -> $"Eval.prepareSpi / i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
// trace Verbose (fun () -> $"Eval.prepareSpiral / i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
match line with
| _ when finished -> lastTopLevelIndex, true
| "" -> lastTopLevelIndex, false
Expand Down Expand Up @@ -768,7 +768,7 @@ let inline eval

trace Verbose
(fun () -> $"Eval.eval")
(fun () -> $"cellCode: {cellCode |> SpiralSm.ellipsis_end 400} / lastTopLevelIndex: {lastTopLevelIndex} / builderCommands: %A{builderCommands} / buildBackends: %A{buildBackends} / isReal: {isReal} / {_locals ()}")
(fun () -> $"lastTopLevelIndex: {lastTopLevelIndex} / builderCommands: %A{builderCommands} / buildBackends: %A{buildBackends} / isReal: {isReal} / {_locals ()}")

let! buildCodeResults =
buildBackends
Expand Down
4 changes: 2 additions & 2 deletions apps/spiral/Eval.fs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ module Eval =
let lastTopLevelIndex, _ =
(lines |> Array.indexed, (None, false))
||> Array.foldBack (fun (i, line) (lastTopLevelIndex, finished) ->
trace Verbose (fun () -> $"Eval.prepareSpi / i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
// trace Verbose (fun () -> $"Eval.prepareSpiral / i: {i} / line: '{line}' / lastTopLevelIndex: {lastTopLevelIndex} / finished: {finished}") _locals
match line with
| _ when finished -> lastTopLevelIndex, true
| "" -> lastTopLevelIndex, false
Expand Down Expand Up @@ -659,7 +659,7 @@ module Eval =

trace Verbose
(fun () -> $"Eval.eval")
(fun () -> $"cellCode: {cellCode |> SpiralSm.ellipsis_end 400} / lastTopLevelIndex: {lastTopLevelIndex} / builderCommands: %A{builderCommands} / buildBackends: %A{buildBackends} / isReal: {isReal} / {_locals ()}")
(fun () -> $"lastTopLevelIndex: {lastTopLevelIndex} / builderCommands: %A{builderCommands} / buildBackends: %A{buildBackends} / isReal: {isReal} / {_locals ()}")

let! buildCodeResults =
buildBackends
Expand Down
4 changes: 2 additions & 2 deletions apps/spiral/Supervisor.dib
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ let inline buildFile backend timeout port cancellationToken path =
((None, [], 0), outputSeq)
||> FSharp.Control.AsyncSeq.scan (
fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->
trace Debug (fun () -> $"Supervisor.buildFile / AsyncSeq.scan / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / outputContentResult: {outputContentResult} / typeErrorCount: {typeErrorCount} / retry: {retry} / error: {error} / path: {path}") _locals
trace Debug (fun () -> $"Supervisor.buildFile / AsyncSeq.scan / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 300} / errors: {errors |> serializeObj} / outputContentResult: {outputContentResult} / typeErrorCount: {typeErrorCount} / retry: {retry} / error: {error} / path: {path}") _locals
match outputContent, error with
| Some outputContent, None -> Some outputContent, errors, typeErrorCount
| None, Some (_, FatalError "File main has a type error somewhere in its path.") ->
Expand All @@ -376,7 +376,7 @@ let inline buildFile backend timeout port cancellationToken path =
| _ -> outputContentResult, errors, typeErrorCount
)
|> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->
trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount} / retry: {retry} / path: {path}") _locals
trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 300} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount} / retry: {retry} / path: {path}") _locals
#if INTERACTIVE
let errorWait = 2
#else
Expand Down
4 changes: 2 additions & 2 deletions apps/spiral/Supervisor.fs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ module Supervisor =
((None, [], 0), outputSeq)
||> FSharp.Control.AsyncSeq.scan (
fun (outputContentResult, errors, typeErrorCount) (outputContent, error) ->
trace Debug (fun () -> $"Supervisor.buildFile / AsyncSeq.scan / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / outputContentResult: {outputContentResult} / typeErrorCount: {typeErrorCount} / retry: {retry} / error: {error} / path: {path}") _locals
trace Debug (fun () -> $"Supervisor.buildFile / AsyncSeq.scan / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 300} / errors: {errors |> serializeObj} / outputContentResult: {outputContentResult} / typeErrorCount: {typeErrorCount} / retry: {retry} / error: {error} / path: {path}") _locals
match outputContent, error with
| Some outputContent, None -> Some outputContent, errors, typeErrorCount
| None, Some (_, FatalError "File main has a type error somewhere in its path.") ->
Expand All @@ -273,7 +273,7 @@ module Supervisor =
| _ -> outputContentResult, errors, typeErrorCount
)
|> FSharp.Control.AsyncSeq.takeWhileInclusive (fun (outputContent, errors, typeErrorCount) ->
trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / outputContent: {outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 400} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount} / retry: {retry} / path: {path}") _locals
trace Debug (fun () -> $"Supervisor.buildFile / takeWhileInclusive / outputContent:\n{outputContent |> Option.defaultValue System.String.Empty |> SpiralSm.ellipsis_end 300} / errors: {errors |> serializeObj} / typeErrorCount: {typeErrorCount} / retry: {retry} / path: {path}") _locals
#if INTERACTIVE
let errorWait = 2
#else
Expand Down
2 changes: 1 addition & 1 deletion scripts/dep_dotnet-interactive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ if (!$fast) {
Copy-Item "../deps/dotnet-interactive/artifacts/bin/dotnet-interactive/Release/net9.0/**" $netVersion -Recurse -Force

if ($pack) {
{ dotnet pack -c Release /p:Version=0.1.0 } | Invoke-Block -Location ../deps/dotnet-interactive/src/dotnet-interactive
{ dotnet pack -c Release /p:Version=0.1.1 } | Invoke-Block -Location ../deps/dotnet-interactive/src/dotnet-interactive
}

0 comments on commit c075634

Please sign in to comment.