mirror of
https://github.com/Smaug123/PulumiConfig
synced 2025-10-23 00:28:40 +00:00
Bump versions of test libs (#40)
This commit is contained in:
@@ -13,13 +13,13 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FsCheck" Version="3.0.0-rc3" />
|
<PackageReference Include="FsCheck" Version="3.3.1" />
|
||||||
<PackageReference Include="FsUnit" Version="7.0.0" />
|
<PackageReference Include="FsUnit" Version="7.1.1" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.0" />
|
||||||
<PackageReference Include="NJsonSchema" Version="11.1.0" />
|
<PackageReference Include="NJsonSchema" Version="11.5.1" />
|
||||||
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.1.0" />
|
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.5.1" />
|
||||||
<PackageReference Include="NUnit" Version="4.3.1" />
|
<PackageReference Include="NUnit" Version="4.4.0" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
|
<PackageReference Include="NUnit3TestAdapter" Version="5.2.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -15,19 +15,21 @@ module TestSchema =
|
|||||||
|
|
||||||
[<Test>]
|
[<Test>]
|
||||||
let ``Example conforms to schema`` () =
|
let ``Example conforms to schema`` () =
|
||||||
let executing = Assembly.GetExecutingAssembly().Location |> FileInfo
|
task {
|
||||||
|
let executing = Assembly.GetExecutingAssembly().Location |> FileInfo
|
||||||
|
|
||||||
let schemaFile =
|
let schemaFile =
|
||||||
Utils.findFileAbove "PulumiWebServer/config.schema.json" executing.Directory
|
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 validator = JsonSchemaValidator ()
|
||||||
let errors = validator.Validate (json, schema)
|
let errors = validator.Validate (json, schema)
|
||||||
|
|
||||||
errors |> shouldBeEmpty
|
errors |> shouldBeEmpty
|
||||||
|
}
|
||||||
|
|
||||||
[<Test>]
|
[<Test>]
|
||||||
let ``Example can be loaded`` () =
|
let ``Example can be loaded`` () =
|
||||||
@@ -40,8 +42,8 @@ module TestSchema =
|
|||||||
writer.WriteLine config
|
writer.WriteLine config
|
||||||
writer.Flush ()
|
writer.Flush ()
|
||||||
|
|
||||||
stream.Seek (0L, SeekOrigin.Begin) |> ignore
|
stream.Seek (0L, SeekOrigin.Begin) |> ignore<int64>
|
||||||
Configuration.get stream |> ignore
|
Configuration.get stream |> ignore<Configuration>
|
||||||
|
|
||||||
[<Test>]
|
[<Test>]
|
||||||
[<Explicit "Run this to regenerate the schema file">]
|
[<Explicit "Run this to regenerate the schema file">]
|
||||||
|
@@ -1,16 +1,3 @@
|
|||||||
#!/usr/bin/python3
|
#!/bin/sh
|
||||||
|
|
||||||
import subprocess
|
dotnet tool run fantomas --check .
|
||||||
|
|
||||||
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()
|
|
||||||
|
Reference in New Issue
Block a user