Skip to content

Commit

Permalink
Merge pull request #32 from nowsprinting/chore/run_tests_on_player
Browse files Browse the repository at this point in the history
Add run tests on standalone player
  • Loading branch information
nowsprinting authored Oct 26, 2024
2 parents 6721ac8 + 112366b commit 814aa93
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ jobs:
- 2022.3.42f1
- 2023.2.20f1
- 6000.0.22f1
testMode:
- All # run tests in editor
include:
- unityVersion: 2023.2.20f1
testMode: Standalone # run tests on player

steps:
- name: Checkout repository
Expand Down Expand Up @@ -78,10 +83,11 @@ jobs:
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
unityVersion: ${{ matrix.unityVersion }} # Default is `auto`
checkName: test result (${{ matrix.unityVersion }})
checkName: test result (${{ matrix.unityVersion }}, ${{ matrix.testMode }})
customParameters: -testCategory "Integration"
coverageOptions: generateAdditionalMetrics;generateTestReferences;generateHtmlReport;generateAdditionalReports;dontClear;assemblyFilters:${{ env.assembly_filters }}
# see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html
testMode: ${{ matrix.testMode }}
env:
UNITY_LICENSE: ${{ secrets[env.secret_key] }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand All @@ -91,7 +97,7 @@ jobs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: TestResults-Unity${{ matrix.unityVersion }}
name: TestResults-Unity${{ matrix.unityVersion }}-${{ matrix.testMode }}
path: |
${{ steps.test.outputs.artifactsPath }}
${{ steps.test.outputs.coveragePath }}
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ jobs:
- 2022.3.42f1
- 2023.2.20f1
- 6000.0.22f1
testMode:
- All # run tests in editor
include:
- unityVersion: 2019.4.40f1
octocov: true
- unityVersion: 2023.2.20f1
testMode: Standalone # run tests on player

steps:
- name: Checkout repository
Expand Down Expand Up @@ -82,10 +86,11 @@ jobs:
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
unityVersion: ${{ matrix.unityVersion }} # Default is `auto`
checkName: test result (${{ matrix.unityVersion }})
checkName: test result (${{ matrix.unityVersion }}, ${{ matrix.testMode }})
customParameters: -testCategory "!IgnoreCI;!Integration"
coverageOptions: generateAdditionalMetrics;generateTestReferences;generateHtmlReport;generateAdditionalReports;dontClear;assemblyFilters:${{ env.assembly_filters }}
# see: https://docs.unity3d.com/Packages/[email protected]/manual/CoverageBatchmode.html
testMode: ${{ matrix.testMode }}
env:
UNITY_LICENSE: ${{ secrets[env.secret_key] }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand All @@ -103,7 +108,7 @@ jobs:
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: TestResults-Unity${{ matrix.unityVersion }}
name: TestResults-Unity${{ matrix.unityVersion }}-${{ matrix.testMode }}
path: |
${{ steps.test.outputs.artifactsPath }}
${{ steps.test.outputs.coveragePath }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using NUnit.Framework;
using NUnit.Framework.Constraints;
using UnityEngine;
using UnityEngine.TestTools;

// ReSharper disable AccessToStaticMemberViaDerivedType

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

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

0 comments on commit 814aa93

Please sign in to comment.