浏览代码

Add more editor versions for testing. (#2809)

/develop-gpu-test
GitHub 5 年前
当前提交
a6a84983
共有 4 个文件被更改,包括 120 次插入94 次删除
  1. 34
      .yamato/csharp-tests.yml
  2. 54
      .yamato/standalone-build-test.yml
  3. 55
      run-standalone-build-osx.sh
  4. 71
      run-tests-editmode-osx-editor.sh

34
.yamato/csharp-tests.yml


name: Mac Edit Mode Tests
triggers:
test_editors:
- version: 2017.4
- version: 2018.4
- version: 2019.3
---
{% for editor in test_editors %}
test_mac_editmode_{{ editor.version }}:
name: Test Mac EditMode {{ editor.version }}
agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:release
flavor: i1.small
variables:
UNITY_VERSION: {{ editor.version }}
commands:
- ./run-tests-editmode-osx-editor.sh
triggers:
- "/develop-.*/"
- "/develop-.*/"
- "develop"
- "develop"
pull_requests:
- targets:
only:

agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:stable
flavor: i1.small
variables:
LC_ALL: "en_US.UTF-8"
commands:
- ./run-tests-editmode-osx-editor.sh
{% endfor %}

54
.yamato/standalone-build-test.yml


name: Mac Standalone Build Test
triggers:
branches:
only:
- "/develop-.*/"
targets:
only:
- "develop"
pull_requests:
- targets:
only:
- "master"
- "/release-.*/"
- "/hotfix-.*/"
agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:stable
flavor: i1.small
variables:
LC_ALL: "en_US.UTF-8"
commands:
- ./run-standalone-build-osx.sh
test_editors:
- version: 2017.4
- version: 2018.4
- version: 2019.3
---
{% for editor in test_editors %}
test_mac_standalone_{{ editor.version }}:
name: Test Mac Standalone {{ editor.version }}
agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:release
flavor: i1.small
variables:
UNITY_VERSION: {{ editor.version }}
commands:
- ./run-standalone-build-osx.sh
triggers:
branches:
only:
- "/develop-.*/"
targets:
only:
- "develop"
pull_requests:
- targets:
only:
- "master"
- "/release-.*/"
- "/hotfix-.*/"
{% endfor %}

55
run-standalone-build-osx.sh


set -eo pipefail
EDITOR_VERSION="2017.4.33f1"
BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
if [[ -z "${UNITY_VERSION}" ]]; then
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
echo "Environment Variable UNITY_VERSION was not set"
exit 1
UNITY=${HUB_UNITY}
fi
BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
else
UNITY=${HUB_UNITY}
fi
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
echo "Cleaning previous results"
echo "Starting tests via $UNITY"
echo "Cleaning previous results"
CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -logfile - -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX"
echo "Starting tests via $UNITY"
echo "$CMD_LINE ..."
CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX"
${CMD_LINE}
RES=$?
echo "$CMD_LINE ..."
if [[ "${RES}" -eq "0" ]]; then
echo "Standalone build completed successfully.";
exit 0;
else
echo "Standalone build failed."
exit 1;
fi
${CMD_LINE}
RES=$?
exit ${RES}
if [[ "${RES}" -eq "0" ]]; then
echo "Standalone build completed successfully.";
exit 0;
else
echo "Standalone build failed."
exit 1;
exit ${RES}

71
run-tests-editmode-osx-editor.sh


set -eo pipefail
EDITOR_VERSION="2017.4.33f1"
BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
if [[ -z "${UNITY_VERSION}" ]]; then
echo "Environment Variable UNITY_VERSION was not set"
exit 1
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
UNITY=${HUB_UNITY}
fi
BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
else
UNITY=${HUB_UNITY}
fi
echo "Cleaning previous results"
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
if [[ -e ${BASETPATH}/results.xml ]]
then
rm ${BASETPATH}/results.xml
fi
echo "Cleaning previous results"
if [[ -e ${BASETPATH}/results.xml ]]
then
rm ${BASETPATH}/results.xml
fi
echo "Starting tests via $UNITY"
echo "Starting tests via $UNITY"
CMD_LINE="$UNITY -runTests -logfile - -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode"
CMD_LINE="$UNITY -runTests -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode"
echo "$CMD_LINE ..."
echo "$CMD_LINE ..."
$CMD_LINE
RES=$?
$CMD_LINE
RES=$?
TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml"
echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml"
if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then
echo "Test run SUCCEEDED!"
else
echo "Test run FAILED!"
fi
if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then
echo "Test run SUCCEEDED!"
else
echo "Test run FAILED!"
fi
rm "${BASETPATH}/results.xml"
rm "${BASETPATH}/results.xml"
exit ${RES}
exit ${RES}
fi
正在加载...
取消
保存