Skip to content

Commit 814aa93

Browse files
authored
Merge pull request #32 from nowsprinting/chore/run_tests_on_player
Add run tests on standalone player
2 parents 6721ac8 + 112366b commit 814aa93

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/test-integration.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ jobs:
4646
- 2022.3.42f1
4747
- 2023.2.20f1
4848
- 6000.0.22f1
49+
testMode:
50+
- All # run tests in editor
51+
include:
52+
- unityVersion: 2023.2.20f1
53+
testMode: Standalone # run tests on player
4954

5055
steps:
5156
- name: Checkout repository
@@ -78,10 +83,11 @@ jobs:
7883
with:
7984
githubToken: ${{ secrets.GITHUB_TOKEN }}
8085
unityVersion: ${{ matrix.unityVersion }} # Default is `auto`
81-
checkName: test result (${{ matrix.unityVersion }})
86+
checkName: test result (${{ matrix.unityVersion }}, ${{ matrix.testMode }})
8287
customParameters: -testCategory "Integration"
8388
coverageOptions: generateAdditionalMetrics;generateTestReferences;generateHtmlReport;generateAdditionalReports;dontClear;assemblyFilters:${{ env.assembly_filters }}
8489
# see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html
90+
testMode: ${{ matrix.testMode }}
8591
env:
8692
UNITY_LICENSE: ${{ secrets[env.secret_key] }}
8793
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
@@ -91,7 +97,7 @@ jobs:
9197
- name: Upload test results
9298
uses: actions/upload-artifact@v4
9399
with:
94-
name: TestResults-Unity${{ matrix.unityVersion }}
100+
name: TestResults-Unity${{ matrix.unityVersion }}-${{ matrix.testMode }}
95101
path: |
96102
${{ steps.test.outputs.artifactsPath }}
97103
${{ steps.test.outputs.coveragePath }}

.github/workflows/test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ jobs:
4747
- 2022.3.42f1
4848
- 2023.2.20f1
4949
- 6000.0.22f1
50+
testMode:
51+
- All # run tests in editor
5052
include:
5153
- unityVersion: 2019.4.40f1
5254
octocov: true
55+
- unityVersion: 2023.2.20f1
56+
testMode: Standalone # run tests on player
5357

5458
steps:
5559
- name: Checkout repository
@@ -82,10 +86,11 @@ jobs:
8286
with:
8387
githubToken: ${{ secrets.GITHUB_TOKEN }}
8488
unityVersion: ${{ matrix.unityVersion }} # Default is `auto`
85-
checkName: test result (${{ matrix.unityVersion }})
89+
checkName: test result (${{ matrix.unityVersion }}, ${{ matrix.testMode }})
8690
customParameters: -testCategory "!IgnoreCI;!Integration"
8791
coverageOptions: generateAdditionalMetrics;generateTestReferences;generateHtmlReport;generateAdditionalReports;dontClear;assemblyFilters:${{ env.assembly_filters }}
8892
# see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html
93+
testMode: ${{ matrix.testMode }}
8994
env:
9095
UNITY_LICENSE: ${{ secrets[env.secret_key] }}
9196
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
@@ -103,7 +108,7 @@ jobs:
103108
- name: Upload test results
104109
uses: actions/upload-artifact@v4
105110
with:
106-
name: TestResults-Unity${{ matrix.unityVersion }}
111+
name: TestResults-Unity${{ matrix.unityVersion }}-${{ matrix.testMode }}
107112
path: |
108113
${{ steps.test.outputs.artifactsPath }}
109114
${{ steps.test.outputs.coveragePath }}

Assets/APIExamples/Tests/Runtime/NUnit/CustomConstraintExample.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using NUnit.Framework;
55
using NUnit.Framework.Constraints;
66
using UnityEngine;
7+
using UnityEngine.TestTools;
78

89
// ReSharper disable AccessToStaticMemberViaDerivedType
910

@@ -34,6 +35,7 @@ public void CustomConstraint_Constraintの実装だけで可能な書きかた()
3435
}
3536

3637
[Test]
38+
[UnityPlatform(RuntimePlatform.OSXEditor, RuntimePlatform.WindowsEditor, RuntimePlatform.LinuxEditor)]
3739
public void CustomConstraint_Extensionsの実装も行なうと可能な書きかた()
3840
{
3941
var actual = CreateDestroyedObject();

0 commit comments

Comments
 (0)