1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-07 19:22:58 +08:00

Merge branch 'master' into realm-subscription-tracking

This commit is contained in:
Dean Herbert 2022-01-25 15:56:35 +09:00 committed by GitHub
commit a46b06ffe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 23 additions and 19 deletions

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.EmptyFreeform.Tests
[STAThread] [STAThread]
public static int Main(string[] args) public static int Main(string[] args)
{ {
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new HostOptions { BindIPC = true }))
{ {
host.Run(new OsuTestBrowser()); host.Run(new OsuTestBrowser());
return 0; return 0;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Pippidon.Tests
[STAThread] [STAThread]
public static int Main(string[] args) public static int Main(string[] args)
{ {
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new HostOptions { BindIPC = true }))
{ {
host.Run(new OsuTestBrowser()); host.Run(new OsuTestBrowser());
return 0; return 0;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.EmptyScrolling.Tests
[STAThread] [STAThread]
public static int Main(string[] args) public static int Main(string[] args)
{ {
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new HostOptions { BindIPC = true }))
{ {
host.Run(new OsuTestBrowser()); host.Run(new OsuTestBrowser());
return 0; return 0;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Pippidon.Tests
[STAThread] [STAThread]
public static int Main(string[] args) public static int Main(string[] args)
{ {
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new HostOptions { BindIPC = true }))
{ {
host.Run(new OsuTestBrowser()); host.Run(new OsuTestBrowser());
return 0; return 0;

View File

@ -52,7 +52,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" />
<PackageReference Include="ppy.osu.Framework.Android" Version="2022.118.0" /> <PackageReference Include="ppy.osu.Framework.Android" Version="2022.125.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Transitive Dependencies"> <ItemGroup Label="Transitive Dependencies">
<!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. --> <!-- Realm needs to be directly referenced in all Xamarin projects, as it will not pull in its transitive dependencies otherwise. -->

View File

@ -55,7 +55,7 @@ namespace osu.Desktop
} }
} }
using (DesktopGameHost host = Host.GetSuitableHost(gameName, true)) using (DesktopGameHost host = Host.GetSuitableDesktopHost(gameName, new HostOptions { BindIPC = true }))
{ {
host.ExceptionThrown += handleException; host.ExceptionThrown += handleException;

View File

@ -155,7 +155,7 @@ namespace osu.Game.Tests.Collections.IO
} }
// Name matches the automatically chosen name from `CleanRunHeadlessGameHost` above, so we end up using the same storage location. // Name matches the automatically chosen name from `CleanRunHeadlessGameHost` above, so we end up using the same storage location.
using (HeadlessGameHost host = new TestRunHeadlessGameHost(firstRunName)) using (HeadlessGameHost host = new TestRunHeadlessGameHost(firstRunName, null))
{ {
try try
{ {

View File

@ -608,9 +608,9 @@ namespace osu.Game.Tests.Database
using var importer = new BeatmapModelManager(realmFactory, storage); using var importer = new BeatmapModelManager(realmFactory, storage);
using var store = new RulesetStore(realmFactory, storage); using var store = new RulesetStore(realmFactory, storage);
var imported = await LoadOszIntoStore(importer, realmFactory.Context); var imported = await LoadOszIntoStore(importer, realmFactory.Realm);
deleteBeatmapSet(imported, realmFactory.Context); deleteBeatmapSet(imported, realmFactory.Realm);
Assert.IsTrue(imported.DeletePending); Assert.IsTrue(imported.DeletePending);
@ -619,7 +619,7 @@ namespace osu.Game.Tests.Database
Assert.That(imported.Files.All(f => !storage.GetStorageForDirectory("files").Exists(f.File.GetStoragePath()))); Assert.That(imported.Files.All(f => !storage.GetStorageForDirectory("files").Exists(f.File.GetStoragePath())));
var importedSecondTime = await LoadOszIntoStore(importer, realmFactory.Context); var importedSecondTime = await LoadOszIntoStore(importer, realmFactory.Realm);
// check the newly "imported" beatmap is actually just the restored previous import. since it matches hash. // check the newly "imported" beatmap is actually just the restored previous import. since it matches hash.
Assert.IsTrue(imported.ID == importedSecondTime.ID); Assert.IsTrue(imported.ID == importedSecondTime.ID);

View File

@ -37,7 +37,7 @@ namespace osu.Game.Tournament.Tests.NonVisual
[Test] [Test]
public void TestCustomDirectory() public void TestCustomDirectory()
{ {
using (HeadlessGameHost host = new TestRunHeadlessGameHost(nameof(TestCustomDirectory))) // don't use clean run as we are writing a config file. using (HeadlessGameHost host = new TestRunHeadlessGameHost(nameof(TestCustomDirectory), null)) // don't use clean run as we are writing a config file.
{ {
string osuDesktopStorage = Path.Combine(host.UserStoragePaths.First(), nameof(TestCustomDirectory)); string osuDesktopStorage = Path.Combine(host.UserStoragePaths.First(), nameof(TestCustomDirectory));
const string custom_tournament = "custom"; const string custom_tournament = "custom";
@ -68,7 +68,7 @@ namespace osu.Game.Tournament.Tests.NonVisual
[Test] [Test]
public void TestMigration() public void TestMigration()
{ {
using (HeadlessGameHost host = new TestRunHeadlessGameHost(nameof(TestMigration))) // don't use clean run as we are writing test files for migration. using (HeadlessGameHost host = new TestRunHeadlessGameHost(nameof(TestMigration), null)) // don't use clean run as we are writing test files for migration.
{ {
string osuRoot = Path.Combine(host.UserStoragePaths.First(), nameof(TestMigration)); string osuRoot = Path.Combine(host.UserStoragePaths.First(), nameof(TestMigration));
string configFile = Path.Combine(osuRoot, "tournament.ini"); string configFile = Path.Combine(osuRoot, "tournament.ini");

View File

@ -19,7 +19,7 @@ namespace osu.Game.Tournament.Tests.NonVisual
public void CheckIPCLocation() public void CheckIPCLocation()
{ {
// don't use clean run because files are being written before osu! launches. // don't use clean run because files are being written before osu! launches.
using (var host = new TestRunHeadlessGameHost(nameof(CheckIPCLocation))) using (var host = new TestRunHeadlessGameHost(nameof(CheckIPCLocation), null))
{ {
string basePath = Path.Combine(host.UserStoragePaths.First(), nameof(CheckIPCLocation)); string basePath = Path.Combine(host.UserStoragePaths.First(), nameof(CheckIPCLocation));

View File

@ -12,7 +12,7 @@ namespace osu.Game.Tournament.Tests
[STAThread] [STAThread]
public static int Main(string[] args) public static int Main(string[] args)
{ {
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new HostOptions { BindIPC = true }))
{ {
host.Run(new TournamentTestBrowser()); host.Run(new TournamentTestBrowser());
return 0; return 0;

View File

@ -3,6 +3,7 @@
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using osu.Framework;
using osu.Framework.Testing; using osu.Framework.Testing;
namespace osu.Game.Tests namespace osu.Game.Tests
@ -20,7 +21,10 @@ namespace osu.Game.Tests
/// <param name="bypassCleanup">Whether to bypass directory cleanup on host disposal. Should be used only if a subsequent test relies on the files still existing.</param> /// <param name="bypassCleanup">Whether to bypass directory cleanup on host disposal. Should be used only if a subsequent test relies on the files still existing.</param>
/// <param name="callingMethodName">The name of the calling method, used for test file isolation and clean-up.</param> /// <param name="callingMethodName">The name of the calling method, used for test file isolation and clean-up.</param>
public CleanRunHeadlessGameHost(bool bindIPC = false, bool realtime = true, bool bypassCleanup = false, [CallerMemberName] string callingMethodName = @"") public CleanRunHeadlessGameHost(bool bindIPC = false, bool realtime = true, bool bypassCleanup = false, [CallerMemberName] string callingMethodName = @"")
: base($"{callingMethodName}-{Guid.NewGuid()}", bindIPC, realtime, bypassCleanup: bypassCleanup) : base($"{callingMethodName}-{Guid.NewGuid()}", new HostOptions
{
BindIPC = bindIPC,
}, bypassCleanup: bypassCleanup, realtime: realtime)
{ {
} }

View File

@ -12,7 +12,7 @@ namespace osu.Game.Tests
[STAThread] [STAThread]
public static int Main(string[] args) public static int Main(string[] args)
{ {
using (DesktopGameHost host = Host.GetSuitableHost(@"osu", true)) using (DesktopGameHost host = Host.GetSuitableDesktopHost(@"osu", new HostOptions { BindIPC = true, }))
{ {
host.Run(new OsuTestBrowser()); host.Run(new OsuTestBrowser());
return 0; return 0;

View File

@ -36,7 +36,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Realm" Version="10.8.0" /> <PackageReference Include="Realm" Version="10.8.0" />
<PackageReference Include="ppy.osu.Framework" Version="2022.118.0" /> <PackageReference Include="ppy.osu.Framework" Version="2022.125.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" />
<PackageReference Include="Sentry" Version="3.13.0" /> <PackageReference Include="Sentry" Version="3.13.0" />
<PackageReference Include="SharpCompress" Version="0.30.1" /> <PackageReference Include="SharpCompress" Version="0.30.1" />

View File

@ -60,7 +60,7 @@
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
</ItemGroup> </ItemGroup>
<ItemGroup Label="Package References"> <ItemGroup Label="Package References">
<PackageReference Include="ppy.osu.Framework.iOS" Version="2022.118.0" /> <PackageReference Include="ppy.osu.Framework.iOS" Version="2022.125.0" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2022.115.0" />
</ItemGroup> </ItemGroup>
<!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) --> <!-- See https://github.com/dotnet/runtime/issues/35988 (can be removed after Xamarin uses net5.0 / net6.0) -->
@ -83,7 +83,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.6" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="ppy.osu.Framework" Version="2022.118.0" /> <PackageReference Include="ppy.osu.Framework" Version="2022.125.0" />
<PackageReference Include="SharpCompress" Version="0.30.0" /> <PackageReference Include="SharpCompress" Version="0.30.0" />
<PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />