remote.sh.template 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. # This is a template file to execute remote machine.
  3. # python version is random on each VM
  4. export PATH=$PATH:/usr/local/bin:/Users/bokken/Library/Python/3.7/bin:/Users/bokken/Library/Python/3.8/bin
  5. export ARTIFACT_DIR=${PWD}/test-results
  6. # TEST_TARGET = `ios` or `macos`
  7. # TEST_PLATFORM = `editmode` or `playmode` or `standalone`
  8. # SCRIPTING_BACKEND = `il2cpp` or `mono`
  9. additional_component_arg="-c editor"
  10. platform=Editor
  11. architecture=${TEST_ARCHITECTURE}
  12. suite=playmode
  13. if [ ${TEST_PLATFORM} = "standalone" ]
  14. then
  15. if [ ${TEST_TARGET} = "ios" ]
  16. then
  17. additional_component_arg="-c editor -c iOS"
  18. architecture=arm64
  19. platform=iOS
  20. elif [ ${TEST_TARGET} = "iossimulator" ]
  21. then
  22. additional_component_arg="-c editor -c iOS"
  23. platform=iOS
  24. elif [ ${TEST_TARGET} = "macos" ]
  25. then
  26. platform=StandaloneOSX
  27. if [ ${SCRIPTING_BACKEND} = "il2cpp" ]
  28. then
  29. additional_component_arg="-c editor -c StandaloneSupport-IL2CPP"
  30. else
  31. additional_component_arg="-c editor -c StandaloneSupport-Mono"
  32. fi
  33. fi
  34. fi
  35. if [ ${TEST_PLATFORM} = "editmode" ]
  36. then
  37. suite=editor
  38. fi
  39. # install unity-downloader-cli
  40. pip3 install unity-downloader-cli \
  41. --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple \
  42. --no-use-pep517 \
  43. --upgrade \
  44. --user
  45. # install utr
  46. curl -s https://artifactory.prd.it.unity3d.com/artifactory/unity-tools/utr-standalone/utr \
  47. --output utr
  48. chmod +x ./utr
  49. # Install Rosetta when architecture is x64 and device is Apple Silicon
  50. if [ ${TEST_TARGET} = "macos" ] && [ ${architecture} = "x64" ] && [ `uname -m` == "arm64" ]
  51. then
  52. # install rosetta 2
  53. softwareupdate --install-rosetta --agree-to-license
  54. fi
  55. if [ ${TEST_PLATFORM} = "standalone" ]
  56. then
  57. # run utr
  58. ./utr \
  59. --suite=${suite} \
  60. --platform=${platform} \
  61. --player-load-path=${PLAYER_LOAD_PATH} \
  62. --artifacts_path=${ARTIFACT_DIR} \
  63. --architecture=${architecture} \
  64. --player-connection-ip=${BOKKEN_DEVICE_IP}
  65. result=$?
  66. else
  67. # download unity editor
  68. unity-downloader-cli \
  69. -u ${EDITOR_VERSION} \
  70. ${additional_component_arg} \
  71. --wait \
  72. --published
  73. # run utr
  74. ./utr \
  75. --suite=${suite} \
  76. --platform=${platform} \
  77. --scripting-backend=${SCRIPTING_BACKEND} \
  78. --extra-editor-arg="-${EXTRA_EDITOR_ARG}" \
  79. --testproject=${HOME}/${TEST_PROJECT_DIR} \
  80. --editor-location=${HOME}/.Editor \
  81. --artifacts_path=${ARTIFACT_DIR} \
  82. --architecture=${architecture}
  83. result=$?
  84. fi
  85. # return exit-code
  86. exit $result