Bump versions of test libs (#40)

This commit is contained in:
Patrick Stevens
2025-10-12 10:30:11 +01:00
committed by GitHub
parent 43766bad42
commit 8587f48d28
3 changed files with 21 additions and 32 deletions

View File

@@ -13,13 +13,13 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="FsCheck" Version="3.0.0-rc3" />
<PackageReference Include="FsUnit" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="NJsonSchema" Version="11.1.0" />
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.1.0" />
<PackageReference Include="NUnit" Version="4.3.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="FsCheck" Version="3.3.1" />
<PackageReference Include="FsUnit" Version="7.1.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
<PackageReference Include="NJsonSchema" Version="11.5.1" />
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.5.1" />
<PackageReference Include="NUnit" Version="4.4.0" />
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
</ItemGroup>
<ItemGroup>

View File

@@ -15,19 +15,21 @@ module TestSchema =
[<Test>]
let ``Example conforms to schema`` () =
let executing = Assembly.GetExecutingAssembly().Location |> FileInfo
task {
let executing = Assembly.GetExecutingAssembly().Location |> FileInfo
let schemaFile =
Utils.findFileAbove "PulumiWebServer/config.schema.json" executing.Directory
let schemaFile =
Utils.findFileAbove "PulumiWebServer/config.schema.json" executing.Directory
let schema = JsonSchema.FromJsonAsync(File.ReadAllText schemaFile.FullName).Result
let! schema = JsonSchema.FromJsonAsync (File.ReadAllText schemaFile.FullName)
let json = Utils.getEmbeddedResource typeof<Utils.Dummy>.Assembly "config.json"
let json = Utils.getEmbeddedResource typeof<Utils.Dummy>.Assembly "config.json"
let validator = JsonSchemaValidator ()
let errors = validator.Validate (json, schema)
let validator = JsonSchemaValidator ()
let errors = validator.Validate (json, schema)
errors |> shouldBeEmpty
errors |> shouldBeEmpty
}
[<Test>]
let ``Example can be loaded`` () =
@@ -40,8 +42,8 @@ module TestSchema =
writer.WriteLine config
writer.Flush ()
stream.Seek (0L, SeekOrigin.Begin) |> ignore
Configuration.get stream |> ignore
stream.Seek (0L, SeekOrigin.Begin) |> ignore<int64>
Configuration.get stream |> ignore<Configuration>
[<Test>]
[<Explicit "Run this to regenerate the schema file">]

View File

@@ -1,16 +1,3 @@
#!/usr/bin/python3
#!/bin/sh
import subprocess
def check_fantomas():
result = subprocess.run(["dotnet", "tool", "run", "fantomas", "--check", "."])
if result.returncode != 0:
raise Exception(f"Formatting incomplete (return code: {result.returncode}). Consider running `dotnet tool run fantomas .`")
def main():
check_fantomas()
if __name__ == "__main__":
main()
dotnet tool run fantomas --check .