Skip to content

Commit 57a6499

Browse files
authored
Add more editor versions for testing. (#2809)
1 parent e2492f8 commit 57a6499

File tree

4 files changed

+120
-94
lines changed

4 files changed

+120
-94
lines changed

.yamato/csharp-tests.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
name: Mac Edit Mode Tests
2-
triggers:
1+
test_editors:
2+
- version: 2017.4
3+
- version: 2018.4
4+
- version: 2019.3
5+
---
6+
{% for editor in test_editors %}
7+
test_mac_editmode_{{ editor.version }}:
8+
name: Test Mac EditMode {{ editor.version }}
9+
agent:
10+
type: Unity::VM::osx
11+
image: ml-agents/ml-agents-bokken-mac:release
12+
flavor: i1.small
13+
variables:
14+
UNITY_VERSION: {{ editor.version }}
15+
commands:
16+
- ./run-tests-editmode-osx-editor.sh
17+
triggers:
318
branches:
419
only:
5-
- "/develop-.*/"
20+
- "/develop-.*/"
621
targets:
722
only:
8-
- "develop"
23+
- "develop"
924
pull_requests:
1025
- targets:
1126
only:
1227
- "master"
1328
- "/release-.*/"
1429
- "/hotfix-.*/"
15-
16-
agent:
17-
type: Unity::VM::osx
18-
image: ml-agents/ml-agents-bokken-mac:stable
19-
flavor: i1.small
20-
21-
variables:
22-
LC_ALL: "en_US.UTF-8"
23-
commands:
24-
- ./run-tests-editmode-osx-editor.sh
30+
{% endfor %}

.yamato/standalone-build-test.yml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,30 @@
1-
name: Mac Standalone Build Test
2-
triggers:
3-
branches:
4-
only:
5-
- "/develop-.*/"
6-
targets:
7-
only:
8-
- "develop"
9-
pull_requests:
10-
- targets:
11-
only:
12-
- "master"
13-
- "/release-.*/"
14-
- "/hotfix-.*/"
15-
16-
agent:
17-
type: Unity::VM::osx
18-
image: ml-agents/ml-agents-bokken-mac:stable
19-
flavor: i1.small
20-
21-
variables:
22-
LC_ALL: "en_US.UTF-8"
23-
commands:
24-
- ./run-standalone-build-osx.sh
1+
test_editors:
2+
- version: 2017.4
3+
- version: 2018.4
4+
- version: 2019.3
5+
---
6+
{% for editor in test_editors %}
7+
test_mac_standalone_{{ editor.version }}:
8+
name: Test Mac Standalone {{ editor.version }}
9+
agent:
10+
type: Unity::VM::osx
11+
image: ml-agents/ml-agents-bokken-mac:release
12+
flavor: i1.small
13+
variables:
14+
UNITY_VERSION: {{ editor.version }}
15+
commands:
16+
- ./run-standalone-build-osx.sh
17+
triggers:
18+
branches:
19+
only:
20+
- "/develop-.*/"
21+
targets:
22+
only:
23+
- "develop"
24+
pull_requests:
25+
- targets:
26+
only:
27+
- "master"
28+
- "/release-.*/"
29+
- "/hotfix-.*/"
30+
{% endfor %}

run-standalone-build-osx.sh

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,44 @@
22

33
set -eo pipefail
44

5-
EDITOR_VERSION="2017.4.33f1"
6-
BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
7-
HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
5+
if [[ -z "${UNITY_VERSION}" ]]; then
6+
7+
echo "Environment Variable UNITY_VERSION was not set"
8+
exit 1
89

9-
if [[ -f ${BOKKEN_UNITY} ]]; then
10-
UNITY=${BOKKEN_UNITY}
1110
else
12-
UNITY=${HUB_UNITY}
13-
fi
11+
BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
12+
HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
1413

15-
pushd $(dirname "${0}") > /dev/null
16-
BASETPATH=$(pwd -L)
17-
popd > /dev/null
14+
if [[ -f ${BOKKEN_UNITY} ]]; then
15+
UNITY=${BOKKEN_UNITY}
16+
else
17+
UNITY=${HUB_UNITY}
18+
fi
1819

19-
echo "Cleaning previous results"
20+
pushd $(dirname "${0}") > /dev/null
21+
BASETPATH=$(pwd -L)
22+
popd > /dev/null
2023

21-
echo "Starting tests via $UNITY"
24+
echo "Cleaning previous results"
2225

23-
CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX"
26+
echo "Starting tests via $UNITY"
2427

25-
echo "$CMD_LINE ..."
28+
CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -logfile - -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX"
2629

27-
${CMD_LINE}
28-
RES=$?
30+
echo "$CMD_LINE ..."
2931

30-
if [[ "${RES}" -eq "0" ]]; then
31-
echo "Standalone build completed successfully.";
32-
exit 0;
33-
else
34-
echo "Standalone build failed."
35-
exit 1;
36-
fi
32+
${CMD_LINE}
33+
RES=$?
3734

38-
exit ${RES}
35+
if [[ "${RES}" -eq "0" ]]; then
36+
echo "Standalone build completed successfully.";
37+
exit 0;
38+
else
39+
echo "Standalone build failed."
40+
exit 1;
41+
fi
42+
43+
exit ${RES}
44+
45+
fi

run-tests-editmode-osx-editor.sh

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,56 @@
22

33
set -eo pipefail
44

5-
EDITOR_VERSION="2017.4.33f1"
6-
BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
7-
HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
5+
if [[ -z "${UNITY_VERSION}" ]]; then
6+
7+
echo "Environment Variable UNITY_VERSION was not set"
8+
exit 1
89

9-
if [[ -f ${BOKKEN_UNITY} ]]; then
10-
UNITY=${BOKKEN_UNITY}
1110
else
12-
UNITY=${HUB_UNITY}
13-
fi
11+
BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
12+
HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
1413

15-
pushd $(dirname "${0}") > /dev/null
16-
BASETPATH=$(pwd -L)
17-
popd > /dev/null
14+
if [[ -f ${BOKKEN_UNITY} ]]; then
15+
UNITY=${BOKKEN_UNITY}
16+
else
17+
UNITY=${HUB_UNITY}
18+
fi
1819

19-
echo "Cleaning previous results"
20+
pushd $(dirname "${0}") > /dev/null
21+
BASETPATH=$(pwd -L)
22+
popd > /dev/null
2023

21-
if [[ -e ${BASETPATH}/results.xml ]]
22-
then
23-
rm ${BASETPATH}/results.xml
24-
fi
24+
echo "Cleaning previous results"
2525

26-
echo "Starting tests via $UNITY"
26+
if [[ -e ${BASETPATH}/results.xml ]]
27+
then
28+
rm ${BASETPATH}/results.xml
29+
fi
2730

28-
CMD_LINE="$UNITY -runTests -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode"
31+
echo "Starting tests via $UNITY"
2932

30-
echo "$CMD_LINE ..."
33+
CMD_LINE="$UNITY -runTests -logfile - -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode"
3134

32-
$CMD_LINE
33-
RES=$?
35+
echo "$CMD_LINE ..."
3436

35-
TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
36-
PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
37-
FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
38-
DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
37+
$CMD_LINE
38+
RES=$?
3939

40-
echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml"
40+
TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
41+
PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
42+
FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
43+
DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
4144

42-
if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then
43-
echo "Test run SUCCEEDED!"
44-
else
45-
echo "Test run FAILED!"
46-
fi
45+
echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml"
46+
47+
if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then
48+
echo "Test run SUCCEEDED!"
49+
else
50+
echo "Test run FAILED!"
51+
fi
52+
53+
rm "${BASETPATH}/results.xml"
4754

48-
rm "${BASETPATH}/results.xml"
55+
exit ${RES}
4956

50-
exit ${RES}
57+
fi

0 commit comments

Comments
 (0)