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

207 Commits

Author SHA1 Message Date
Dean Herbert
892f43da43 Add test coverage of ruleset being marked unavailable if methods are throwing 2022-08-29 14:28:55 +09:00
Dean Herbert
5ff4e6a4fe Add test coverage for outdated ruleset 2022-08-29 14:26:12 +09:00
Dean Herbert
ee68113913 Add more missing realm Refresh() calls to new beatmap import tests
As noticed at https://github.com/ppy/osu/runs/7605101313?check_suite_focus=true
2022-08-01 17:06:46 +09:00
Dan Balasescu
a59d7f6710
Merge branch 'master' into collections-track-beatmap-updates 2022-07-28 22:05:34 +09:00
Dan Balasescu
6d4023b933 Adjust comment 2022-07-28 16:56:11 +09:00
Dean Herbert
67c44552cb Add realm Refresh calls to ensure tests are stable 2022-07-28 15:18:04 +09:00
Dean Herbert
485d140a21 Add realm refresh calls to fix intermittent test failures on new update tests 2022-07-28 15:15:41 +09:00
Dean Herbert
2ae5a34c0e Add test coverage of beatmap updates transferring collection hashes 2022-07-28 15:02:58 +09:00
Dean Herbert
494486ad09 Fix potential test failure if scores are added to the beatmap which is subsequently removed 2022-07-27 16:27:10 +09:00
Dean Herbert
7f75184a01
Merge branch 'master' into beatmap-update-test 2022-07-26 17:27:36 +09:00
Dean Herbert
ee694c1257 Add test coverage of no online ID scenario 2022-07-26 17:27:23 +09:00
Dean Herbert
1221cb1a42 Add comprehensive test coverage of update scenarios 2022-07-26 17:22:52 +09:00
Dean Herbert
846291d203 Refactor new tests to not suck as much as the old importer tests 2022-07-26 16:33:00 +09:00
Dean Herbert
8370ca9765 Add ImportAsUpdate method to IModelImporter to avoid otehr changes 2022-07-26 15:49:04 +09:00
Dean Herbert
ac553d22ea Fix left over resource file which isn't actually imported 2022-07-26 15:08:18 +09:00
Dean Herbert
59d3cc52c4 Avoid leaving left-over files after test run completes 2022-07-26 15:08:18 +09:00
Dean Herbert
7d8a78ef01 Move tests to own class 2022-07-26 14:53:20 +09:00
Dean Herbert
9c411c2250 Fix test nullability assertions 2022-07-25 20:06:37 +09:00
Dean Herbert
92dd1bcddb Add test coverage of actual update flow 2022-07-25 19:51:19 +09:00
Dean Herbert
6a3e8e31de Centralise calls to reset online info of a BeatmapInfo 2022-07-25 19:51:19 +09:00
Dean Herbert
ec477a3ebf Add basic coverage of current behaviour of beatmap reimport 2022-07-25 19:51:19 +09:00
Dean Herbert
1374738a0d Add test coverage 2022-07-21 18:20:46 +09:00
Dean Herbert
bf10f2db2e Add test coverage of nested rollback for good measure 2022-07-07 18:19:01 +09:00
Dean Herbert
ac216d94a8 Fix transaction not being disposed 2022-07-07 18:15:38 +09:00
Dean Herbert
5197d0fa9e Add automatic transaction handling to realm helper methods 2022-07-07 17:36:25 +09:00
Dean Herbert
4fd47b5fa0 Add more verbose logging to realm blocking process 2022-07-02 12:36:56 +09:00
Dan Balasescu
3b1842a2c2
Merge pull request #18835 from peppy/beatmap-update-flow
Split out beatmap update tasks to `BeatmapUpdater` and invoke from editor save flow
2022-07-01 20:28:04 +09:00
Dean Herbert
447b496eff
Merge branch 'master' into realm-fix-async-write-after-disposal 2022-06-30 19:07:15 +09:00
Dean Herbert
98938821e5 Merge branch 'master' into beatmap-update-flow 2022-06-30 16:44:17 +09:00
Dean Herbert
0abb400f64 Add reproduction of transaction not being exited correctly 2022-06-30 15:15:09 +09:00
Dean Herbert
a3b4a515fc Merge branch 'master' into realm-fix-async-write-after-disposal 2022-06-29 22:39:05 +09:00
Dean Herbert
d64959ad0c Add test coverage of async writes during a blocking operation 2022-06-28 17:07:49 +09:00
Dean Herbert
6203885040 Add test coverage of realm async writes 2022-06-27 19:38:14 +09:00
Dean Herbert
1fc4fa6820 Remove unnecessary Task.Run workaround in tests 2022-06-27 19:21:05 +09:00
Dean Herbert
5af1106fa5 Remove unused using statement 2022-06-27 18:04:52 +09:00
Dean Herbert
8c3c1f095e Update rollback test expectations
I can't find a better way to do this. It's very hard to trigger an
actual failure in the import process these days. For now I've just made
this work with the new assumptions. May be worth removing the test in
the future if this ever backfires.
2022-06-27 17:04:35 +09:00
Dean Herbert
31a447fda0 Update parameter discards 2022-06-24 21:26:19 +09:00
Dean Herbert
06d59b717c Move beatmap processing tasks to new BeatmapUpdater class 2022-06-24 21:02:37 +09:00
Dean Herbert
7ef8b7df5f Add timeout for all ManualResetEventSlim.Wait invocations
Timeout values were taken as best-guesses of upper values we'd expect
from sane execution.
2022-06-23 14:46:00 +09:00
Dan Balasescu
c402e90598
Merge pull request #18777 from peppy/output-directory-on-import-failure
Silence exception and provide more log output when import fails due to empty `.osu` files
2022-06-20 17:36:21 +09:00
Dean Herbert
e82d948acc Add test coverage of import throwing when no valid .osu files are found 2022-06-20 16:06:22 +09:00
Dean Herbert
92f1a2958c Rename Import(TModel) to ImportModel to differentiate from other import methods 2022-06-20 15:18:07 +09:00
Dean Herbert
a6c8a832aa Remove Import(ArchiveReader) and redirect existing usages to Import(ImportTask) 2022-06-20 15:14:57 +09:00
Dan Balasescu
f8830c6850 Automated #nullable processing 2022-06-17 16:37:17 +09:00
Dean Herbert
f3984d98e6 Remove RealmArchiveModelManager from hierarchy 2022-06-16 18:53:13 +09:00
Dean Herbert
84dba36cf5 Update usages of BeatmapModelManager which only require importing to use BeatmapImporter 2022-06-16 17:59:24 +09:00
Dean Herbert
f23ddfe6cc Move remaining realm classes out of Stores namespace 2022-06-15 21:56:00 +09:00
Dean Herbert
080f2859ef
Merge pull request #18689 from peppy/quick-import-only-on-batch
Always perform full consistency checks for single imports
2022-06-15 17:06:06 +09:00
Salman Ahmed
3d638abc52 Fix test files stream not disposed after creation 2022-06-15 08:24:20 +03:00
Salman Ahmed
ee8045d507 Add failing test case 2022-06-15 07:33:21 +03:00
Dean Herbert
cac724f436 Re-enable ignored tests that will work again now 2022-06-15 00:51:08 +09:00
Dean Herbert
f11fe54385 Remove custom hash function flow 2022-06-15 00:42:30 +09:00
Dean Herbert
1b4c89c418 Update realm to latest version
Contains minor changes to async usage in line with upstream API changes.

I believe a feedback issue we were seeing with offset changes (the only
component using async write flow) may have been resolved by these
upstream changes (see [release
notes](https://github.com/realm/realm-dotnet/releases/tag/10.14.0)) but
am not investigating further just yet.
2022-06-03 14:16:10 +09:00
Dean Herbert
218642c300 Update unsafe file write usages 2022-05-16 18:05:27 +09:00
Dean Herbert
87f6f74795 Add failing test coverage of adding a file to a detached beatmap across threads 2022-05-10 21:04:30 +09:00
Dean Herbert
975883da5c Move all usages of client.realm filename to a single const 2022-03-30 13:34:48 +09:00
Dean Herbert
4d0b4c2541 Fix realm potentially not being refreshed in time for test asserts in BeatmapImporterTests
As seen at https://github.com/ppy/osu/runs/5659368512?check_suite_focus=true

Went through every usage of `.Import` and added either an
`EnsureLoaded`, or where that provides too many checks, an explicit
`realm.Refresh()`.
2022-03-24 12:59:17 +09:00
Dean Herbert
0fcb3bdba9 Fix beatmap date added not being updated on reimporting a soft deleted beatmap
Addresses concerns raised in https://github.com/ppy/osu/discussions/17399.
2022-03-22 14:10:36 +09:00
Dean Herbert
2a55c5e02e Add extension method to detect and isolate realm collection-level changes 2022-03-08 14:50:47 +09:00
Dean Herbert
1485a3a28a Add test coverage of proeprty changed subscriptions 2022-03-03 17:56:49 +09:00
Dean Herbert
9a117467b5 Add RealmAccess.WriteAsync method 2022-03-01 18:44:05 +09:00
Dean Herbert
0138f22c8d Update existing usages to point to RealmRulesetStore 2022-02-16 17:13:54 +09:00
Dean Herbert
714177cce1 Remove pointless constructor in RulesetInfo 2022-01-27 15:37:27 +09:00
Dean Herbert
abe2cccaae Fix completely invalid method of testing realm migration 2022-01-26 19:03:26 +09:00
Dean Herbert
91e0d1021f Merge branch 'master' into fix-out-of-order-events-on-block-fail 2022-01-26 15:21:10 +09:00
Dean Herbert
cd71ec0edd Remove ILive<> interface (and use abstract Live<> instead) 2022-01-26 13:38:56 +09:00
Dean Herbert
ffd7877a1e Remove synchronization context hacks in realm tests 2022-01-25 17:41:22 +09:00
Dan Balasescu
d8270fe14f
Merge pull request #16604 from peppy/less-async-import
Remove `Task` from the inner-most `Import` method in `RealmArchiveModelImporter`
2022-01-25 16:47:07 +09:00
Dean Herbert
778d2a71b4 Remove Task from the inner-most Import method in RealmArchiveModelImporter
One of my pending work items for post-realm merge.

The lowest-level import task is no longer asynchronous, as we don't want
it to span multiple threads to allow easier interaction with realm.
Removing the `Task` spec simplifies a heap of usages.

Individual usages should decide whether they want to run the import
asynchronously, by either using an alternative override or spooling up a
thread themselves.
2022-01-25 15:30:29 +09:00
Dean Herbert
ae0fea8e26 Fix compilation issues due to misnamed fild 2022-01-25 15:29:45 +09:00
Dean Herbert
35e1c7de7d Merge branch 'master' into realm-block-timeout-assert-failure 2022-01-25 15:05:11 +09:00
Dean Herbert
bda77fb6b3
Merge branch 'master' into realm-block-timeout-assert-failure 2022-01-25 14:47:34 +09:00
Dean Herbert
56d7d81465 Fix broken test due to SynchronizationContext never running expected work 2022-01-25 14:47:21 +09:00
Dan Balasescu
bfa521bdd2
Merge pull request #16593 from peppy/realm-clean-up
Clean up realm naming
2022-01-25 14:33:53 +09:00
Dean Herbert
8116806db3 Add test coverage of calling BlockAllOperations a second time after timeout 2022-01-25 14:00:58 +09:00
Dean Herbert
bbcc149e2e During import if files are found to be missing, ensure they are restored
This is one step closer to sanity in terms of physical files. As per the
comment I have left in place, we really should be checking file sizes or
hashes, but to keep things simple and fast I've opted to just cover the
"missing file" scenario for now.

Ran into this when testing against a foreign `client.realm` by:
- Noticing a beatmap doesn't load
- Deleting said beatmap
- Downloading via beatmap overlay
- Beatmap is restored but still doesn't work

Note that I've kept the logic where this will undelete an existing
import rather than create one from fresh, as I think that is beneficial
to the user (ie. it will still keep any linked scores on restore).
2022-01-25 13:44:54 +09:00
Dean Herbert
d7342880f5 Update remaining cases of clashes with realm.Write and realm.RegisterForNotifications 2022-01-25 13:09:48 +09:00
Dean Herbert
e23b10e6a5 Update remaining cases of clashing variable name in realm.Run(realm.. 2022-01-25 13:04:05 +09:00
Dean Herbert
f30894840c Update terminology to realm "instance" rather than "context"
This matches the terminology used by realm themselves, which feels
better.
2022-01-24 20:38:38 +09:00
Dean Herbert
6eb2c28e41 Rename RealmContextFactory to RealmAccess 2022-01-24 20:38:07 +09:00
Dean Herbert
40aa873190 Rename register methods to better explain their purpose 2022-01-24 14:37:36 +09:00
Dean Herbert
0709a2ac9b Add test coverage of realm subscription scenarios 2022-01-23 20:28:13 +09:00
Dean Herbert
6a076a684e Merge branch 'realm-context-use-update-when-feasible' into realm-stable-subscriptions 2022-01-22 13:14:25 +09:00
Dean Herbert
c9db0181d0 Attempt to fix test failures on windows due to context being held open 2022-01-22 12:24:05 +09:00
Dean Herbert
1f157d729d Update existing subscriptions to new style
Fix missing detach calls in `MusicController`
2022-01-21 20:05:03 +09:00
Dean Herbert
114c9e8c1f Update all usages of CreateContext to use either Run or Write 2022-01-21 17:27:08 +09:00
Dean Herbert
70cc03fe43 Avoid constructor overhead for realm RealmKeyBinding parameterless constructor 2022-01-20 17:29:07 +09:00
Dean Herbert
1db2135d70 Update tests to match new behaviour 2022-01-19 01:05:47 +09:00
Dean Herbert
f24b2b1be3 Make copying detached changes to realm only exposed for BeatmapSet
Also fixes remaining issues with the copy process.
2022-01-12 17:49:11 +09:00
Dean Herbert
a307f7e90e Add test coverage of updating via copying changes from detached instance 2022-01-12 17:49:11 +09:00
Dean Herbert
c92aff8d2b Add test of cyclic beatmap/beatmapset references 2022-01-12 17:49:11 +09:00
Dean Herbert
509301d94f Update detach test to assert correct behaviour 2022-01-12 17:49:11 +09:00
Dean Herbert
8461eaab46 BeatmapSetInfo detach support 2022-01-12 17:00:16 +09:00
Dean Herbert
31a3161189 Make tests compile again 2022-01-12 17:00:16 +09:00
Dean Herbert
00e3af3366 Update model manager and many related classes to get things compiling again 2022-01-12 17:00:00 +09:00
Dean Herbert
b8cd3cdbbc Various updates to ruleset and primary key usages to move closer to realm support 2022-01-12 16:57:13 +09:00
Dean Herbert
3ecd889fef Replace EF RulesetStore with realm version
Pass full EF context factory to `RealmContextFactory` for migration purposes
2022-01-12 16:39:36 +09:00
Dean Herbert
618903c217 Rename realm to become imposter classes 2022-01-12 16:39:36 +09:00
Dean Herbert
031a40af6a Replace usages of Wait with WaitSafely 2022-01-04 11:51:41 +09:00
Dean Herbert
4b88e257e5 Update usages of CleanRunHeadlessGameHost to match new signature 2021-12-24 20:17:34 +09:00