diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed9d5a1ba52..8b834a74aca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -884,7 +884,8 @@ jobs: run: dotnet restore --configfile ../../../NuGet.Config blackholio.csproj - name: Build Godot project - run: godot --headless --verbose --path demo/Blackholio/client-godot --build-solutions --quit + working-directory: demo/Blackholio/client-godot + run: godot --headless --verbose --build-solutions --quit - name: Start SpacetimeDB run: | @@ -898,7 +899,8 @@ jobs: bash ./publish.sh - name: Run Godot tests - run: godot --headless --path demo/Blackholio/client-godot --scene res://tests/GodotPlayModeTests.tscn + working-directory: demo/Blackholio/client-godot + run: godot --headless --scene res://tests/GodotPlayModeTests.tscn csharp-testsuite: needs: [lints] diff --git a/crates/bindings-csharp/Runtime/Internal/Bounds.cs b/crates/bindings-csharp/Runtime/Internal/Bounds.cs index 2bdd42c3aa1..f3e302aa8de 100644 --- a/crates/bindings-csharp/Runtime/Internal/Bounds.cs +++ b/crates/bindings-csharp/Runtime/Internal/Bounds.cs @@ -1,6 +1,3 @@ -using System.IO; -using SpacetimeDB.BSATN; - namespace SpacetimeDB { public readonly struct Bound(T min, T max) @@ -16,6 +13,8 @@ public readonly struct Bound(T min, T max) namespace SpacetimeDB.Internal { + using SpacetimeDB.BSATN; + enum BoundVariant : byte { Inclusive, diff --git a/crates/bindings-csharp/Runtime/Internal/Module.cs b/crates/bindings-csharp/Runtime/Internal/Module.cs index cec7d980b98..45d17c58fae 100644 --- a/crates/bindings-csharp/Runtime/Internal/Module.cs +++ b/crates/bindings-csharp/Runtime/Internal/Module.cs @@ -567,7 +567,7 @@ BytesSink error } catch (Exception e) { - var error_str = e.Message ?? e.GetType().FullName; + var error_str = e.Message; var error_bytes = System.Text.Encoding.UTF8.GetBytes(error_str); error.Write(error_bytes); return Errno.HOST_CALL_FAILURE; diff --git a/crates/bindings-csharp/Runtime/TransactionalContextState.cs b/crates/bindings-csharp/Runtime/TransactionalContextState.cs index ef0d72de410..9fbdaebaa70 100644 --- a/crates/bindings-csharp/Runtime/TransactionalContextState.cs +++ b/crates/bindings-csharp/Runtime/TransactionalContextState.cs @@ -79,26 +79,26 @@ Func> body } } - private long StartMutTx() + private static long StartMutTx() { var status = FFI.procedure_start_mut_tx(out var micros); FFI.ErrnoHelpers.ThrowIfError(status); return micros; } - private void CommitMutTx() + private static void CommitMutTx() { var status = FFI.procedure_commit_mut_tx(); FFI.ErrnoHelpers.ThrowIfError(status); } - private void AbortMutTx() + private static void AbortMutTx() { var status = FFI.procedure_abort_mut_tx(); FFI.ErrnoHelpers.ThrowIfError(status); } - private bool CommitMutTxWithRetry(Func retryBody) + private static bool CommitMutTxWithRetry(Func retryBody) { try { diff --git a/sdks/csharp/src/SpacetimeDBClient.cs b/sdks/csharp/src/SpacetimeDBClient.cs index ef202ed168b..34645cd60b0 100644 --- a/sdks/csharp/src/SpacetimeDBClient.cs +++ b/sdks/csharp/src/SpacetimeDBClient.cs @@ -1,5 +1,4 @@ using System; -using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; @@ -133,6 +132,8 @@ public abstract class DbConnectionBase : IDbConne where DbConnection : DbConnectionBase, new() where Tables : RemoteTablesBase { + internal const bool IsTesting = false; + public static DbConnectionBuilder Builder() => new(); internal event Action? onConnect; @@ -281,7 +282,6 @@ internal struct ParsedMessage private readonly BlockingCollection _applyQueue = new(new ConcurrentQueue()); - internal static bool IsTesting; internal bool HasMessageToApply => _applyQueue.Count > 0; private readonly CancellationTokenSource _parseCancellationTokenSource = new();