mirror of
https://github.com/Smaug123/PulumiConfig
synced 2025-10-06 00:58:39 +00:00
Bump nixpkgs (#35)
This commit is contained in:
@@ -1,29 +1,29 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Utils.fs" />
|
||||
<Compile Include="TestConfiguration.fs" />
|
||||
<Compile Include="TestJsonSchema.fs" />
|
||||
<EmbeddedResource Include="..\PulumiWebServer\Nix\config.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FsCheck" Version="2.16.5" />
|
||||
<PackageReference Include="FsUnit" Version="5.0.0" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.1.0" />
|
||||
<PackageReference Include="NJsonSchema" Version="10.8.0" />
|
||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" />
|
||||
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PulumiWebServer\PulumiWebServer.fsproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="Utils.fs" />
|
||||
<Compile Include="TestConfiguration.fs" />
|
||||
<Compile Include="TestJsonSchema.fs" />
|
||||
<EmbeddedResource Include="..\PulumiWebServer\Nix\config.json" />
|
||||
</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" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PulumiWebServer\PulumiWebServer.fsproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@@ -4,6 +4,7 @@ open System
|
||||
open System.IO
|
||||
open NUnit.Framework
|
||||
open FsCheck
|
||||
open FsCheck.FSharp
|
||||
open FsUnitTyped
|
||||
open PulumiWebServer
|
||||
|
||||
@@ -18,7 +19,7 @@ module TestConfiguration =
|
||||
|
||||
let bashStringGenerator =
|
||||
gen {
|
||||
let! s = Arb.generate<string>
|
||||
let! s = ArbMap.defaults |> ArbMap.generate<string>
|
||||
return BashString.make s
|
||||
}
|
||||
|
||||
@@ -37,14 +38,25 @@ module TestConfiguration =
|
||||
|
||||
[<Test>]
|
||||
let ``Serialisation round-trip`` () =
|
||||
Arb.register<MyGenerators> () |> ignore
|
||||
let arbMap =
|
||||
ArbMap.defaults
|
||||
|> ArbMap.mergeArb
|
||||
{ new Arbitrary<FileInfo>() with
|
||||
override x.Generator = fileInfoGenerator
|
||||
override x.Shrinker t = Seq.empty
|
||||
}
|
||||
|> ArbMap.mergeArb
|
||||
{ new Arbitrary<BashString>() with
|
||||
override x.Generator = bashStringGenerator
|
||||
override x.Shrinker t = Seq.empty
|
||||
}
|
||||
|
||||
let property (c : Configuration) : bool =
|
||||
let serialised = SerialisedConfig.Make c
|
||||
let roundTripped = SerialisedConfig.Deserialise serialised
|
||||
c = roundTripped
|
||||
|
||||
property |> Check.QuickThrowOnFailure
|
||||
Check.One (Config.QuickThrowOnFailure, Prop.forAll (arbMap.ArbFor<_> ()) property)
|
||||
|
||||
[<Test>]
|
||||
let ``Specific example`` () =
|
||||
|
@@ -3,7 +3,6 @@ namespace PulumiWebServer.Test
|
||||
open System.IO
|
||||
open System.Reflection
|
||||
open PulumiWebServer
|
||||
open NJsonSchema.Generation
|
||||
open NJsonSchema.Validation
|
||||
open NUnit.Framework
|
||||
open FsUnitTyped
|
||||
@@ -53,7 +52,8 @@ module TestSchema =
|
||||
|> fun fi -> fi.Directory
|
||||
|> Utils.findFileAbove "PulumiWebServer/config.schema.json"
|
||||
|
||||
let settings = JsonSchemaGeneratorSettings ()
|
||||
let settings =
|
||||
NJsonSchema.NewtonsoftJson.Generation.NewtonsoftJsonSchemaGeneratorSettings ()
|
||||
|
||||
settings.SerializerSettings <-
|
||||
JsonSerializerSettings (ContractResolver = CamelCasePropertyNamesContractResolver ())
|
||||
|
Reference in New Issue
Block a user