Skip to content

Commit

Permalink
Drop net7 (#42)
Browse files Browse the repository at this point in the history
* Drop net 7 support

* speed up tests

* Fix benchmark scripts

* drop net7 from build/devcontainer

* giglobaljson woes
  • Loading branch information
TheAngryByrd authored Feb 22, 2024
1 parent 49d4fbd commit 4a903d9
Show file tree
Hide file tree
Showing 21 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// https://github.com/devcontainers/features/blob/main/src/dotnet/README.md
"ghcr.io/devcontainers/features/dotnet:2": {
"version": "8.0",
"additionalVersions": "6.0, 7.0"
"additionalVersions": "6.0"
}
},
"overrideFeatureInstallOrder": [
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
global-json-file: global.json
dotnet-version: |
8.x
7.x
6.x
# Build on mac/linux
- name: Build via Bash
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ IcedTasks | [![NuGet Badge](https://buildstats.info/nuget/IcedTasks)](https://ww

Make sure the following **requirements** are installed on your system:

- [dotnet SDK](https://www.microsoft.com/net/download/core) 7.0 or higher
- [dotnet SDK](https://www.microsoft.com/net/download/core) 6.0 & 8.0

or

Expand Down
4 changes: 2 additions & 2 deletions benchmarks/CSharpTaskBenchmarks/CSharpTaskBenchmarks.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>

<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion benchmarks/FSharpBenchmarks/asyncCompletion.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotnet run -c Release -f net7.0 -- --filter "*IcedTasks.Benchmarks.AsyncCompletionBenchmarks*"
dotnet run -c Release -f net8.0 -- --filter "*IcedTasks.Benchmarks.AsyncCompletionBenchmarks*"
4 changes: 2 additions & 2 deletions benchmarks/FSharpBenchmarks/benchmarks.fsproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand All @@ -25,4 +25,4 @@
<ProjectReference Include="..\CSharpTaskBenchmarks\CSharpTaskBenchmarks.csproj" />
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion benchmarks/FSharpBenchmarks/fileWriting.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotnet run -c Release -f net7.0 -- --filter "*IcedTasks.Benchmarks.FileWriteBenchmarks*" --runtimes net6.0 net7.0
dotnet run -c Release -f net8.0 -- --filter "*IcedTasks.Benchmarks.FileWriteBenchmarks*" --runtimes net6.0 net8.0
2 changes: 1 addition & 1 deletion benchmarks/FSharpBenchmarks/syncCompletion.ps1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotnet run -c Release -f net7.0 -- --filter "*IcedTasks.Benchmarks.SyncCompletionBenchmarks*"
dotnet run -c Release -f net8.0 -- --filter "*IcedTasks.Benchmarks.SyncCompletionBenchmarks*"
4 changes: 2 additions & 2 deletions build/build.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<WarnOn>3390;$(WarnOn)</WarnOn>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -12,4 +12,4 @@
<Compile Include="build.fs" />
</ItemGroup>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
</Project>
2 changes: 1 addition & 1 deletion examples/DatabaseDemo/DatabaseDemo.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"sdk": {
"version": "8.0.100"
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests.NS20/IcedTasks.Tests.NS20.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;</TargetFrameworks>
<GenerateProgramFile>false</GenerateProgramFile>
<DefineConstants>$(DefineConstants);NETSTANDARD2_0;TEST_NETSTANDARD2_0</DefineConstants>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests.NS21/IcedTasks.Tests.NS21.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;</TargetFrameworks>
<GenerateProgramFile>false</GenerateProgramFile>
<DefineConstants>$(DefineConstants);NETSTANDARD2_1;TEST_NETSTANDARD2_1</DefineConstants>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests/CancellablePoolingValueTaskTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ module CancellablePoolingValueTaskTests =
let doOtherStuff (l: ResizeArray<_>) x =
cancellablePoolingValueTask {
l.Add(x)
do! Task.Delay(15)
do! Task.yieldMany 1000
let dt = DateTimeOffset.UtcNow
l.Add(x)
return dt
Expand Down
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests/CancellableTaskTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ module CancellableTaskTests =
let doOtherStuff (l: ResizeArray<_>) x =
cancellableTask {
l.Add(x)
do! Task.Delay(15)
do! Task.yieldMany 1000
let dt = DateTimeOffset.UtcNow
l.Add(x)
return dt
Expand Down
3 changes: 1 addition & 2 deletions tests/IcedTasks.Tests/CancellableValueTaskTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -958,14 +958,13 @@ module CancellableValueTaskTests =
testPropertyWithConfig Expecto.fsCheckConfig "parallelism"
<| fun () ->
asyncEx {
let! ct = Async.CancellationToken
let sequencedList = ResizeArray<_>()
let parallelList = ResizeArray<_>()

let doOtherStuff (l: ResizeArray<_>) x =
cancellableValueTask {
l.Add(x)
do! Task.Delay(15)
do! Task.yieldMany 1000
let dt = DateTimeOffset.UtcNow
l.Add(x)
return dt
Expand Down
13 changes: 11 additions & 2 deletions tests/IcedTasks.Tests/Expect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ open System
open System.Threading.Tasks
open IcedTasks

module Task =
/// Runs Task.Yield() `max` times. Useful for places where we want the scheduler to asynchronously yield but really fast.
/// We run it max times to ensure it really gets async yielded.
/// Alternative would be Task.Delay but can be slow.
let yieldMany max =
task {
for _ = 0 to max do
do! Task.Yield()
}

module TestHelpers =
open System.Threading

Expand Down Expand Up @@ -141,8 +151,7 @@ type ManualTimeProviderExtensions =
task {
this.Advance(time)
//https://github.com/dotnet/runtime/issues/85326
do! Task.Yield()
do! Task.Delay(5)
do! Task.yieldMany 10
}


Expand Down
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests/IcedTasks.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
<GenerateProgramFile>false</GenerateProgramFile>
<DefineConstants>$(DefineConstants);TEST_NET6_0_OR_GREATER</DefineConstants>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests/PoolingValueTaskTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ module PoolingValueTaskTests =
let doOtherStuff (l: ResizeArray<_>) x =
poolingValueTask {
l.Add(x)
do! Task.Delay(15)
do! Task.yieldMany 1000
let dt = DateTimeOffset.UtcNow
l.Add(x)
return dt
Expand Down
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests/TaskTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ module TaskTests =
let doOtherStuff (l: ResizeArray<_>) x =
task {
l.Add(x)
do! Task.Delay(15)
do! Task.yieldMany 1000
let dt = DateTimeOffset.UtcNow
l.Add(x)
return dt
Expand Down
2 changes: 1 addition & 1 deletion tests/IcedTasks.Tests/ValueTaskTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ module ValueTaskTests =
let doOtherStuff (l: ResizeArray<_>) x =
valueTask {
l.Add(x)
do! Task.Delay(15)
do! Task.yieldMany 1000
let dt = DateTimeOffset.UtcNow
l.Add(x)
return dt
Expand Down

0 comments on commit 4a903d9

Please sign in to comment.