-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into ptim-sync-initial-state
- Loading branch information
Showing
36 changed files
with
444 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,30 +5,40 @@ | |
name: Annotate CI run with test results | ||
on: | ||
workflow_run: | ||
workflows: ["Continuous Integration"] | ||
workflows: [ "Continuous Integration" ] | ||
types: | ||
- completed | ||
|
||
permissions: | ||
contents: read | ||
actions: read | ||
checks: write | ||
|
||
jobs: | ||
annotate: | ||
name: Annotate CI run with test results | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion != 'cancelled' }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- { prettyname: Windows, configuration: Debug } | ||
- { prettyname: macOS, configuration: Debug } | ||
- { prettyname: Linux, configuration: Debug } | ||
- { prettyname: Linux, configuration: Release } | ||
threadingMode: ['SingleThread', 'MultiThreaded'] | ||
timeout-minutes: 5 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: ${{ github.event.workflow_run.repository.full_name }} | ||
ref: ${{ github.event.workflow_run.head_sha }} | ||
|
||
- name: Download results | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: osu-framework-test-results-* | ||
merge-multiple: true | ||
run-id: ${{ github.event.workflow_run.id }} | ||
github-token: ${{ github.token }} | ||
|
||
- name: Annotate CI run with test results | ||
uses: dorny/[email protected] | ||
with: | ||
artifact: osu-framework-test-results-${{matrix.os.prettyname}}-${{matrix.threadingMode}}-${{matrix.os.configuration}} | ||
name: Test Results (${{matrix.os.prettyname}}, ${{matrix.threadingMode}}, ${{matrix.os.configuration}}) | ||
name: Results | ||
path: "*.trx" | ||
reporter: dotnet-trx | ||
list-suites: 'failed' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Diagnostics.CodeAnalysis; | ||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
|
@@ -15,24 +12,6 @@ namespace osu.Framework.Tests.Dependencies.Reflection | |
[SuppressMessage("Performance", "OFSG001:Class contributes to dependency injection and should be partial")] | ||
public class CachedModelDependenciesTest | ||
{ | ||
[Test] | ||
public void TestModelWithNonBindableFieldsFails() | ||
{ | ||
IReadOnlyDependencyContainer unused; | ||
|
||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<NonBindablePublicFieldModel>(null)); | ||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<NonBindablePrivateFieldModel>(null)); | ||
} | ||
|
||
[Test] | ||
public void TestModelWithNonReadOnlyFieldsFails() | ||
{ | ||
IReadOnlyDependencyContainer unused; | ||
|
||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<NonReadOnlyFieldModel>(null)); | ||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<PropertyModel>(null)); | ||
} | ||
|
||
[Test] | ||
public void TestSettingNoModelResolvesDefault() | ||
{ | ||
|
@@ -195,7 +174,7 @@ public void TestSetModelToNullAfterResolved() | |
|
||
var model = new FieldModel { Bindable = { Value = 2 } }; | ||
|
||
var dependencies = new CachedModelDependencyContainer<FieldModel>(null) | ||
var dependencies = new CachedModelDependencyContainer<FieldModel?>(null) | ||
{ | ||
Model = { Value = model } | ||
}; | ||
|
@@ -248,7 +227,7 @@ public void TestResolveIndividualProperties() | |
BindableString = { Value = "3" } | ||
}; | ||
|
||
var dependencies = new CachedModelDependencyContainer<DerivedFieldModel>(null) | ||
var dependencies = new CachedModelDependencyContainer<DerivedFieldModel?>(null) | ||
{ | ||
Model = { Value = model1 } | ||
}; | ||
|
@@ -269,33 +248,6 @@ public void TestResolveIndividualProperties() | |
Assert.AreEqual(null, resolver.BindableString.Value); | ||
} | ||
|
||
private class NonBindablePublicFieldModel : IDependencyInjectionCandidate | ||
{ | ||
#pragma warning disable 649 | ||
public readonly int FailingField; | ||
#pragma warning restore 649 | ||
} | ||
|
||
private class NonBindablePrivateFieldModel : IDependencyInjectionCandidate | ||
{ | ||
#pragma warning disable 169 | ||
private readonly int failingField; | ||
#pragma warning restore 169 | ||
} | ||
|
||
private class NonReadOnlyFieldModel : IDependencyInjectionCandidate | ||
{ | ||
#pragma warning disable 649 | ||
public Bindable<int> Bindable; | ||
#pragma warning restore 649 | ||
} | ||
|
||
private class PropertyModel : IDependencyInjectionCandidate | ||
{ | ||
// ReSharper disable once UnusedMember.Local | ||
public Bindable<int> Bindable { get; private set; } | ||
} | ||
|
||
private class FieldModel : IDependencyInjectionCandidate | ||
{ | ||
[Cached] | ||
|
@@ -311,22 +263,22 @@ private class DerivedFieldModel : FieldModel | |
private class FieldModelResolver : IDependencyInjectionCandidate | ||
{ | ||
[Resolved] | ||
public FieldModel Model { get; private set; } | ||
public FieldModel Model { get; private set; } = null!; | ||
} | ||
|
||
private class DerivedFieldModelResolver : IDependencyInjectionCandidate | ||
{ | ||
[Resolved] | ||
public DerivedFieldModel Model { get; private set; } | ||
public DerivedFieldModel Model { get; private set; } = null!; | ||
} | ||
|
||
private class DerivedFieldModelPropertyResolver : IDependencyInjectionCandidate | ||
{ | ||
[Resolved(typeof(DerivedFieldModel))] | ||
public Bindable<int> Bindable { get; private set; } | ||
public Bindable<int> Bindable { get; private set; } = null!; | ||
|
||
[Resolved(typeof(DerivedFieldModel))] | ||
public Bindable<string> BindableString { get; private set; } | ||
public Bindable<string> BindableString { get; private set; } = null!; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,6 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using NUnit.Framework; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
|
@@ -13,24 +10,6 @@ namespace osu.Framework.Tests.Dependencies.SourceGeneration | |
[TestFixture] | ||
public partial class CachedModelDependenciesTest | ||
{ | ||
[Test] | ||
public void TestModelWithNonBindableFieldsFails() | ||
{ | ||
IReadOnlyDependencyContainer unused; | ||
|
||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<NonBindablePublicFieldModel>(null)); | ||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<NonBindablePrivateFieldModel>(null)); | ||
} | ||
|
||
[Test] | ||
public void TestModelWithNonReadOnlyFieldsFails() | ||
{ | ||
IReadOnlyDependencyContainer unused; | ||
|
||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<NonReadOnlyFieldModel>(null)); | ||
Assert.Throws<TypeInitializationException>(() => unused = new CachedModelDependencyContainer<PropertyModel>(null)); | ||
} | ||
|
||
[Test] | ||
public void TestSettingNoModelResolvesDefault() | ||
{ | ||
|
@@ -193,7 +172,7 @@ public void TestSetModelToNullAfterResolved() | |
|
||
var model = new FieldModel { Bindable = { Value = 2 } }; | ||
|
||
var dependencies = new CachedModelDependencyContainer<FieldModel>(null) | ||
var dependencies = new CachedModelDependencyContainer<FieldModel?>(null) | ||
{ | ||
Model = { Value = model } | ||
}; | ||
|
@@ -246,7 +225,7 @@ public void TestResolveIndividualProperties() | |
BindableString = { Value = "3" } | ||
}; | ||
|
||
var dependencies = new CachedModelDependencyContainer<DerivedFieldModel>(null) | ||
var dependencies = new CachedModelDependencyContainer<DerivedFieldModel?>(null) | ||
{ | ||
Model = { Value = model1 } | ||
}; | ||
|
@@ -267,33 +246,6 @@ public void TestResolveIndividualProperties() | |
Assert.AreEqual(null, resolver.BindableString.Value); | ||
} | ||
|
||
private partial class NonBindablePublicFieldModel : IDependencyInjectionCandidate | ||
{ | ||
#pragma warning disable 649 | ||
public readonly int FailingField; | ||
#pragma warning restore 649 | ||
} | ||
|
||
private partial class NonBindablePrivateFieldModel : IDependencyInjectionCandidate | ||
{ | ||
#pragma warning disable 169 | ||
private readonly int failingField; | ||
#pragma warning restore 169 | ||
} | ||
|
||
private partial class NonReadOnlyFieldModel : IDependencyInjectionCandidate | ||
{ | ||
#pragma warning disable 649 | ||
public Bindable<int> Bindable; | ||
#pragma warning restore 649 | ||
} | ||
|
||
private partial class PropertyModel : IDependencyInjectionCandidate | ||
{ | ||
// ReSharper disable once UnusedMember.Local | ||
public Bindable<int> Bindable { get; private set; } | ||
} | ||
|
||
private partial class FieldModel : IDependencyInjectionCandidate | ||
{ | ||
[Cached] | ||
|
@@ -309,22 +261,22 @@ private partial class DerivedFieldModel : FieldModel | |
private partial class FieldModelResolver : IDependencyInjectionCandidate | ||
{ | ||
[Resolved] | ||
public FieldModel Model { get; private set; } | ||
public FieldModel Model { get; private set; } = null!; | ||
} | ||
|
||
private partial class DerivedFieldModelResolver : IDependencyInjectionCandidate | ||
{ | ||
[Resolved] | ||
public DerivedFieldModel Model { get; private set; } | ||
public DerivedFieldModel Model { get; private set; } = null!; | ||
} | ||
|
||
private partial class DerivedFieldModelPropertyResolver : IDependencyInjectionCandidate | ||
{ | ||
[Resolved(typeof(DerivedFieldModel))] | ||
public Bindable<int> Bindable { get; private set; } | ||
public Bindable<int> Bindable { get; private set; } = null!; | ||
|
||
[Resolved(typeof(DerivedFieldModel))] | ||
public Bindable<string> BindableString { get; private set; } | ||
public Bindable<string> BindableString { get; private set; } = null!; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable | ||
|
||
using System.Diagnostics; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Testing.Drawables.Steps; | ||
|
@@ -22,12 +21,43 @@ public TestSceneStepButton() | |
Spacing = new Vector2(5), | ||
Children = new Drawable[] | ||
{ | ||
new LabelStep { Text = nameof(LabelStep) }, | ||
new AssertButton { Text = nameof(AssertButton), Assertion = () => true }, | ||
new SingleStepButton { Text = nameof(SingleStepButton) }, | ||
new RepeatStepButton(null) { Text = nameof(RepeatStepButton) }, | ||
new ToggleStepButton(null) { Text = nameof(ToggleStepButton) }, | ||
new UntilStepButton(() => true) { Text = nameof(UntilStepButton) }, | ||
new LabelStep | ||
{ | ||
Text = nameof(LabelStep), | ||
IsSetupStep = false, | ||
Action = _ => { }, | ||
}, | ||
new AssertButton | ||
{ | ||
Text = nameof(AssertButton), | ||
IsSetupStep = false, | ||
Assertion = () => true, | ||
CallStack = new StackTrace() | ||
}, | ||
new SingleStepButton | ||
{ | ||
Text = nameof(SingleStepButton), | ||
IsSetupStep = false, | ||
Action = () => { } | ||
}, | ||
new RepeatStepButton | ||
{ | ||
Text = nameof(RepeatStepButton), | ||
IsSetupStep = false | ||
}, | ||
new ToggleStepButton | ||
{ | ||
Text = nameof(ToggleStepButton), | ||
IsSetupStep = false, | ||
Action = _ => { } | ||
}, | ||
new UntilStepButton | ||
{ | ||
Text = nameof(UntilStepButton), | ||
IsSetupStep = false, | ||
Assertion = () => true, | ||
CallStack = new StackTrace() | ||
}, | ||
new StepSlider<int>(nameof(StepSlider<int>), 0, 10, 5), | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.