Skip to content

Commit 3f64bab

Browse files
Fix CI failing (#274)
1 parent a721eaf commit 3f64bab

8 files changed

Lines changed: 15 additions & 3 deletions

File tree

.github/workflows/build_and_test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
name: GdUnit4 Tests
33
on:
44
push: &project_change_filter
5+
branches:
6+
- main
57
paths:
68
- 'Template/**/*.cs'
79
- 'Template/**/*.gd'
@@ -32,7 +34,7 @@ jobs:
3234
project_dir: './Template'
3335
paths: |
3436
res://Framework/Testing
35-
res://Framework/Netcode/Testing
37+
res://Framework/Netcode/Testing/Tests
3638
console-verbosity: 'normal'
3739
publish-report: false
3840
upload-report: true

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
**/*.godot/*
33
**/export.cfg
44
**/export_presets.cfg
5-
**/*.translation
65

76
# Mono-specific
87
**/.mono/

Template/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
.godot/*
33
export.cfg
44
export_presets.cfg
5-
**/*.translation
65

76
# Mono-specific
87
.mono/
2.54 KB
Binary file not shown.
2.66 KB
Binary file not shown.
2.85 KB
Binary file not shown.

Template/Framework/Netcode/Testing/Net/ENetTestHarness.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using __TEMPLATE__;
12
using __TEMPLATE__.Netcode;
23
using __TEMPLATE__.Netcode.Client;
34
using System;
@@ -18,6 +19,7 @@ public sealed class ENetTestHarness<TPacket> : IAsyncDisposable
1819
public TestServer<TPacket> Server { get; }
1920
public TestClient Client { get; }
2021
public Task ConnectTask { get; private set; } = null!;
22+
private readonly Logger _loggerService;
2123

2224
private static int _enetRefCount;
2325

@@ -26,6 +28,9 @@ public ENetTestHarness(Action<TPacket, uint> onPacket)
2628
AddEnetRef();
2729
Server = new TestServer<TPacket>(onPacket);
2830
Client = new TestClient();
31+
_loggerService = new Logger();
32+
Server.ConfigureLoggerService(_loggerService);
33+
Client.ConfigureLoggerService(_loggerService);
2934
}
3035

3136
public async Task<bool> ConnectAsync(TimeSpan timeout, ENetOptions? options = null)
@@ -79,6 +84,7 @@ public async ValueTask DisposeAsync()
7984

8085
await WaitForStoppedAsync("client", () => Client.IsRunning, _shutdownTimeout);
8186
await WaitForStoppedAsync("server", () => Server.IsRunning, _shutdownTimeout);
87+
_loggerService.Dispose();
8288
ReleaseEnetRef();
8389
}
8490

Template/Template.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@
1717
<NoWarn>NU1605;CS0108;IDE0290</NoWarn>
1818
</PropertyGroup>
1919

20+
<!-- gdUnit4 analyzer currently crashes on GitHub Actions with net10 builds. -->
21+
<PropertyGroup Condition="'$(CI)' == 'true'">
22+
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
23+
<RunAnalyzersDuringCompilation>false</RunAnalyzersDuringCompilation>
24+
</PropertyGroup>
25+
2026
<ItemGroup>
2127
<!-- Package References -->
2228
<!-- Condition="!Exists('ENet-CSharp.dll')" is required for other platforms -->

0 commit comments

Comments
 (0)