From 4dc498f2a1d899bf2fee2312cdae6c2b7a93c664 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Fri, 19 Apr 2019 17:48:42 +0200 Subject: [PATCH 1/2] set test timeouts - tests: 2 sec - integration tests: 20 sec --- integrationtests/Paket.IntegrationTests/TestHelper.fs | 4 ++++ tests/Paket.Tests/TestHelpers.fs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/integrationtests/Paket.IntegrationTests/TestHelper.fs b/integrationtests/Paket.IntegrationTests/TestHelper.fs index 81453c6ad6..2445afa646 100644 --- a/integrationtests/Paket.IntegrationTests/TestHelper.fs +++ b/integrationtests/Paket.IntegrationTests/TestHelper.fs @@ -10,6 +10,10 @@ open System open System.IO open Paket.Logging +// global timeout for single tests, in ms +[] +do () + let scenarios = System.Collections.Generic.List<_>() let isLiveUnitTesting = AppDomain.CurrentDomain.GetAssemblies() |> Seq.exists (fun a -> a.GetName().Name = "Microsoft.CodeAnalysis.LiveUnitTesting.Runtime") diff --git a/tests/Paket.Tests/TestHelpers.fs b/tests/Paket.Tests/TestHelpers.fs index 6df00c47fe..4a793cdb16 100644 --- a/tests/Paket.Tests/TestHelpers.fs +++ b/tests/Paket.Tests/TestHelpers.fs @@ -9,6 +9,10 @@ open System.Xml open System.IO open Paket.Domain +// global timeout for single tests, in ms +[] +do () + let makeOrList (l:_ list) = if l.IsEmpty then FrameworkRestriction.NoRestriction else Seq.fold FrameworkRestriction.combineRestrictionsWithOr FrameworkRestriction.EmptySet l From b8314f3bbc6f7ab1deb6a385cc880f2f39bfe1db Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Fri, 19 Apr 2019 18:42:28 +0200 Subject: [PATCH 2/2] the NUnit.Framework.Timeout is not avaiable in .net core --- .../Paket.IntegrationTests.fsproj | 1 + integrationtests/Paket.IntegrationTests/TestHelper.fs | 3 +++ tests/Paket.Tests/TestHelpers.fs | 3 +++ 3 files changed, 7 insertions(+) diff --git a/integrationtests/Paket.IntegrationTests.preview3/Paket.IntegrationTests.fsproj b/integrationtests/Paket.IntegrationTests.preview3/Paket.IntegrationTests.fsproj index a23e3d7957..c6874934fa 100644 --- a/integrationtests/Paket.IntegrationTests.preview3/Paket.IntegrationTests.fsproj +++ b/integrationtests/Paket.IntegrationTests.preview3/Paket.IntegrationTests.fsproj @@ -6,6 +6,7 @@ PAKET_NETCORE; NO_UNIT_PLATFORMATTRIBUTE; + NO_UNIT_TIMEOUTATTRIBUTE; TESTSUITE_KNOWN_FAILURE_DOTNETCORE_3005; FAKE_NETSTANDARD_API; @(DefineConstants) diff --git a/integrationtests/Paket.IntegrationTests/TestHelper.fs b/integrationtests/Paket.IntegrationTests/TestHelper.fs index 2445afa646..8c5f8d237f 100644 --- a/integrationtests/Paket.IntegrationTests/TestHelper.fs +++ b/integrationtests/Paket.IntegrationTests/TestHelper.fs @@ -10,9 +10,12 @@ open System open System.IO open Paket.Logging +#if NO_UNIT_TIMEOUTATTRIBUTE +#else // global timeout for single tests, in ms [] do () +#endif let scenarios = System.Collections.Generic.List<_>() let isLiveUnitTesting = AppDomain.CurrentDomain.GetAssemblies() |> Seq.exists (fun a -> a.GetName().Name = "Microsoft.CodeAnalysis.LiveUnitTesting.Runtime") diff --git a/tests/Paket.Tests/TestHelpers.fs b/tests/Paket.Tests/TestHelpers.fs index 4a793cdb16..b132bb366c 100644 --- a/tests/Paket.Tests/TestHelpers.fs +++ b/tests/Paket.Tests/TestHelpers.fs @@ -9,9 +9,12 @@ open System.Xml open System.IO open Paket.Domain +#if NO_UNIT_TIMEOUTATTRIBUTE +#else // global timeout for single tests, in ms [] do () +#endif let makeOrList (l:_ list) = if l.IsEmpty then FrameworkRestriction.NoRestriction