1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00
Commit Graph

1063 Commits

Author SHA1 Message Date
Salman Ahmed
8e992de763 Fix crash when loading player instance without exiting previous instance 2023-09-19 05:09:01 +03:00
Bartłomiej Dach
47764b3012
Fix OsuTestScene.CreateAPIBeatmapSet() not backlinking set beatmaps to the set 2023-09-18 14:56:06 +02:00
Dean Herbert
56b5f52e83 Update all dependencies (except for Moq) 2023-09-16 15:37:31 +09:00
Bartłomiej Dach
ebdc501e5b
Add example scenarios and configurable score multiplier 2023-09-15 12:58:29 +02:00
Bartłomiej Dach
5eccc771c2
Turn off non-perfect judgements for catch scoring test scene 2023-09-15 12:58:29 +02:00
Bartłomiej Dach
0c22ff2a80
Refactor further to allow extensibility to other rulesets 2023-09-15 12:58:29 +02:00
Bartłomiej Dach
45751dd1f2
Minimum viable changes for ruleset-specific scoring test scenes 2023-09-15 12:58:29 +02:00
Dean Herbert
0f5eff1230 Merge branch 'master' into mania-edit-disable-sv 2023-09-01 19:08:48 +09:00
Bartłomiej Dach
5454d1caa1
Remove global action container input queue workaround
As described in #24248, the workaround employed by
`GlobalActionContainer`, wherein it tried to handle actions with
priority before its children by being placed in front of the children
and not _actually containing_ said children, is blocking the resolution
of some rather major input handling issues that allow key releases to be
received by deparented drawables.

To resolve, migrate `GlobalActionContainer` to use `Prioritised`, which
can be done without regressing certain mouse button flows after
ppy/osu-framework#5966.
2023-08-21 17:54:08 +02:00
Dan Balasescu
a2fd7707a1 Allow toggling SVs in the editor 2023-08-18 18:55:24 +09:00
Dean Herbert
56eb44d15b Change TestSpectatorClient to provide some better fake data for score / acc 2023-08-16 17:14:42 +09:00
Bartłomiej Dach
0ecfb7b36f
Remove unused field 2023-07-08 15:03:33 +02:00
Dean Herbert
04a1550215 Redesign "local input" toggle in manual input tests to be more user-friendly
- Only displays when required (there's literally zero case we want to
  return input to the test, as this is automatic on next action)
- No longer hugs the right side of the screen (blocking visibility of
  some tests).
2023-07-07 13:32:16 +09:00
Dean Herbert
0ab0c52ad5 Automated pass 2023-06-24 01:00:03 +09:00
Bartłomiej Dach
58507291b9
Apply NRT in MemoryCachingComponent test-only subclasses 2023-06-09 13:48:42 +02:00
Bartłomiej Dach
474f7c2bc0
Fix code quality inspection 2023-06-03 16:50:58 +02:00
Bartłomiej Dach
a9d4556647
Merge branch 'master' into update-multiplayer-room-diff-range 2023-06-03 16:50:09 +02:00
Dean Herbert
7a5349d747 Remove constructor from MultiplayerPlaylistItem which is only used in tests 2023-05-25 20:09:40 +09:00
Dan Balasescu
6c6f8621c1 Add score processor statistics to replay header 2023-05-19 16:29:24 +09:00
Dan Balasescu
d2380bd840 Remove usages of [ExcludeFromDynamicCompile] 2023-05-08 18:12:56 +09:00
Bartłomiej Dach
8ab3a87b13
Add failing test case covering online ID reset on save
This test scene passes at e58e1151f3 and
fails at current master, due to an inadvertent regression caused by
e72f103c17.

As it turns out, the online lookup flow that was causing UI thread
freezes when saving beatmaps in the editor, was also responsible for
resetting the online ID of locally-modified beatmaps if online lookup
failed.
2023-05-01 18:17:35 +02:00
Bartłomiej Dach
6afa65bd3d
Merge branch 'master' into skinnable-clean-up-documentation 2023-02-17 20:59:18 +01:00
Dean Herbert
7afdcb9383 Merge branch 'master' into hide-resume-overlay 2023-02-16 15:42:14 +09:00
Dean Herbert
a92e42bb84 Rename SkinnableTargetContainer to SkinComponentsContainer
Also use full `SkinComponentsContainerLookup` instead of the sub-type.
This will potentially be useful once we bring in per-ruleset targets.
2023-02-15 18:37:41 +09:00
Dean Herbert
9e04a36d86 Move test to a mod test and add more resilient test logic 2023-02-14 15:07:45 +09:00
Dean Herbert
96fbd04698 Add failing test coverage of skip no longer working in replay playback 2023-02-10 18:57:04 +09:00
Joseph Madamba
f1decb667e Address todos relating to init-only usages 2023-02-08 17:51:28 -08:00
Dean Herbert
a77baf8717 Output gameplay clock progress in PlayerTestScenes 2023-02-01 23:42:44 +09:00
Dean Herbert
1e5dd9165a Adjust SkinnableTestScene to give more breathing room to RelativeSize components 2023-01-18 15:37:46 +09:00
Dean Herbert
53e7873f6c
Merge branch 'master' into fix-pause-gameplay-action-not-closing 2023-01-17 17:41:16 +09:00
Joseph Madamba
08c570849f Simplify container logic 2023-01-16 23:24:47 -08:00
Salman Ahmed
13c1b8f5a4 Fix intermittent failure in tests with restarting player instances 2023-01-15 16:06:06 +03:00
Joseph Madamba
776b60f3b3 Fix manual input manager test scenes not matching game input hierarchy
Fix popover using on key down

Fix popover not expiring when using global action
2023-01-10 15:35:26 -08:00
Bartłomiej Dach
a82f1a6abd
Adjust method naming and copy 2023-01-01 18:50:47 +01:00
Bartłomiej Dach
0e59b55a12
Merge branch 'master' into previewTime 2023-01-01 18:38:19 +01:00
Dean Herbert
4a7d7c6ed9 Use MaxBy in all locations that can and update inspection level to match dotnet-build 2022-12-19 16:47:10 +09:00
cdwcgt
a4d28aff6d
fix typo 2022-12-16 10:48:56 +09:00
cdwcgt
984f0b5fa9
Add test for set preview point 2022-12-16 01:35:54 +09:00
Dan Balasescu
caa0b7c290 Move score token to BeginPlaying 2022-12-12 13:59:27 +09:00
Dean Herbert
61c702c02e Add new IDependencyInjectionCandidate interface to non-drawable cached classes 2022-11-29 14:45:26 +09:00
Bartłomiej Dach
894ef15e79
Merge branch 'master' into update-framework 2022-11-26 16:19:36 +01:00
Dan Balasescu
7bc8908ca9 Partial everything 2022-11-27 00:00:27 +09:00
Dean Herbert
53b03df93d Combine TriangleButton and RoundedButton classes 2022-11-24 16:26:57 +09:00
Dean Herbert
4d4f6e25ba Rename to "clone" instead of "duplicate" 2022-10-25 11:43:23 +09:00
Dean Herbert
da74690ec9 Add test coverage of clone operations 2022-10-25 11:38:58 +09:00
Dean Herbert
a7d4a74ed6
Update osu.Game/Tests/Visual/ScrollingTestContainer.cs
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2022-10-20 08:07:56 +09:00
Dean Herbert
d237c818f6 Fix nested objects in overlapping scrolling hit object container ruleset not using correct reference time 2022-10-18 16:15:21 +09:00
Salman Ahmed
241ecb63a1 Hide manual input manager cursor in OsuGameTestScenes
Allows checking that the cursor is actually hidden in
`TestSceneOsuGame.TestCursorHidesWhenIdle`.
2022-10-15 00:20:22 +03:00
Dan Balasescu
1811647e34 Make room requests handler handle GetBeatmapRequest 2022-09-27 20:30:41 +09:00
Salman Ahmed
8aff856c79 Fix SkinnableTestScene sizing logic potentially failing to work 2022-09-27 05:18:17 +03:00
Dean Herbert
4492a26b59
Merge branch 'master' into argon-skin 2022-09-21 13:00:16 +09:00
Dan Balasescu
8bf196d561
Merge pull request #20354 from peppy/default-skin-refactor
Rename default skin to make way for new version
2022-09-21 11:48:38 +09:00
Dean Herbert
0f7b38f4c3 Add new default skin "argon" 2022-09-19 23:16:46 +09:00
Dean Herbert
494790294a Update SkinnableTestScene to show new default skin 2022-09-19 12:38:34 +09:00
Dean Herbert
454125123d Add failing test coverage showing mod reference leak path 2022-09-19 12:18:35 +09:00
Dean Herbert
d0b8409de5 Apply more renames 2022-09-18 18:19:00 +09:00
Dean Herbert
41e69fbca6 Remove "default" prefix from naming 2022-09-18 00:15:26 +09:00
Dean Herbert
51841988bf Rename references to DefaultSkin to have Triangles suffix 2022-09-17 23:57:25 +09:00
Dean Herbert
c7f8f948b9 Rename CreateLegacySkinProvider to CreateSkinTransformer and apply to all skins 2022-09-15 20:18:10 +09:00
Dean Herbert
3b116a1a47 Fix mods not being set on BeginPlayingInternal 2022-09-08 13:17:27 +09:00
Dean Herbert
770c1ade2f Add test coverage of track rate adjusting during multi spectator 2022-09-07 20:00:24 +09:00
Dean Herbert
c9dec473d3 Update virtual track logic to match framework changes 2022-09-01 23:05:07 +09:00
Dean Herbert
6a35b233e5 Merge branch 'master' into remove-dispose-updates 2022-09-01 23:03:19 +09:00
Dean Herbert
a215d009fe Update Remove/RemoveRange/RemoveAll calls in line with framework changes 2022-08-29 15:57:40 +09:00
Dean Herbert
4b72e55770 Fix various test scenes not adding EditorClock to the draw hierarchy 2022-08-26 18:08:43 +09:00
Dean Herbert
106932b906 Add null check in TestPlayer's disposal code to avoid cascading test failure 2022-08-09 18:15:50 +09:00
Dan Balasescu
00bdd52cff Move to TestPlayer and add null check 2022-08-09 15:05:40 +09:00
Dan Balasescu
b4e55f7309 Apply IRenderer changes 2022-08-02 19:50:57 +09:00
Dan Balasescu
aaa6f963bd Fix potential test failures due to Setup/SetUpSteps ordering 2022-07-29 15:27:39 +09:00
Dean Herbert
a21aee4e9c Reduce calls to LoadTrack by implicitly running on test/dummy classes 2022-07-28 18:11:40 +09:00
Dean Herbert
2b9d46d803 Remove unused RulesetStore from BeatmapManager constructor 2022-07-28 16:19:05 +09:00
Dean Herbert
ef10145d6f Rename MenuCursorContainer and clean up code 2022-07-26 14:11:52 +09:00
Salman Ahmed
840ad8fad2 Fix background beatmap processor resetting star ratings in tests 2022-07-23 11:10:59 +03:00
Salman Ahmed
728487b7fb Handle GetBeatmapSetRequest on test room requests handler
Required for `BeatmapSetOverlay` lookups to work under dummy API. Not
100% sure about it, but works for now.
2022-07-14 02:34:55 +03:00
Dean Herbert
5651eca06c Merge branch 'master' into custom-ruleset-score-import 2022-07-08 19:03:47 +09:00
Dean Herbert
13e16530a6 Revert most changes to PlayerTestScene 2022-07-08 18:45:18 +09:00
Dean Herbert
e64b2b1682 Assert that test is run headless when required 2022-07-08 15:45:01 +09:00
Dean Herbert
7ef03dd2cb Use fire-and-forget async operations on global track
This avoids any blocking overhead caused by a backlogged audio thread.
Test seem to pass so might be okay?

Note that order is still guaranteed due to the `ensureUpdateThread`
queueing system framework-side.
2022-07-07 17:15:45 +09:00
Dean Herbert
1a41d3ef20 Allow PlayerTestScene to import the beatmap it's using 2022-07-07 16:42:36 +09:00
Dan Balasescu
084a65578c Always clone messages incoming from client-side 2022-07-01 19:36:37 +09:00
Dan Balasescu
37acec1952 Isolate client's LocalUser from TestMultiplayerClient 2022-07-01 19:23:41 +09:00
Dan Balasescu
b64c0d011c Isolate client's Room from TestMultiplayerClient 2022-07-01 19:23:25 +09:00
Dan Balasescu
0be858b5bf Rename APIRoom -> ClientAPIRoom, remove unused asserts 2022-07-01 19:21:59 +09:00
Dan Balasescu
1c2ffb3bc4 Fix server-side objects being sent to client 2022-07-01 19:21:53 +09:00
Dean Herbert
35745c83b7 Replace dodgy SetUpSteps overriding with usage of HasCustomSteps 2022-06-28 15:19:02 +09:00
Dean Herbert
54fe6b7df3
Fix incorrect string interpolation
Co-authored-by: Bartłomiej Dach <dach.bartlomiej@gmail.com>
2022-06-28 01:43:09 +09:00
Dean Herbert
569fde4b47 Add messages to all InvalidOperationExceptions
Without this, they can be very non-descript and hard to track down
2022-06-28 01:34:25 +09:00
Dean Herbert
5a7d339cc8 Centralise and harden editor-ready-for-use check
Not only does this combine the check into one location, but it also adds
a check on the global `WorkingBeatmap` being updated, which is the only
way I can see the following failure happening:

```csharp
05:19:07     osu.Game.Tests: osu.Game.Tests.Visual.Editing.TestSceneEditorBeatmapCreation.TestAddAudioTrack
05:19:07       Failed TestAddAudioTrack [161 ms]
05:19:07       Error Message:
05:19:07        TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
05:19:07       Stack Trace:
05:19:07       --TearDown
05:19:07        at osu.Game.Database.ModelManager`1.<>c__DisplayClass7_0.<AddFile>b__0(TModel managed) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 36
05:19:07        at osu.Game.Database.ModelManager`1.<>c__DisplayClass8_0.<performFileOperation>b__0(Realm realm) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 49
05:19:07        at osu.Game.Database.RealmExtensions.Write(Realm realm, Action`1 function) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\RealmExtensions.cs:line 14
05:19:07        at osu.Game.Database.ModelManager`1.performFileOperation(TModel item, Action`1 operation) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 46
05:19:07        at osu.Game.Database.ModelManager`1.AddFile(TModel item, Stream contents, String filename) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Database\ModelManager.cs:line 36
05:19:07        at osu.Game.Screens.Edit.Setup.ResourcesSection.ChangeAudioTrack(FileInfo source) in C:\BuildAgent\work\ecd860037212ac52\osu.Game\Screens\Edit\Setup\ResourcesSection.cs:line 115
05:19:07        at osu.Game.Tests.Visual.Editing.TestSceneEditorBeatmapCreation.<TestAddAudioTrack>b__13_0() in C:\BuildAgent\work\ecd860037212ac52\osu.Game.Tests\Visual\Editing\TestSceneEditorBeatmapCreation.cs:line 101
05:19:07        at osu.Framework.Testing.Drawables.Steps.AssertButton.checkAssert()
05:19:07        at osu.Framework.Testing.Drawables.Steps.StepButton.PerformStep(Boolean userTriggered)
05:19:07        at osu.Framework.Testing.TestScene.runNextStep(Action onCompletion, Action`1 onError, Func`2 stopCondition)
```
2022-06-27 16:22:01 +09:00
Dean Herbert
1a22377e19 Fix test deadlock due to TPL threadpool saturation
As found in aggressive CI runs:

```csharp
00007F6F527F32B0 00007f74f937c72d (MethodDesc 00007f74f5545a78 + 0x22d System.Threading.ManualResetEventSlim.Wait(Int32, System.Threading.CancellationToken)), calling (MethodDesc 00007f74f51c0838 + 0 System.Threading.Monitor.Wait(System.Object, Int32))
00007F6F527F3330 00007f74f93861ca (MethodDesc 00007f74f5259100 + 0x10a System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken)), calling (MethodDesc 00007f74f5545a78 + 0 System.Threading.ManualResetEventSlim.Wait(Int32, System.Threading.CancellationToken))
00007F6F527F3390 00007f74f9385d11 (MethodDesc 00007f74f52590e8 + 0x81 System.Threading.Tasks.Task.InternalWaitCore(Int32, System.Threading.CancellationToken)), calling (MethodDesc 00007f74f5259100 + 0 System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken))
00007F6F527F33E0 00007f74fc3823af (MethodDesc 00007f74f5934c08 + 0x4f System.Threading.Tasks.Task`1[[System.Boolean, System.Private.CoreLib]].GetResultCore(Boolean)), calling (MethodDesc 00007f74f52590e8 + 0 System.Threading.Tasks.Task.InternalWaitCore(Int32, System.Threading.CancellationToken))
00007F6F527F3400 00007f74fb0aad92 (MethodDesc 00007f74fb28b000 + 0x122 osu.Game.Tests.Visual.OnlinePlay.OnlinePlayTestScene+<>c__DisplayClass21_0.<Setup>b__1(osu.Game.Online.API.APIRequest)), calling (MethodDesc 00007f74f5934be8 + 0 System.Threading.Tasks.Task`1[[System.Boolean, System.Private.CoreLib]].get_Result())
00007F6F527F3470 00007f74fa9c6dd7 (MethodDesc 00007f74f921f6c8 + 0x77 osu.Game.Online.API.DummyAPIAccess.PerformAsync(osu.Game.Online.API.APIRequest))
00007F6F527F34C0 00007f74fb13c718 (MethodDesc 00007f74fb4e0c50 + 0x538 osu.Game.Database.OnlineLookupCache`3+<performLookup>d__13[[System.Int32, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib],[System.__Canon, System.Private.CoreLib]].MoveNext())
```

Going with the simplest solution, as what we had was pretty ugly to start with and I don't want to overthink this, just push a fix and hope for the best.
2022-06-26 16:42:29 +09:00
Dean Herbert
31a447fda0 Update parameter discards 2022-06-24 21:26:19 +09:00
Dean Herbert
158f0a1f23 Remove remaining Room!=null checks in TestMultiplayerClient where possible 2022-06-23 17:38:34 +09:00
Dean Herbert
bc557bacf0 Remove room null assertion in TestMultiplayerClient.ChangeState to avoid assert
This method is run from async contexts, but `get_Room` asserts update
thread which is not the case. Was causing silent test failures (showing
as pass but failing `dotnet-test` via return code):

TestSceneMultiplayer.TestGameplayFlow

```
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: Score preparation failed!
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: NUnit.Framework.AssertionException: :
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Framework.Logging.ThrowingTraceListener.Fail(String message1, String message2)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at System.Diagnostics.TraceInternal.Fail(String message, String detailMessage)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at System.Diagnostics.TraceInternal.TraceProvider.Fail(String message, String detailMessage)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at System.Diagnostics.Debug.Fail(String message, String detailMessage)
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Online.Multiplayer.MultiplayerClient.get_Room() in /opt/buildagent/work/ecd860037212ac52/osu.Game/Online/Multiplayer/MultiplayerClient.cs:line 98
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Tests.Visual.Multiplayer.TestMultiplayerClient.ChangeState(MultiplayerUserState newState) in /opt/buildagent/work/ecd860037212ac52/osu.Game/Tests/Visual/Multiplayer/TestMultiplayerClient.cs:line 275
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Screens.OnlinePlay.Multiplayer.MultiplayerPlayer.PrepareScoreForResultsAsync(Score score) in /opt/buildagent/work/ecd860037212ac52/osu.Game/Screens/OnlinePlay/Multiplayer/MultiplayerPlayer.cs:line 223
[13:13:17] :         [dotnet test] [runtime] 2022-06-22 13:13:16 [error]: at osu.Game.Screens.Play.Player.prepareScoreForResults() in /opt/buildagent/work/ecd860037212ac52/osu.Game/Screens/Play/Player.cs:line 747
```
2022-06-23 14:10:20 +09:00
Bartłomiej Dach
21d60231b6
Add limited test coverage of osu:// scheme link IPC flow 2022-06-20 22:22:25 +02:00
Dan Balasescu
f8830c6850 Automated #nullable processing 2022-06-17 16:37:17 +09:00
Bartłomiej Dach
9c4f6d2ce0
Merge branch 'master' into first-run-setup-notification-interruption 2022-06-16 15:14:40 +02:00
Dean Herbert
8a5755ca52 Remove pointless override in test implementation 2022-06-16 18:27:16 +09:00
Dean Herbert
1f3e1b2d97 Combine BeatmapManager and BeatmapModelManager into one class 2022-06-16 18:07:04 +09:00
Salman Ahmed
1171d44ad9 Add failing test case 2022-06-15 03:37:04 +03:00
Dean Herbert
f11fe54385 Remove custom hash function flow 2022-06-15 00:42:30 +09:00
Dan Balasescu
3df4d1b0e6 Fix incorrect HasPassword value for returned rooms 2022-06-03 21:17:48 +09:00