Skip to content

Commit cf870e6

Browse files
update utp tests
1 parent c48ad26 commit cf870e6

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/actions/run-unity-test-batch/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ inputs:
99
required: true
1010
build-args:
1111
description: Additional build args.
12-
required: true
12+
required: false
13+
default: ""
1314
artifact-name:
1415
description: Artifact name for uploaded UTP logs (must be unique per matrix job).
1516
required: false

.github/actions/scripts/run-utp-tests.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ BUILD_TARGET=${BUILD_TARGET:?BUILD_TARGET is required}
66
BUILD_ARGS=${BUILD_ARGS:-}
77
TESTS_INPUT=${TESTS_INPUT:-}
88

9+
if printf '%s' "$BUILD_ARGS" | grep -qE '[;&`|]'; then
10+
echo "::error::BUILD_ARGS contains disallowed shell metacharacters"
11+
exit 1
12+
fi
13+
14+
build_args=()
15+
if [ -n "$BUILD_ARGS" ]; then
16+
# Split on whitespace into an array without invoking the shell
17+
read -r -a build_args <<< "$BUILD_ARGS"
18+
fi
19+
920
IFS=',' read -ra tests <<< "$TESTS_INPUT"
1021
failures=0
1122

@@ -86,7 +97,7 @@ for raw_test in "${tests[@]}"; do
8697
build_rc=0
8798

8899
unity-cli run --log-name "${test_name}-Validate" -quit -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset || validate_rc=$?
89-
unity-cli run --log-name "${test_name}-Build" -buildTarget "$BUILD_TARGET" -quit -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity $BUILD_ARGS || build_rc=$?
100+
unity-cli run --log-name "${test_name}-Build" -buildTarget "$BUILD_TARGET" -quit -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity "${build_args[@]}" || build_rc=$?
90101

91102
expected=${expected_status[$test_name]:-0}
92103
exp_msg=${expected_message[$test_name]:-}

0 commit comments

Comments
 (0)