From 7495a04990a01792b7e65b7a473eb41bcb70c5ed Mon Sep 17 00:00:00 2001 From: Salman Ahmed Date: Wed, 30 Mar 2022 01:16:10 +0300 Subject: [PATCH] Ignore EF-to-realm migration tests on ARM architectures --- .../Navigation/TestEFToRealmMigration.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/osu.Game.Tests/Visual/Navigation/TestEFToRealmMigration.cs b/osu.Game.Tests/Visual/Navigation/TestEFToRealmMigration.cs index 00a06d420e..8498b9b28f 100644 --- a/osu.Game.Tests/Visual/Navigation/TestEFToRealmMigration.cs +++ b/osu.Game.Tests/Visual/Navigation/TestEFToRealmMigration.cs @@ -3,7 +3,9 @@ using System.IO; using System.Linq; +using System.Runtime.InteropServices; using NUnit.Framework; +using osu.Framework; using osu.Framework.Allocation; using osu.Game.Beatmaps; using osu.Game.Database; @@ -28,6 +30,23 @@ public override void RecycleLocalStorage(bool isDisposing) stream.CopyTo(outStream); } + [SetUp] + public void SetUp() + { + if (RuntimeInfo.OS == RuntimeInfo.Platform.macOS && RuntimeInformation.OSArchitecture == Architecture.Arm64) + Assert.Ignore("EF-to-realm migrations are not supported on M1 ARM architectures."); + } + + public override void SetUpSteps() + { + // base SetUpSteps are executed before the above SetUp, therefore early-return to allow ignoring test properly. + // attempting to ignore here would yield a TargetInvocationException instead. + if (RuntimeInfo.OS == RuntimeInfo.Platform.macOS && RuntimeInformation.OSArchitecture == Architecture.Arm64) + return; + + base.SetUpSteps(); + } + [Test] public void TestMigration() {