You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ci_container_test.sh 2.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. echo "Testing envs"
  2. printenv
  3. echo "ENV END"
  4. if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then
  5. pip install -r requirements/tests.txt
  6. git config --global --add safe.directory /Maas-lib
  7. git config --global user.email tmp
  8. git config --global user.name tmp.com
  9. # linter test
  10. # use internal project for pre-commit due to the network problem
  11. if [ `git remote -v | grep alibaba | wc -l` -gt 1 ]; then
  12. pre-commit run -c .pre-commit-config_local.yaml --all-files
  13. if [ $? -ne 0 ]; then
  14. echo "linter test failed, please run 'pre-commit run --all-files' to check"
  15. echo "From the repository folder"
  16. echo "Run 'pip install -r requirements/tests.txt' install test dependencies."
  17. echo "Run 'pre-commit install' install pre-commit hooks."
  18. echo "Finally run linter with command: 'pre-commit run --all-files' to check."
  19. echo "Ensure there is no failure!!!!!!!!"
  20. exit -1
  21. fi
  22. fi
  23. awk -F: '/^[^#]/ { print $1 }' requirements/framework.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  24. awk -F: '/^[^#]/ { print $1 }' requirements/audio.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  25. awk -F: '/^[^#]/ { print $1 }' requirements/cv.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  26. awk -F: '/^[^#]/ { print $1 }' requirements/multi-modal.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  27. awk -F: '/^[^#]/ { print $1 }' requirements/nlp.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  28. awk -F: '/^[^#]/ { print $1 }' requirements/science.txt | xargs -n 1 pip install -f https://modelscope.oss-cn-beijing.aliyuncs.com/releases/repo.html
  29. pip install -r requirements/tests.txt
  30. # test with install
  31. python setup.py install
  32. else
  33. echo "Running case in release image, run case directly!"
  34. fi
  35. if [ $# -eq 0 ]; then
  36. ci_command="python tests/run.py --subprocess"
  37. else
  38. ci_command="$@"
  39. fi
  40. echo "Running case with command: $ci_command"
  41. $ci_command