Skip to content

Commit ccc4b89

Browse files
fix(tests): fix TestSceneHyperDashColouring TestSkin to use legacy resources (hasPear=true)
TestSkin was using null resource store, causing CatchLegacySkinTransformer to see hasPear=false and return null for the fruit component. This caused SkinnableDrawable to fall back to DefaultFruitPiece, which always uses DEFAULT_HYPER_DASH_COLOUR regardless of skin config. Fix: implement IStorageResourceProvider in the test scene and pass it to TestSkin, which now uses a NamespacedResourceStore pointing to the built-in legacy skin assets (Skins/Legacy). This makes hasPear=true, returning LegacyFruitPiece, which correctly reads hyper-dash colours from skin config. Also fix iOS CI workflow: resolve MacOSX.sdk symlink target to its canonical path (via python3 os.path.realpath) to prevent ELOOP (too many symlink levels) when the symlink target is itself a symlink chain. Agent-Logs-Url: https://github.com/winnerspiros/osu/sessions/18bebe86-a7b2-4d08-815c-3cad3370ec69 Co-authored-by: winnerspiros <1675249+winnerspiros@users.noreply.github.com>
1 parent b16e413 commit ccc4b89

2 files changed

Lines changed: 36 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,11 @@ jobs:
325325
ACTIVE_DEV="$(xcode-select -p)"
326326
ACTIVE_SDKS_DIR="$ACTIVE_DEV/Platforms/MacOSX.platform/Developer/SDKs"
327327
MACOS_SDK="$ACTIVE_SDKS_DIR/MacOSX.sdk"
328+
# Resolve REAL_SDK to its canonical (symlink-free) path to prevent ELOOP errors.
329+
REAL_SDK_CANON=$(python3 -c "import os, sys; print(os.path.realpath(sys.argv[1]))" "$REAL_SDK" 2>/dev/null || echo "$REAL_SDK")
328330
sudo rm -rf "$MACOS_SDK"
329-
sudo ln -sfn "$REAL_SDK" "$MACOS_SDK"
330-
echo "Created MacOSX.sdk symlink -> $REAL_SDK"
331+
sudo ln -sfn "$REAL_SDK_CANON" "$MACOS_SDK"
332+
echo "Created MacOSX.sdk symlink -> $REAL_SDK_CANON"
331333
else
332334
echo "WARNING: no valid macOS SDK found; build may fail"
333335
fi

osu.Game.Rulesets.Catch.Tests/TestSceneHyperDashColouring.cs

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,19 @@
77
using System.Numerics;
88
using NUnit.Framework;
99
using osu.Framework.Allocation;
10+
using osu.Framework.Audio;
1011
using osu.Framework.Graphics;
1112
using osu.Framework.Graphics.Containers;
13+
using osu.Framework.Graphics.Rendering;
1214
using osu.Framework.Graphics.Sprites;
15+
using osu.Framework.Graphics.Textures;
16+
using osu.Framework.IO.Stores;
17+
using osu.Framework.Platform;
1318
using osu.Framework.Testing;
1419
using osu.Game.Beatmaps;
1520
using osu.Game.Beatmaps.ControlPoints;
21+
using osu.Game.Database;
22+
using osu.Game.IO;
1623
using osu.Game.Rulesets.Catch.Objects;
1724
using osu.Game.Rulesets.Catch.Objects.Drawables;
1825
using osu.Game.Rulesets.Catch.Skinning;
@@ -23,23 +30,26 @@
2330

2431
namespace osu.Game.Rulesets.Catch.Tests
2532
{
26-
public partial class TestSceneHyperDashColouring : OsuTestScene
33+
public partial class TestSceneHyperDashColouring : OsuTestScene, IStorageResourceProvider
2734
{
2835
[Resolved]
2936
private SkinManager skins { get; set; }
3037

38+
[Resolved]
39+
private GameHost host { get; set; } = null!;
40+
3141
[Test]
3242
public void TestDefaultCatcherColour()
3343
{
34-
var skin = new TestSkin();
44+
var skin = new TestSkin(this);
3545

3646
checkHyperDashCatcherColour(skin, Catcher.DEFAULT_HYPER_DASH_COLOUR);
3747
}
3848

3949
[Test]
4050
public void TestCustomCatcherColour()
4151
{
42-
var skin = new TestSkin
52+
var skin = new TestSkin(this)
4353
{
4454
HyperDashColour = Colour4.Goldenrod
4555
};
@@ -50,7 +60,7 @@ public void TestCustomCatcherColour()
5060
[Test]
5161
public void TestCustomAfterImageColour()
5262
{
53-
var skin = new TestSkin
63+
var skin = new TestSkin(this)
5464
{
5565
HyperDashAfterImageColour = Colour4.Lime
5666
};
@@ -61,7 +71,7 @@ public void TestCustomAfterImageColour()
6171
[Test]
6272
public void TestCustomAfterImageColourPriority()
6373
{
64-
var skin = new TestSkin
74+
var skin = new TestSkin(this)
6575
{
6676
HyperDashColour = Colour4.Goldenrod,
6777
HyperDashAfterImageColour = Colour4.Lime
@@ -73,15 +83,15 @@ public void TestCustomAfterImageColourPriority()
7383
[Test]
7484
public void TestDefaultFruitColour()
7585
{
76-
var skin = new TestSkin();
86+
var skin = new TestSkin(this);
7787

7888
checkHyperDashFruitColour(skin, Catcher.DEFAULT_HYPER_DASH_COLOUR);
7989
}
8090

8191
[Test]
8292
public void TestCustomFruitColour()
8393
{
84-
var skin = new TestSkin
94+
var skin = new TestSkin(this)
8595
{
8696
HyperDashFruitColour = Colour4.Cyan
8797
};
@@ -92,7 +102,7 @@ public void TestCustomFruitColour()
92102
[Test]
93103
public void TestCustomFruitColourPriority()
94104
{
95-
var skin = new TestSkin
105+
var skin = new TestSkin(this)
96106
{
97107
HyperDashColour = Colour4.Goldenrod,
98108
HyperDashFruitColour = Colour4.Cyan
@@ -104,7 +114,7 @@ public void TestCustomFruitColourPriority()
104114
[Test]
105115
public void TestFruitColourFallback()
106116
{
107-
var skin = new TestSkin
117+
var skin = new TestSkin(this)
108118
{
109119
HyperDashColour = Colour4.Goldenrod
110120
};
@@ -209,10 +219,21 @@ public Colour4 HyperDashFruitColour
209219
set => Configuration.CustomColours[nameof(CatchSkinColour.HyperDashFruit)] = value;
210220
}
211221

212-
public TestSkin()
213-
: base(new SkinInfo(), null, null, string.Empty)
222+
public TestSkin(IStorageResourceProvider resources)
223+
: base(new SkinInfo(), resources, new NamespacedResourceStore<byte[]>(resources.Resources, "Skins/Legacy"), string.Empty)
214224
{
215225
}
216226
}
227+
228+
#region IStorageResourceProvider
229+
230+
IRenderer IStorageResourceProvider.Renderer => host.Renderer;
231+
AudioManager IStorageResourceProvider.AudioManager => Audio;
232+
IResourceStore<byte[]> IStorageResourceProvider.Files => null!;
233+
IResourceStore<byte[]> IStorageResourceProvider.Resources => base.Resources;
234+
IResourceStore<TextureUpload> IStorageResourceProvider.CreateTextureLoaderStore(IResourceStore<byte[]> underlyingStore) => host.CreateTextureLoaderStore(underlyingStore);
235+
RealmAccess IStorageResourceProvider.RealmAccess => null!;
236+
237+
#endregion
217238
}
218239
}

0 commit comments

Comments
 (0)