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

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