Skip to content

Commit 39e2be0

Browse files
authored
Merge pull request #112 from mackysoft/refactor/tests-outside-package
Move and expand editor tests, and avoid duplicate CI
2 parents f8c8ed6 + 3f2bae2 commit 39e2be0

49 files changed

Lines changed: 979 additions & 7 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/tests.yaml‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Tests
22

33
on:
44
push:
5-
branches-ignore:
6-
- documentation
7-
- gh-pages
5+
branches:
6+
- main
87
pull_request: {}
98
workflow_dispatch: {}
109

‎AGENTS.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ Primary risk area: type discovery & filtering (what types appear in the selector
1010
- Repository URL: `https://github.com/mackysoft/Unity-SerializeReferenceExtensions`
1111
- Package source: `Assets/MackySoft/MackySoft.SerializeReferenceExtensions`
1212
- Editor code: `.../Editor/**`
13-
- Tests: `.../Tests/**`
13+
- Tests: `Assets/Tests/SerializeReferenceExtensions/Editor/**`
14+
15+
Keep test code, fixtures, and test assembly definitions under `Assets/Tests`, outside both the UPM package root and the `Assets/MackySoft` unitypackage export scope.
1416

1517
## Unity compatibility (critical)
1618
- Minimum supported Unity: 2021.3 (baseline for development/testing).
@@ -29,15 +31,15 @@ Use Unity CLI through `.github/actions/setup-unity`.
2931

3032
## How to run tests locally
3133
### EditMode
32-
Run tests through Unity CLI (which manages batch mode):
34+
Run tests through Unity CLI (which manages batch mode). Inspector interaction and
35+
rendering tests require graphics; do not pass `-nographics`. On headless Linux,
36+
run under Xvfb with software OpenGL, as configured in the Tests workflow:
3337
```
3438
unity --non-interactive test . --editor-version 2021.3.45f2 \
3539
--mode EditMode --output Logs/TestResults/editmode.xml --timeout 900 \
3640
-- -logFile Logs/editmode.log
3741
```
3842
Repeat with `--editor-version 2023.2.22f1` for the generic/variance feature gate.
39-
GUI interaction tests require a graphics device; do not pass `-nographics`. On headless Linux,
40-
run the command under `xvfb-run` with software OpenGL, as configured in the Tests workflow.
4143

4244
## Architecture guardrails
4345
- Runtime surface area should remain minimal (mainly attributes / data structures).

‎Assets/Tests.meta‎

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Tests.meta renamed to Assets/Tests/SerializeReferenceExtensions.meta

File renamed without changes.

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Tests/Editor.meta renamed to Assets/Tests/SerializeReferenceExtensions/Editor.meta

File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using NUnit.Framework;
2+
3+
namespace MackySoft.SerializeReferenceExtensions.Tests
4+
{
5+
public sealed class AddTypeMenuAttributeTests
6+
{
7+
[Test]
8+
public void MenuPath_ExposesSegmentsAndLeafName ()
9+
{
10+
var attribute = new AddTypeMenuAttribute("Commands/Movement/Run", -4);
11+
12+
Assert.That(attribute.GetSplittedMenuName(), Is.EqualTo(new[] { "Commands", "Movement", "Run" }));
13+
Assert.That(attribute.GetTypeNameWithoutPath(), Is.EqualTo("Run"));
14+
Assert.That(attribute.MenuName, Is.EqualTo("Commands/Movement/Run"));
15+
Assert.That(attribute.Order, Is.EqualTo(-4));
16+
}
17+
}
18+
}

‎Assets/Tests/SerializeReferenceExtensions/Editor/AddTypeMenuAttributeTests.cs.meta‎

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Tests/Editor/AdvancedTypePopupTests.cs renamed to Assets/Tests/SerializeReferenceExtensions/Editor/AdvancedTypePopupTests.cs

File renamed without changes.

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Tests/Editor/AdvancedTypePopupTests.cs.meta renamed to Assets/Tests/SerializeReferenceExtensions/Editor/AdvancedTypePopupTests.cs.meta

File renamed without changes.

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Tests/Editor/DefaultIntrinsicTypePolicyTests.cs renamed to Assets/Tests/SerializeReferenceExtensions/Editor/DefaultIntrinsicTypePolicyTests.cs

File renamed without changes.

0 commit comments

Comments
 (0)