From 74016a14825b19343d6ca362b11fa297ae82c96e Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 7 Feb 2018 15:57:16 +0900 Subject: [PATCH 1/9] Make sure the import tests exit their hosts --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index ece1f626ec..5398fb3ff3 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -37,6 +37,8 @@ namespace osu.Game.Tests.Beatmaps.IO ensureLoaded(osu); waitForOrAssert(() => !File.Exists(temp), "Temporary file still exists after standard import", 5000); + + host.Exit(); } } @@ -64,6 +66,9 @@ namespace osu.Game.Tests.Beatmaps.IO ensureLoaded(osu); waitForOrAssert(() => !File.Exists(temp), "Temporary still exists after IPC import", 5000); + + host.Exit(); + client.Exit(); } } @@ -86,6 +91,8 @@ namespace osu.Game.Tests.Beatmaps.IO File.Delete(temp); Assert.IsFalse(File.Exists(temp), "We likely held a read lock on the file when we shouldn't"); + + host.Exit(); } } From b66d089400134245656d076f35cfc5dd8e367d78 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 7 Feb 2018 17:12:12 +0900 Subject: [PATCH 2/9] Always put attributes on a separate line to their target --- osu.sln.DotSettings | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.sln.DotSettings b/osu.sln.DotSettings index 8767e5374a..3b62dbe579 100644 --- a/osu.sln.DotSettings +++ b/osu.sln.DotSettings @@ -173,7 +173,9 @@ NEXT_LINE True NEVER + NEVER False + NEVER False True False From a7aaaf90888e1dc473fa272e59a781048d635117 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 12:43:17 +0900 Subject: [PATCH 3/9] Update framework --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 1440ae8538..2d6169fc07 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 1440ae8538560b3c40883ec51ab39108d6a69e3b +Subproject commit 2d6169fc07fdd50b8ce31d3a9124b4ec0123bdd1 From 4f5bfdb888bce2c73afaf1578615d0ac32d83b17 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:03:37 +0900 Subject: [PATCH 4/9] Remove explicit .Exit on IPC test --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 5398fb3ff3..490d4ec4d3 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -68,7 +68,6 @@ namespace osu.Game.Tests.Beatmaps.IO waitForOrAssert(() => !File.Exists(temp), "Temporary still exists after IPC import", 5000); host.Exit(); - client.Exit(); } } From 48918b5324be01a24db5ead9fe7afed46d8ffd63 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 14:07:12 +0900 Subject: [PATCH 5/9] Bring framework up-to-date --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 2d6169fc07..eba12eb4a0 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 2d6169fc07fdd50b8ce31d3a9124b4ec0123bdd1 +Subproject commit eba12eb4a0fa6238873dd266deb35bfdece21a6a From c213e58effd6edd44de3c298f5068616f3c5d80a Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 8 Feb 2018 14:40:35 +0900 Subject: [PATCH 6/9] Make slider tails not play hitsounds --- osu.Game.Rulesets.Osu/Objects/Slider.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs index 3bde7e790b..5dd3d7aa89 100644 --- a/osu.Game.Rulesets.Osu/Objects/Slider.cs +++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs @@ -123,9 +123,7 @@ namespace osu.Game.Rulesets.Osu.Objects StartTime = EndTime, Position = StackedEndPosition, IndexInCurrentCombo = IndexInCurrentCombo, - ComboColour = ComboColour, - Samples = Samples, - SampleControlPoint = SampleControlPoint + ComboColour = ComboColour }; AddNested(HeadCircle); From cafa605b90e6d34c30bdc687bfd9de0733efbe7a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 14:43:07 +0900 Subject: [PATCH 7/9] Fix visual settings checkboxes playing sounds in bindable binding Move sound binding to much later in the process to avoid programmatic checkbox changes triggering interaction sounds --- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 5e7dda8713..f06313c261 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -76,6 +76,16 @@ namespace osu.Game.Graphics.UserInterface Nub.Current.BindTo(Current); + Current.DisabledChanged += disabled => + { + Alpha = disabled ? 0.3f : 1; + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Current.ValueChanged += newValue => { if (newValue) @@ -83,11 +93,6 @@ namespace osu.Game.Graphics.UserInterface else sampleUnchecked?.Play(); }; - - Current.DisabledChanged += disabled => - { - Alpha = disabled ? 0.3f : 1; - }; } protected override bool OnHover(InputState state) From 789e25069fb3860b69db9c579b178613dab7b32d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 17:07:18 +0900 Subject: [PATCH 8/9] Fix non-visual tests not cleaning up previous executions --- .../Beatmaps/IO/ImportBeatmapTest.cs | 9 ++++----- osu.Game/Tests/CleanRunHeadlessGameHost.cs | 19 +++++++++++++++++++ osu.Game/Tests/Visual/OsuTestCase.cs | 6 +----- osu.Game/osu.Game.csproj | 1 + 4 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 osu.Game/Tests/CleanRunHeadlessGameHost.cs diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 490d4ec4d3..1ee8f6728a 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tests.Beatmaps.IO public void TestImportWhenClosed() { //unfortunately for the time being we need to reference osu.Framework.Desktop for a game host here. - using (HeadlessGameHost host = new HeadlessGameHost("TestImportWhenClosed")) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("TestImportWhenClosed")) { var osu = loadOsu(host); @@ -44,11 +44,10 @@ namespace osu.Game.Tests.Beatmaps.IO [Test] [NonParallelizable] - [Ignore("Binding IPC on Appveyor isn't working (port in use). Need to figure out why")] public void TestImportOverIPC() { - using (HeadlessGameHost host = new HeadlessGameHost("host", true)) - using (HeadlessGameHost client = new HeadlessGameHost("client", true)) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("host", true)) + using (HeadlessGameHost client = new CleanRunHeadlessGameHost("client", true)) { Assert.IsTrue(host.IsPrimaryInstance); Assert.IsFalse(client.IsPrimaryInstance); @@ -74,7 +73,7 @@ namespace osu.Game.Tests.Beatmaps.IO [Test] public void TestImportWhenFileOpen() { - using (HeadlessGameHost host = new HeadlessGameHost("TestImportWhenFileOpen")) + using (HeadlessGameHost host = new CleanRunHeadlessGameHost("TestImportWhenFileOpen")) { var osu = loadOsu(host); diff --git a/osu.Game/Tests/CleanRunHeadlessGameHost.cs b/osu.Game/Tests/CleanRunHeadlessGameHost.cs new file mode 100644 index 0000000000..b6ff6dcf84 --- /dev/null +++ b/osu.Game/Tests/CleanRunHeadlessGameHost.cs @@ -0,0 +1,19 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Platform; + +namespace osu.Game.Tests +{ + /// + /// A headless host which cleans up before running (removing any remnants from a previous execution). + /// + public class CleanRunHeadlessGameHost : HeadlessGameHost + { + public CleanRunHeadlessGameHost(string gameName = @"", bool bindIPC = false, bool realtime = true) + : base(gameName, bindIPC, realtime) + { + Storage.DeleteDirectory(string.Empty); + } + } +} diff --git a/osu.Game/Tests/Visual/OsuTestCase.cs b/osu.Game/Tests/Visual/OsuTestCase.cs index f9f198a5c1..97aada2971 100644 --- a/osu.Game/Tests/Visual/OsuTestCase.cs +++ b/osu.Game/Tests/Visual/OsuTestCase.cs @@ -2,7 +2,6 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System; -using osu.Framework.Platform; using osu.Framework.Testing; namespace osu.Game.Tests.Visual @@ -11,11 +10,8 @@ namespace osu.Game.Tests.Visual { public override void RunTest() { - using (var host = new HeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) - { - host.Storage.DeleteDirectory(string.Empty); + using (var host = new CleanRunHeadlessGameHost($"test-{Guid.NewGuid()}", realtime: false)) host.Run(new OsuTestCaseTestRunner(this)); - } } public class OsuTestCaseTestRunner : OsuGameBase diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index a5c3fc7f38..bb9925abbc 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -855,6 +855,7 @@ + From d8da68c55fc2bb5dd22ffb22610dc81b81092f70 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 17:22:23 +0900 Subject: [PATCH 9/9] Disable test again (accidentally re-enabled) --- osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs index 1ee8f6728a..0b49bc8bb9 100644 --- a/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs +++ b/osu.Game.Tests/Beatmaps/IO/ImportBeatmapTest.cs @@ -44,6 +44,7 @@ namespace osu.Game.Tests.Beatmaps.IO [Test] [NonParallelizable] + [Ignore("Binding IPC on Appveyor isn't working (port in use). Need to figure out why")] public void TestImportOverIPC() { using (HeadlessGameHost host = new CleanRunHeadlessGameHost("host", true))