Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: pipeline breaking #270

Merged
merged 3 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using NSubstitute;
using NSubstitute.ReturnsExtensions;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
Expand Down Expand Up @@ -32,6 +33,11 @@ public void SetUp()
this.proxy = Substitute.For<IAgentProxy>();

this.actionRunner = new ActionRunner(this.agent, this.proxy);

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using FluentAssertions;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;
using UnityEngine;

namespace CrashKonijn.Goap.UnitTests
Expand All @@ -32,6 +33,11 @@ public void Setup()
this.provider.Receiver = this.agent;

this.agent.ActionProvider = this.provider;

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using NSubstitute;
using NSubstitute.ReturnsExtensions;
using NUnit.Framework;
using Unity.Collections;
using UnityEngine;
using ICondition = CrashKonijn.Goap.Core.ICondition;

Expand All @@ -30,6 +31,11 @@ public void Setup()
this.agentType = Substitute.For<IAgentType>();

this.goapActionProvider.AgentType.Returns(this.agentType);

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using CrashKonijn.Goap.UnitTests.Support;
using FluentAssertions;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
Expand All @@ -16,6 +17,11 @@ public class ClassResolverTests
public void Init()
{
this.factory.Setup<ClassResolver>();

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
using CrashKonijn.Goap.Core;
using CrashKonijn.Goap.Runtime;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
public class ConditionObserverTests
{
[SetUp]
public void Init()
{
// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
public void IsMet_Positive_IsPresent()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using CrashKonijn.Goap.Runtime;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;
using UnityEngine;

namespace CrashKonijn.Goap.UnitTests
Expand Down Expand Up @@ -59,6 +60,15 @@ public class Data : IActionData
public ITarget Target { get; set; }
}
}

[SetUp]
public void Init()
{
// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[TestCase(false)]
[TestCase(true)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,15 @@ public T ToMock()
}
}

[SetUp]
public void Init()
{
// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
public void Resolve_WithNoActions_ReturnsEmptyList()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using CrashKonijn.Goap.Runtime;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
Expand All @@ -23,6 +24,11 @@ public void SetUp()

this.manualController = new ManualController();
this.manualController.Initialize(this.goap);

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using CrashKonijn.Goap.Runtime;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
Expand All @@ -29,6 +30,11 @@ public void SetUp()
this.mockWorldData = Substitute.For<IWorldData>();
this.mockMonoAgent = Substitute.For<IMonoAgent>();
this.mockComponentReference = Substitute.For<IComponentReference>();

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using CrashKonijn.Goap.Runtime;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
Expand Down Expand Up @@ -40,6 +41,11 @@ public void SetUp()
this.goap.Events.Returns(this.events);

this.proactiveController = new ProactiveController();

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using CrashKonijn.Goap.Runtime;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
Expand Down Expand Up @@ -39,6 +40,11 @@ public void SetUp()
this.goap.Events.Returns(this.events);

this.controller = new ReactiveController();

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
using CrashKonijn.Goap.UnitTests.Classes;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
public class SensorRunnerTests
{
[SetUp]
public void Init()
{
// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
public void SenseGlobal_GlobalSensor_CallsSense()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using CrashKonijn.Goap.Runtime;
using NSubstitute;
using NUnit.Framework;
using Unity.Collections;

namespace CrashKonijn.Goap.UnitTests
{
Expand All @@ -16,6 +17,11 @@ public class WorldDataBaseTests
public void SetUp()
{
this.worldDataBase = new LocalWorldData();

// Unity sometimes thinks that a temporary job is leaking memory
// This is not the case, so we ignore the message
// This can trigger in any test, even the ones that don't use the Job system
NativeLeakDetection.Mode = NativeLeakDetectionMode.Disabled;
}

[Test]
Expand Down
Loading