From 8587f48d28e6d7de927e83a214727c0dfd240507 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Sun, 12 Oct 2025 10:30:11 +0100 Subject: [PATCH] Bump versions of test libs (#40) --- .../PulumiWebServer.Test.fsproj | 14 ++++++------ PulumiWebServer.Test/TestJsonSchema.fs | 22 ++++++++++--------- hooks/pre-push | 17 ++------------ 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/PulumiWebServer.Test/PulumiWebServer.Test.fsproj b/PulumiWebServer.Test/PulumiWebServer.Test.fsproj index fcfea5e..cf93cd1 100644 --- a/PulumiWebServer.Test/PulumiWebServer.Test.fsproj +++ b/PulumiWebServer.Test/PulumiWebServer.Test.fsproj @@ -13,13 +13,13 @@ - - - - - - - + + + + + + + diff --git a/PulumiWebServer.Test/TestJsonSchema.fs b/PulumiWebServer.Test/TestJsonSchema.fs index 7d32fee..7203378 100644 --- a/PulumiWebServer.Test/TestJsonSchema.fs +++ b/PulumiWebServer.Test/TestJsonSchema.fs @@ -15,19 +15,21 @@ module TestSchema = [] 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.Assembly "config.json" + let json = Utils.getEmbeddedResource typeof.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 + } [] 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 + Configuration.get stream |> ignore [] [] diff --git a/hooks/pre-push b/hooks/pre-push index a99c1b4..3d81ec2 100755 --- a/hooks/pre-push +++ b/hooks/pre-push @@ -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 .