Skip to content

Commit e85cc03

Browse files
authored
issue-78-async-seq (#155)
* * Adds AsyncSeq compatability * Rejigs tests to get greater coverage with Fable * Updates some tools * * Stick to netstandard 2.0 * Update FsToolkit.ErrorHandling.AsyncSeq.fsproj * * Makes paket.lock net5.0 compat * * Fixes formating * * Restore paket targets in Fake
1 parent 1e72e17 commit e85cc03

33 files changed

+2139
-2432
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"@babel/preset-env"
4+
]
5+
}

.config/dotnet-tools.json

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"version": 1,
3-
"isRoot": true,
4-
"tools": {
5-
"fake-cli": {
6-
"version": "5.20.4",
7-
"commands": [
8-
"fake"
9-
]
10-
},
11-
"paket": {
12-
"version": "6.2.1",
13-
"commands": [
14-
"paket"
15-
]
16-
},
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"fake-cli": {
6+
"version": "5.20.4",
7+
"commands": [
8+
"fake"
9+
]
10+
},
11+
"paket": {
12+
"version": "6.2.1",
13+
"commands": [
14+
"paket"
15+
]
16+
},
1717
"fable": {
1818
"version": "3.4.9",
1919
"commands": [
@@ -23,7 +23,13 @@
2323
"fantomas-tool": {
2424
"version": "4.5.4",
2525
"commands": [
26-
"fantomas"
26+
"fantomas"
27+
]
28+
},
29+
"femto": {
30+
"version": "0.9.0",
31+
"commands": [
32+
"femto"
2733
]
2834
}
2935
}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ FakesAssemblies/
382382
_Pvt_Extensions
383383

384384
# Paket dependency manager
385+
.paket
385386
paket-files/
386387

387388
# FAKE - F# Make
@@ -395,4 +396,6 @@ paket-files/
395396
.ionide/
396397

397398
# Fable
399+
fable_modules
400+
.fable
398401
*.fs.js

.paket/Paket.Restore.targets

Lines changed: 0 additions & 557 deletions
This file was deleted.

FsToolkit.ErrorHandling.sln

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{9F888E39
2323
EndProject
2424
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FunctionMap", "tools\FunctionMap\FunctionMap.fsproj", "{600EA6E9-C9F2-4F02-99EF-1F992711DB1C}"
2525
EndProject
26+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsToolkit.ErrorHandling.AsyncSeq", "src\FsToolkit.ErrorHandling.AsyncSeq\FsToolkit.ErrorHandling.AsyncSeq.fsproj", "{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}"
27+
EndProject
28+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsToolkit.ErrorHandling.AsyncSeq.Tests", "tests\FsToolkit.ErrorHandling.AsyncSeq.Tests\FsToolkit.ErrorHandling.AsyncSeq.Tests.fsproj", "{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}"
29+
EndProject
30+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsToolkit.ErrorHandling.Fable.Tests", "tests\FsToolkit.ErrorHandling.Fable.Tests\FsToolkit.ErrorHandling.Fable.Tests.fsproj", "{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}"
31+
EndProject
32+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsToolkit.ErrorHandling.Tests.Runner", "tests\FsToolkit.ErrorHandling.Tests.Runner\FsToolkit.ErrorHandling.Tests.Runner.fsproj", "{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}"
33+
EndProject
34+
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FsToolkit.ErrorHandling.AsyncSeq.Tests.Runner", "tests\FsToolkit.ErrorHandling.AsyncSeq.Tests.Runner\FsToolkit.ErrorHandling.AsyncSeq.Tests.Runner.fsproj", "{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}"
35+
EndProject
2636
Global
2737
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2838
Debug|Any CPU = Debug|Any CPU
@@ -120,6 +130,66 @@ Global
120130
{600EA6E9-C9F2-4F02-99EF-1F992711DB1C}.Release|x64.Build.0 = Release|Any CPU
121131
{600EA6E9-C9F2-4F02-99EF-1F992711DB1C}.Release|x86.ActiveCfg = Release|Any CPU
122132
{600EA6E9-C9F2-4F02-99EF-1F992711DB1C}.Release|x86.Build.0 = Release|Any CPU
133+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
134+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Debug|Any CPU.Build.0 = Debug|Any CPU
135+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Debug|x64.ActiveCfg = Debug|Any CPU
136+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Debug|x64.Build.0 = Debug|Any CPU
137+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Debug|x86.ActiveCfg = Debug|Any CPU
138+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Debug|x86.Build.0 = Debug|Any CPU
139+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Release|Any CPU.ActiveCfg = Release|Any CPU
140+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Release|Any CPU.Build.0 = Release|Any CPU
141+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Release|x64.ActiveCfg = Release|Any CPU
142+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Release|x64.Build.0 = Release|Any CPU
143+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Release|x86.ActiveCfg = Release|Any CPU
144+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571}.Release|x86.Build.0 = Release|Any CPU
145+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
146+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
147+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Debug|x64.ActiveCfg = Debug|Any CPU
148+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Debug|x64.Build.0 = Debug|Any CPU
149+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Debug|x86.ActiveCfg = Debug|Any CPU
150+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Debug|x86.Build.0 = Debug|Any CPU
151+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
152+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Release|Any CPU.Build.0 = Release|Any CPU
153+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Release|x64.ActiveCfg = Release|Any CPU
154+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Release|x64.Build.0 = Release|Any CPU
155+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Release|x86.ActiveCfg = Release|Any CPU
156+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA}.Release|x86.Build.0 = Release|Any CPU
157+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
158+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Debug|Any CPU.Build.0 = Debug|Any CPU
159+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Debug|x64.ActiveCfg = Debug|Any CPU
160+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Debug|x64.Build.0 = Debug|Any CPU
161+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Debug|x86.ActiveCfg = Debug|Any CPU
162+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Debug|x86.Build.0 = Debug|Any CPU
163+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Release|Any CPU.ActiveCfg = Release|Any CPU
164+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Release|Any CPU.Build.0 = Release|Any CPU
165+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Release|x64.ActiveCfg = Release|Any CPU
166+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Release|x64.Build.0 = Release|Any CPU
167+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Release|x86.ActiveCfg = Release|Any CPU
168+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E}.Release|x86.Build.0 = Release|Any CPU
169+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
170+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Debug|Any CPU.Build.0 = Debug|Any CPU
171+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Debug|x64.ActiveCfg = Debug|Any CPU
172+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Debug|x64.Build.0 = Debug|Any CPU
173+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Debug|x86.ActiveCfg = Debug|Any CPU
174+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Debug|x86.Build.0 = Debug|Any CPU
175+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Release|Any CPU.ActiveCfg = Release|Any CPU
176+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Release|Any CPU.Build.0 = Release|Any CPU
177+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Release|x64.ActiveCfg = Release|Any CPU
178+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Release|x64.Build.0 = Release|Any CPU
179+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Release|x86.ActiveCfg = Release|Any CPU
180+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30}.Release|x86.Build.0 = Release|Any CPU
181+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
182+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Debug|Any CPU.Build.0 = Debug|Any CPU
183+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Debug|x64.ActiveCfg = Debug|Any CPU
184+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Debug|x64.Build.0 = Debug|Any CPU
185+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Debug|x86.ActiveCfg = Debug|Any CPU
186+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Debug|x86.Build.0 = Debug|Any CPU
187+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Release|Any CPU.ActiveCfg = Release|Any CPU
188+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Release|Any CPU.Build.0 = Release|Any CPU
189+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Release|x64.ActiveCfg = Release|Any CPU
190+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Release|x64.Build.0 = Release|Any CPU
191+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Release|x86.ActiveCfg = Release|Any CPU
192+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897}.Release|x86.Build.0 = Release|Any CPU
123193
EndGlobalSection
124194
GlobalSection(NestedProjects) = preSolution
125195
{E0466000-F8E4-416B-B605-C65F7602367A} = {E28025A7-EF6A-45BF-8FA0-75E394D3D42B}
@@ -129,5 +199,10 @@ Global
129199
{5B1EA296-538E-40E5-BF1D-6CB0F20BB52E} = {E28025A7-EF6A-45BF-8FA0-75E394D3D42B}
130200
{7DABAB8F-4A02-4992-A3A2-6C550F98C13B} = {D8B86171-2147-49EF-8ADA-1CF8B0A20D40}
131201
{600EA6E9-C9F2-4F02-99EF-1F992711DB1C} = {9F888E39-5D40-4E29-9529-67C466722431}
202+
{02DF2AE6-A7D4-4C38-AA4D-651BDD1D3571} = {E28025A7-EF6A-45BF-8FA0-75E394D3D42B}
203+
{5DED3CA8-B331-4B48-A6A2-2EE1410437CA} = {D8B86171-2147-49EF-8ADA-1CF8B0A20D40}
204+
{629C5ADC-6C4D-454C-88EE-CC067FB21D5E} = {D8B86171-2147-49EF-8ADA-1CF8B0A20D40}
205+
{B70E0B97-0CDD-481B-8F77-E1B0A486EB30} = {D8B86171-2147-49EF-8ADA-1CF8B0A20D40}
206+
{3DC38BAA-68F3-4493-B6F7-4A1C8C101897} = {D8B86171-2147-49EF-8ADA-1CF8B0A20D40}
132207
EndGlobalSection
133208
EndGlobal

build.fsx

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,12 @@ let runTestAssembly setParams testAssembly =
136136
if String.isNotNullOrEmpty args.WorkingDirectory
137137
then args.WorkingDirectory else Fake.IO.Path.getDirectory testAssembly
138138
(fun (info: ProcStartInfo) ->
139-
{ info with
139+
{ info with
140140
FileName = "dotnet"
141141
Arguments = sprintf "%s %s" testAssembly (string args)
142142
WorkingDirectory = workingDir } )
143143

144-
let execWithExitCode testAssembly argsString timeout =
144+
let execWithExitCode testAssembly argsString timeout =
145145
Process.execSimple (fakeStartInfo testAssembly argsString) timeout
146146

147147
execWithExitCode testAssembly (setParams Expecto.Params.DefaultParams) TimeSpan.MaxValue
@@ -161,23 +161,47 @@ let runTests setParams testAssemblies =
161161
| [] -> ()
162162
| failedAssemblies ->
163163
failedAssemblies
164-
|> List.map (fun (testAssembly,exitCode) ->
164+
|> List.map (fun (testAssembly,exitCode) ->
165165
sprintf "Expecto test of assembly '%s' failed. Process finished with exit code %d." testAssembly exitCode )
166166
|> String.concat System.Environment.NewLine
167167
|> Fake.Testing.Common.FailedTestsException |> raise
168168
__.MarkSuccess()
169169

170-
let testAssemblies = "tests/**/bin" </> configuration </> "**" </> "*Tests.dll"
170+
let testProjects = [
171+
"tests/FsToolkit.ErrorHandling.Tests.Runner"
172+
"tests/FsToolkit.ErrorHandling.AsyncSeq.Tests.Runner"
173+
"tests/FsToolkit.ErrorHandling.JobResult.Tests"
174+
"tests/FsToolkit.ErrorHandling.TaskResult.Tests"
175+
"tests/FsToolkit.ErrorHandling.Fable.Tests"
176+
]
177+
178+
let testAssemblies = [
179+
for proj in testProjects do
180+
let projName = proj.Split('/') |> Array.last
181+
let pattern = proj </> "bin" </> configuration </> "**" </> (projName + ".dll")
182+
183+
yield! (!!pattern)
184+
]
171185

172186
Target.create "RunTests" (fun _ ->
173-
runTests id (!! testAssemblies)
187+
runTests id testAssemblies
174188
)
175189

176190
let runFableTests _ =
177191
Npm.test id
178192

179193
Target.create "RunFableTests" runFableTests
180194

195+
Target.create "FemtoValidate" (fun _ ->
196+
let result =
197+
CreateProcess.fromRawCommand "dotnet" [ "femto"; "./tests/FsToolkit.ErrorHandling.Fable.Tests"; "--validate" ]
198+
|> Proc.run
199+
200+
if result.ExitCode <> 0
201+
then
202+
Fake.Testing.Common.FailedTestsException "Femto failed; perhaps you need to update the package.json?" |> raise
203+
)
204+
181205
let release = ReleaseNotes.load "RELEASE_NOTES.md"
182206

183207
Target.create "AssemblyInfo" (fun _ ->
@@ -228,7 +252,7 @@ Target.create "PublishNuget" (fun _ ->
228252
ToolType = ToolType.CreateLocalTool()
229253
PublishUrl = "https://www.nuget.org"
230254
WorkingDir = distDir
231-
ApiKey =
255+
ApiKey =
232256
match nugetToken with
233257
| Some s -> s
234258
| _ -> p.ApiKey // assume paket-config was set properly
@@ -279,6 +303,7 @@ Target.create "UpdateDocs" (fun _ ->
279303
==> "NpmRestore"
280304
==> "CheckFormatCode"
281305
==> "Build"
306+
==> "FemtoValidate"
282307
==> "RunTests"
283308
==> "RunFableTests"
284309
==> "NuGet"

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ set -o pipefail
77
echo "Restoring dotnet tools..."
88
dotnet tool restore
99

10-
FAKE_DETAILED_ERRORS=true PAKET_SKIP_RESTORE_TARGETS=true dotnet fake build -t "$@"
10+
FAKE_DETAILED_ERRORS=true dotnet fake build -t "$@"

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"sdk": {
3-
"version": "5.0.402"
3+
"version": "5.0.402",
4+
"rollForward": "minor"
45
}
56
}

0 commit comments

Comments
 (0)